56set_include_path(
"./Services/Database/lib/PEAR" . PATH_SEPARATOR . ini_get(
'include_path'));
 
   57if (!class_exists(
'PEAR')) {
 
   58        require_once 
'PEAR.php';
 
   72define(
'MDB2_OK',                      
true);
 
   73define(
'MDB2_ERROR',                     -1);
 
   74define(
'MDB2_ERROR_SYNTAX',              -2);
 
   75define(
'MDB2_ERROR_CONSTRAINT',          -3);
 
   76define(
'MDB2_ERROR_NOT_FOUND',           -4);
 
   77define(
'MDB2_ERROR_ALREADY_EXISTS',      -5);
 
   78define(
'MDB2_ERROR_UNSUPPORTED',         -6);
 
   79define(
'MDB2_ERROR_MISMATCH',            -7);
 
   80define(
'MDB2_ERROR_INVALID',             -8);
 
   81define(
'MDB2_ERROR_NOT_CAPABLE',         -9);
 
   82define(
'MDB2_ERROR_TRUNCATED',          -10);
 
   83define(
'MDB2_ERROR_INVALID_NUMBER',     -11);
 
   84define(
'MDB2_ERROR_INVALID_DATE',       -12);
 
   85define(
'MDB2_ERROR_DIVZERO',            -13);
 
   86define(
'MDB2_ERROR_NODBSELECTED',       -14);
 
   87define(
'MDB2_ERROR_CANNOT_CREATE',      -15);
 
   88define(
'MDB2_ERROR_CANNOT_DELETE',      -16);
 
   89define(
'MDB2_ERROR_CANNOT_DROP',        -17);
 
   90define(
'MDB2_ERROR_NOSUCHTABLE',        -18);
 
   91define(
'MDB2_ERROR_NOSUCHFIELD',        -19);
 
   92define(
'MDB2_ERROR_NEED_MORE_DATA',     -20);
 
   93define(
'MDB2_ERROR_NOT_LOCKED',         -21);
 
   94define(
'MDB2_ERROR_VALUE_COUNT_ON_ROW', -22);
 
   95define(
'MDB2_ERROR_INVALID_DSN',        -23);
 
   96define(
'MDB2_ERROR_CONNECT_FAILED',     -24);
 
   97define(
'MDB2_ERROR_EXTENSION_NOT_FOUND',-25);
 
   98define(
'MDB2_ERROR_NOSUCHDB',           -26);
 
   99define(
'MDB2_ERROR_ACCESS_VIOLATION',   -27);
 
  100define(
'MDB2_ERROR_CANNOT_REPLACE',     -28);
 
  101define(
'MDB2_ERROR_CONSTRAINT_NOT_NULL',-29);
 
  102define(
'MDB2_ERROR_DEADLOCK',           -30);
 
  103define(
'MDB2_ERROR_CANNOT_ALTER',       -31);
 
  104define(
'MDB2_ERROR_MANAGER',            -32);
 
  105define(
'MDB2_ERROR_MANAGER_PARSE',      -33);
 
  106define(
'MDB2_ERROR_LOADMODULE',         -34);
 
  107define(
'MDB2_ERROR_INSUFFICIENT_DATA',  -35);
 
  114define(
'MDB2_PREPARE_MANIP', 
false);
 
  115define(
'MDB2_PREPARE_RESULT', 
null);
 
  124define(
'MDB2_FETCHMODE_DEFAULT', 0);
 
  129define(
'MDB2_FETCHMODE_ORDERED', 1);
 
  134define(
'MDB2_FETCHMODE_ASSOC', 2);
 
  139define(
'MDB2_FETCHMODE_OBJECT', 3);
 
  147define(
'MDB2_FETCHMODE_FLIPPED', 4);
 
  156define(
'MDB2_PORTABILITY_NONE', 0);
 
  163define(
'MDB2_PORTABILITY_FIX_CASE', 1);
 
  169define(
'MDB2_PORTABILITY_RTRIM', 2);
 
  175define(
'MDB2_PORTABILITY_DELETE_COUNT', 4);
 
  181define(
'MDB2_PORTABILITY_NUMROWS', 8);
 
  196define(
'MDB2_PORTABILITY_ERRORS', 16);
 
  203define(
'MDB2_PORTABILITY_EMPTY_TO_NULL', 32);
 
  209define(
'MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES', 64);
 
  215define(
'MDB2_PORTABILITY_ALL', 127);
 
  287            foreach (
$options as $option => $value) {
 
  288                $test = $db->setOption($option, $value);
 
  311        if (version_compare(phpversion(), 
"5.0", 
">=")) {
 
  312            return class_exists($classname, 
false);
 
  314        return class_exists($classname);
 
  333            $file_name = str_replace(
'_', DIRECTORY_SEPARATOR, $class_name).
'.php';
 
  335                $include = include_once($file_name);
 
  337                $include = @include_once($file_name);
 
  341                    $msg = 
"unable to find package '$class_name' file '$file_name'";
 
  343                    $msg = 
"unable to load class '$class_name' from file '$file_name'";
 
  382        if (empty($dsninfo[
'phptype'])) {
 
  384                null, 
null, 
'no RDBMS driver specified');
 
  387        $class_name = 
'MDB2_Driver_'.$dsninfo[
'phptype'];
 
  395        $db = 
new $class_name();
 
  396        $db->setDSN($dsninfo);
 
  443        $err = $db->connect();
 
  445            $dsn = $db->getDSN(
'string', 
'xxx');
 
  447            $err->addUserInfo($dsn);
 
  490            $dsninfo = array_merge(
$GLOBALS[
'_MDB2_dsninfo_default'], $dsninfo);
 
  495                    if (count(array_diff_assoc($tmp_dsn, $dsninfo)) == 0) {
 
  501        } elseif (is_array(
$GLOBALS[
'_MDB2_databases']) && reset(
$GLOBALS[
'_MDB2_databases'])) {
 
  523        $file_name = 
'MDB2'.DIRECTORY_SEPARATOR.$file.
'.php';
 
  526                'unable to find: '.$file_name);
 
  528        if (!include_once($file_name)) {
 
  530                'unable to load driver class: '.$file_name);
 
  601        if (is_a(
$data, 
'MDB2_Error')) {
 
  602            if (is_null(
$code)) {
 
  604            } elseif (is_string(
$code)) {
 
  628        return is_a($value, 
'MDB2_Driver_Common');
 
  645        return is_a($value, 
'MDB2_Result');
 
  662        return is_a($value, 
'MDB2_Result_Common');
 
  679        return is_a($value, 
'MDB2_Statement');
 
  699        static $errorMessages;
 
  701        if (is_array($value)) {
 
  702            $errorMessages = $value;
 
  706        if (!isset($errorMessages)) {
 
  707            $errorMessages = array(
 
  744        if (is_null($value)) {
 
  745            return $errorMessages;
 
  749            $value = $value->getCode();
 
  752        return isset($errorMessages[$value]) ?
 
  753           $errorMessages[$value] : $errorMessages[
MDB2_ERROR];
 
  798        $parsed = 
$GLOBALS[
'_MDB2_dsninfo_default'];
 
  800        if (is_array($dsn)) {
 
  801            $dsn = array_merge($parsed, $dsn);
 
  802            if (!$dsn[
'dbsyntax']) {
 
  803                $dsn[
'dbsyntax'] = $dsn[
'phptype'];
 
  809        if (($pos = strpos($dsn, 
'://')) !== 
false) {
 
  810            $str = substr($dsn, 0, $pos);
 
  811            $dsn = substr($dsn, $pos + 3);
 
  819        if (preg_match(
'|^(.+?)\((.*?)\)$|', $str, $arr)) {
 
  820            $parsed[
'phptype']  = $arr[1];
 
  821            $parsed[
'dbsyntax'] = !$arr[2] ? $arr[1] : $arr[2];
 
  823            $parsed[
'phptype']  = $str;
 
  824            $parsed[
'dbsyntax'] = $str;
 
  833        if (($at = strrpos($dsn,
'@')) !== 
false) {
 
  834            $str = substr($dsn, 0, $at);
 
  835            $dsn = substr($dsn, $at + 1);
 
  836            if (($pos = strpos($str, 
':')) !== 
false) {
 
  837                $parsed[
'username'] = rawurldecode(substr($str, 0, $pos));
 
  838                $parsed[
'password'] = rawurldecode(substr($str, $pos + 1));
 
  840                $parsed[
'username'] = rawurldecode($str);
 
  847        if (preg_match(
'|^([^(]+)\((.*?)\)/?(.*?)$|', $dsn, $match)) {
 
  849            $proto_opts  = $match[2] ? $match[2] : 
false;
 
  854            if (strpos($dsn, 
'+') !== 
false) {
 
  855                list($proto, $dsn) = explode(
'+', $dsn, 2);
 
  857            if (   strpos($dsn, 
'//') === 0
 
  858                && strpos($dsn, 
'/', 2) !== 
false 
  859                && $parsed[
'phptype'] == 
'oci8' 
  866            } elseif (strpos($dsn, 
'/') !== 
false) {
 
  867                list($proto_opts, $dsn) = explode(
'/', $dsn, 2);
 
  875        $parsed[
'protocol'] = (!empty($proto)) ? $proto : 
'tcp';
 
  876        $proto_opts = rawurldecode($proto_opts);
 
  877        if (strpos($proto_opts, 
':') !== 
false) {
 
  878            list($proto_opts, $parsed[
'port']) = explode(
':', $proto_opts);
 
  880        if ($parsed[
'protocol'] == 
'tcp') {
 
  881            $parsed[
'hostspec'] = $proto_opts;
 
  882        } elseif ($parsed[
'protocol'] == 
'unix') {
 
  883            $parsed[
'socket'] = $proto_opts;
 
  890            if (($pos = strpos($dsn, 
'?')) === 
false) {
 
  891                $parsed[
'database'] = $dsn;
 
  894                $parsed[
'database'] = substr($dsn, 0, $pos);
 
  895                $dsn = substr($dsn, $pos + 1);
 
  896                if (strpos($dsn, 
'&') !== 
false) {
 
  897                    $opts = explode(
'&', $dsn);
 
  901                foreach ($opts as $opt) {
 
  902                    list(
$key, $value) = explode(
'=', $opt);
 
  903                    if (!isset($parsed[
$key])) {
 
  905                        $parsed[
$key] = rawurldecode($value);
 
  929        if (!@ini_get(
'safe_mode')) {
 
  930             $dirs = explode(PATH_SEPARATOR, ini_get(
'include_path'));
 
  931             foreach ($dirs as $dir) {
 
  932                 if (@is_readable($dir . DIRECTORY_SEPARATOR . 
$file)) {
 
  937            $fp = @fopen(
$file, 
'r', 
true);
 
  938            if (is_resource($fp)) {
 
  972              $level = E_USER_NOTICE, $debuginfo = 
null)
 
  974        if (is_null(
$code)) {
 
 1060        'sequences' => 
false,
 
 1062        'affected_rows' => 
false,
 
 1063        'summary_functions' => 
false,
 
 1064        'order_by_text' => 
false,
 
 1065        'transactions' => 
false,
 
 1066        'savepoints' => 
false,
 
 1067        'current_id' => 
false,
 
 1068        'limit_queries' => 
false,
 
 1071        'sub_selects' => 
false,
 
 1072        'auto_increment' => 
false,
 
 1073        'primary_key' => 
false,
 
 1074        'result_introspection' => 
false,
 
 1075        'prepared_statements' => 
false,
 
 1076        'identifier_quoting' => 
false,
 
 1077        'pattern_escaping' => 
false,
 
 1078        'new_link' => 
false,
 
 1129        'field_case' => CASE_LOWER,
 
 1130        'disable_query' => 
false,
 
 1131        'result_class' => 
'MDB2_Result_%s',
 
 1132        'buffered_result_class' => 
'MDB2_BufferedResult_%s',
 
 1133        'result_wrap_class' => 
false,
 
 1134        'result_buffering' => 
true,
 
 1135        'fetch_class' => 
'stdClass',
 
 1136        'persistent' => 
false,
 
 1138        'debug_handler' => 
'MDB2_defaultDebugOutput',
 
 1139        'debug_expanded_output' => 
false,
 
 1140        'default_text_field_length' => 4096,
 
 1141        'lob_buffer_length' => 8192,
 
 1142        'log_line_break' => 
"\n",
 
 1143        'idxname_format' => 
'%s_idx',
 
 1144        'seqname_format' => 
'%s_seq',
 
 1145        'savepoint_format' => 
'MDB2_SAVEPOINT_%s',
 
 1146        'statement_format' => 
'MDB2_STATEMENT_%1$s_%2$s',
 
 1147        'seqcol_name' => 
'sequence',
 
 1148        'quote_identifier' => 
false,
 
 1149        'use_transactions' => 
true,
 
 1150        'decimal_places' => 2,
 
 1160        'emulate_prepared' => 
false,
 
 1161        'datatype_map' => array(),
 
 1162        'datatype_map_callback' => array(),
 
 1163        'nativetype_map_callback' => array(),
 
 1171    var 
$string_quoting = array(
'start' => 
"'", 
'end' => 
"'", 
'escape' => 
false, 
'escape_pattern' => 
false);
 
 1186        array(
'start' => 
'--', 
'end' => 
"\n", 
'escape' => 
false),
 
 1187        array(
'start' => 
'/*', 
'end' => 
'*/', 
'escape' => 
false),
 
 1317        $this->destructor_registered = 
false;
 
 1344        unset(
$GLOBALS[
'_MDB2_databases'][$this->db_index]);
 
 1345        unset($this->db_index);
 
 1361        $info = get_class($this);
 
 1362        $info.= 
': (phptype = '.$this->phptype.
', dbsyntax = '.$this->dbsyntax.
')';
 
 1363        if ($this->connection) {
 
 1364            $info.= 
' [connected]';
 
 1383        return array(
$error, 
null, 
null);
 
 1417            $error_class = 
null,
 
 1420        $userinfo = 
"[Error message: $userinfo]\n";
 
 1425            if (is_null($mode) && !empty($this->_default_error_mode)) {
 
 1429            if (is_null($userinfo)) {
 
 1430                $userinfo = 
$code->getUserinfo();
 
 1436        } elseif (isset($this->connection)) {
 
 1437            if (!empty($this->last_query)) {
 
 1438                $userinfo.= 
"[Last executed query: {$this->last_query}]\n";
 
 1440            $native_errno = $native_msg = 
null;
 
 1442            if (!is_null($native_errno) && $native_errno !== 
'') {
 
 1443                $userinfo.= 
"[Native code: $native_errno]\n";
 
 1445            if (!is_null($native_msg) && $native_msg !== 
'') {
 
 1446                $userinfo.= 
"[Native message: ". strip_tags($native_msg) .
"]\n";
 
 1448            if (!is_null($method)) {
 
 1449                $userinfo = $method.
': '.$userinfo;
 
 1455            && isset($this->nested_transaction_counter) && !$this->has_transaction_error) {
 
 1456            $this->has_transaction_error =& $err;
 
 1473        $this->warnings = array();
 
 1490        return array_reverse($this->warnings);
 
 1519            $this->options[
'fetch_class'] = $object_class;
 
 1526                'invalid fetchmode mode', __FUNCTION__);
 
 1547        if (array_key_exists($option, $this->options)) {
 
 1548            $this->options[$option] = $value;
 
 1552            "unknown option $option", __FUNCTION__);
 
 1569        if (array_key_exists($option, $this->options)) {
 
 1570            return $this->options[$option];
 
 1573            "unknown option $option", __FUNCTION__);
 
 1595        if ($this->options[
'debug'] && $this->options[
'debug_handler']) {
 
 1596            if (!$this->options[
'debug_expanded_output']) {
 
 1597                if (!empty($context[
'when']) && $context[
'when'] !== 
'pre') {
 
 1600                $context = empty($context[
'is_manip']) ? false : $context[
'is_manip'];
 
 1602            return call_user_func_array($this->options[
'debug_handler'], array(&$this, $scope, 
$message, $context));
 
 1638        if ($escape_wildcards) {
 
 1642        $text = str_replace($this->string_quoting[
'end'], $this->string_quoting[
'escape'] . $this->string_quoting[
'end'], 
$text);
 
 1665        if ($this->string_quoting[
'escape_pattern']) {
 
 1666            $text = str_replace($this->string_quoting[
'escape_pattern'], $this->string_quoting[
'escape_pattern'] . $this->string_quoting[
'escape_pattern'], 
$text);
 
 1667            foreach ($this->wildcards as $wildcard) {
 
 1668                $text = str_replace($wildcard, $this->string_quoting[
'escape_pattern'] . $wildcard, 
$text);
 
 1713        if ($check_option && !$this->options[
'quote_identifier']) {
 
 1716        $str = str_replace($this->identifier_quoting[
'end'], $this->identifier_quoting[
'escape'] . $this->identifier_quoting[
'end'], $str);
 
 1717        return $this->identifier_quoting[
'start'] . $str . $this->identifier_quoting[
'end'];
 
 1771                if ($value === 
'') {
 
 1778                if (is_string($value)) {
 
 1786                $tmp_row[preg_replace(
'/^(?:.*\.)?([^.]+)$/', 
'\\1', 
$key)] = $value;
 
 1792                if ($value === 
'') {
 
 1794                } elseif (is_string($value)) {
 
 1802                if (is_string($value)) {
 
 1803                    $value = rtrim($value);
 
 1805                $tmp_row[preg_replace(
'/^(?:.*\.)?([^.]+)$/', 
'\\1', 
$key)] = $value;
 
 1812                if ($value === 
'') {
 
 1815                $tmp_row[preg_replace(
'/^(?:.*\.)?([^.]+)$/', 
'\\1', 
$key)] = $value;
 
 1822                if ($value === 
'') {
 
 1824                } elseif (is_string($value)) {
 
 1825                    $value = rtrim($value);
 
 1827                $tmp_row[preg_replace(
'/^(?:.*\.)?([^.]+)$/', 
'\\1', 
$key)] = $value;
 
 1854            $property = strtolower(
$module);
 
 1857        if (!isset($this->{$property})) {
 
 1859            if ($phptype_specific !== 
false) {
 
 1862                $file_name = str_replace(
'_', DIRECTORY_SEPARATOR, $class_name).
'.php';
 
 1864            if ($phptype_specific === 
false 
 1868                $class_name = 
'MDB2_'.$module;
 
 1869                $file_name = str_replace(
'_', DIRECTORY_SEPARATOR, $class_name).
'.php';
 
 1879                if (method_exists($class_name, 
'getClassName')) {
 
 1880                    $class_name_new = call_user_func(array($class_name, 
'getClassName'), $this->db_index);
 
 1881                    if ($class_name != $class_name_new) {
 
 1882                        $class_name = $class_name_new;
 
 1893                    "unable to load module '$module' into property '$property'", __FUNCTION__);
 
 1896            $this->{$property} = 
new $class_name($this->db_index);
 
 1897            $this->modules[
$module] =& $this->{$property};
 
 1902                $this->loaded_version_modules[] = $property;
 
 1906        return $this->{$property};
 
 1923        if (preg_match(
'/^([a-z]+)([A-Z])(.*)$/', $method, $match)
 
 1924            && isset($this->options[
'modules'][$match[1]])
 
 1926            $module = $this->options[
'modules'][$match[1]];
 
 1927            $method = strtolower($match[2]).$match[3];
 
 1928            if (!isset($this->modules[
$module]) || !is_object($this->modules[
$module])) {
 
 1935            foreach ($this->modules as 
$key => $foo) {
 
 1936                if (is_object($this->modules[
$key])
 
 1937                    && method_exists($this->modules[
$key], $method)
 
 1945            return call_user_func_array(array(&$this->modules[
$module], $method), 
$params);
 
 1947        trigger_error(
sprintf(
'Call to undefined function: %s::%s().', get_class($this), $method), E_USER_ERROR);
 
 1963        $this->
debug(
'Starting transaction', __FUNCTION__, array(
'is_manip' => 
true, 
'savepoint' => $savepoint));
 
 1965            'transactions are not supported', __FUNCTION__);
 
 1984        $this->
debug(
'Committing transaction/savepoint', __FUNCTION__, array(
'is_manip' => 
true, 
'savepoint' => $savepoint));
 
 1986            'commiting transactions is not supported', __FUNCTION__);
 
 2005        $this->
debug(
'Rolling back transaction/savepoint', __FUNCTION__, array(
'is_manip' => 
true, 
'savepoint' => $savepoint));
 
 2007            'rolling back transactions is not supported', __FUNCTION__);
 
 2026        if (!$ignore_nested && isset($this->nested_transaction_counter)) {
 
 2053        $this->
debug(
'Setting transaction isolation level', __FUNCTION__, array(
'is_manip' => 
true));
 
 2055            'isolation level setting is not supported', __FUNCTION__);
 
 2076        if ($this->in_transaction) {
 
 2078            $savepoint = 
sprintf($this->options[
'savepoint_format'], $this->nested_transaction_counter);
 
 2079            if ($this->
supports(
'savepoints') && $savepoint) {
 
 2084        $this->has_transaction_error = 
false;
 
 2086        $this->nested_transaction_counter = 1;
 
 2112        if ($this->nested_transaction_counter > 1) {
 
 2113            $savepoint = 
sprintf($this->options[
'savepoint_format'], $this->nested_transaction_counter);
 
 2114            if ($this->
supports(
'savepoints') && $savepoint) {
 
 2115                if ($force_rollback || $this->has_transaction_error) {
 
 2119                        $this->has_transaction_error = 
false;
 
 2131        $this->nested_transaction_counter = 
null;
 
 2135        if ($this->in_transaction) {
 
 2136            if ($force_rollback || $this->has_transaction_error) {
 
 2145        $this->has_transaction_error = 
false;
 
 2170            $error = $this->has_transaction_error ? $this->has_transaction_error : 
true;
 
 2174        $this->has_transaction_error = 
$error;
 
 2175        if (!$immediately) {
 
 2213            'method not implemented', __FUNCTION__);
 
 2230            'method not implemented', __FUNCTION__);
 
 2249        $this->connection = 0;
 
 2250        $this->connected_dsn = array();
 
 2251        $this->connected_database_name = 
'';
 
 2252        $this->opened_persistent = 
null;
 
 2253        $this->connected_server_info = 
'';
 
 2254        $this->in_transaction = 
null;
 
 2255        $this->nested_transaction_counter = 
null;
 
 2273        $previous_database_name = (isset($this->database_name)) ? $this->database_name : 
'';
 
 2274        $this->database_name = 
$name;
 
 2276        return $previous_database_name;
 
 2308        $dsn_default = 
$GLOBALS[
'_MDB2_dsninfo_default'];
 
 2310        if (array_key_exists(
'database', 
$dsn)) {
 
 2311            $this->database_name = 
$dsn[
'database'];
 
 2312            unset(
$dsn[
'database']);
 
 2314        $this->dsn = array_merge($dsn_default, 
$dsn);
 
 2333        $dsn = array_merge(
$GLOBALS[
'_MDB2_dsninfo_default'], $this->dsn);
 
 2337            $dsn[
'password'] = $hidepw;
 
 2343               (
$dsn[
'dbsyntax'] ? (
'('.$dsn[
'dbsyntax'].
')') : 
'').
 
 2344               '://'.
$dsn[
'username'].
':'.
 
 2345                $dsn[
'password'].
'@'.
$dsn[
'hostspec'].
 
 2346                (
$dsn[
'port'] ? (
':'.
$dsn[
'port']) : 
'').
 
 2347                '/'.
$dsn[
'database'];
 
 2375        $this->offset = $this->limit = 0;
 
 2390            return $affected_rows;
 
 2432        $this->last_query = 
$query;
 
 2433        $result = $this->
debug(
$query, 
'query', array(
'is_manip' => $is_manip, 
'when' => 
'pre'));
 
 2441            'method not implemented', __FUNCTION__);
 
 2461            'method not implemented', __FUNCTION__);
 
 2480        $this->offset = $this->limit = 0;
 
 2494        return $affectedRows;
 
 2513    function &
query(
$query, $types = 
null, $result_class = 
true, $result_wrap_class = 
false)
 
 2517        $this->offset = $this->limit = 0;
 
 2555        if ($types === 
true) {
 
 2556            if ($this->
supports(
'result_introspection')) {
 
 2558                $tableInfo = $this->reverse->tableInfo(
$result);
 
 2563                foreach ($tableInfo as $field) {
 
 2564                    $types[] = $field[
'mdb2type'];
 
 2571        if ($result_class === 
true) {
 
 2572            $result_class = $this->options[
'result_buffering']
 
 2573                ? $this->options[
'buffered_result_class'] : $this->options[
'result_class'];
 
 2576        if ($result_class) {
 
 2577            $class_name = 
sprintf($result_class, $this->phptype);
 
 2580                    'result class does not exist '.$class_name, __FUNCTION__);
 
 2586                    'result class is not extended from MDB2_Result_Common', __FUNCTION__);
 
 2589            if (!empty($types)) {
 
 2590                $err = 
$result->setResultTypes($types);
 
 2597        if ($result_wrap_class === 
true) {
 
 2598            $result_wrap_class = $this->options[
'result_wrap_class'];
 
 2600        if ($result_wrap_class) {
 
 2603                    'result wrap class does not exist '.$result_wrap_class, __FUNCTION__);
 
 2626            'method not implemented', __FUNCTION__);
 
 2644        if (!$this->
supports(
'limit_queries')) {
 
 2646                'limit is not supported by this driver', __FUNCTION__);
 
 2651                'it was not specified a valid selected range row limit', __FUNCTION__);
 
 2658                    'it was not specified a valid first selected range row', __FUNCTION__);
 
 2682        if ($this->
supports(
'sub_selects') === 
true) {
 
 2686        if (!$this->
supports(
'sub_selects')) {
 
 2688                'method not implemented', __FUNCTION__);
 
 2695        if (!is_array($col) || count($col) == 0) {
 
 2700            return $this->datatype->implodeArray($col, 
$type);
 
 2702        return implode(
', ', $col);
 
 2775                'replace query is not supported', __FUNCTION__);
 
 2777        $count = count($fields);
 
 2778        $condition = $values = array();
 
 2779        for ($colnum = 0, reset($fields); $colnum < $count; next($fields), $colnum++) {
 
 2780            $name = key($fields);
 
 2781            if (isset($fields[
$name][
'null']) && $fields[
$name][
'null']) {
 
 2784                $type = isset($fields[
$name][
'type']) ? $fields[
$name][
'type'] : 
null;
 
 2787            $values[
$name] = $value;
 
 2788            if (isset($fields[
$name][
'key']) && $fields[
$name][
'key']) {
 
 2789                if ($value === 
'NULL') {
 
 2791                        'key value '.$name.
' may not be NULL', __FUNCTION__);
 
 2793                $condition[] = 
$name . 
'=' . $value;
 
 2796        if (empty($condition)) {
 
 2798                'not specified which fields are keys', __FUNCTION__);
 
 2812        $condition = 
' WHERE '.implode(
' AND ', $condition);
 
 2813        $query = 
"DELETE FROM $table$condition";
 
 2817            $insert = implode(
', ', array_keys($values));
 
 2818            $values = implode(
', ', $values);
 
 2819            $query = 
"INSERT INTO $table ($insert) VALUES ($values)";
 
 2838        return $affected_rows;
 
 2871        $this->offset = $this->limit = 0;
 
 2872        $result = $this->
debug(
$query, __FUNCTION__, array(
'is_manip' => $is_manip, 
'when' => 
'pre'));
 
 2879        $placeholder_type_guess = $placeholder_type = 
null;
 
 2882        $positions = array();
 
 2887        while ($position < strlen(
$query)) {
 
 2888            $q_position = strpos(
$query, $question, $position);
 
 2889            $c_position = strpos(
$query, $colon, $position);
 
 2890            if ($q_position && $c_position) {
 
 2891                $p_position = min($q_position, $c_position);
 
 2892            } elseif ($q_position) {
 
 2893                $p_position = $q_position;
 
 2894            } elseif ($c_position) {
 
 2895                $p_position = $c_position;
 
 2899            if (is_null($placeholder_type)) {
 
 2900                $placeholder_type_guess = 
$query[$p_position];
 
 2907            if ($new_pos != $position) {
 
 2908                $position = $new_pos;
 
 2912            if (
$query[$position] == $placeholder_type_guess) {
 
 2913                if (is_null($placeholder_type)) {
 
 2914                    $placeholder_type = 
$query[$p_position];
 
 2915                    $question = $colon = $placeholder_type;
 
 2916                    if (!empty($types) && is_array($types)) {
 
 2917                        if ($placeholder_type == 
':') {
 
 2918                            if (is_int(key($types))) {
 
 2919                                $types_tmp = $types;
 
 2924                            $types = array_values($types);
 
 2928                if ($placeholder_type == 
':') {
 
 2929                    $parameter = preg_replace(
'/^.{'.($position+1).
'}([a-z0-9_]+).*$/si', 
'\\1', 
$query);
 
 2930                    if ($parameter === 
'') {
 
 2932                            'named parameter with an empty name', __FUNCTION__);
 
 2935                    $positions[$p_position] = $parameter;
 
 2936                    $query = substr_replace(
$query, 
'?', $position, strlen($parameter)+1);
 
 2938                    if (isset($count) && isset($types_tmp[++$count])) {
 
 2939                        $types[$parameter] = $types_tmp[$count];
 
 2942                    $positions[$p_position] = count($positions);
 
 2944                $position = $p_position + 1;
 
 2946                $position = $p_position;
 
 2949        $class_name = 
'MDB2_Statement_'.$this->phptype;
 
 2951        $obj = 
new $class_name($this, $statement, $positions, 
$query, $types, $result_types, $is_manip, 
$limit, 
$offset);
 
 2952        $this->
debug(
$query, __FUNCTION__, array(
'is_manip' => $is_manip, 
'when' => 
'post', 
'result' => $obj));
 
 2980        foreach ($ignores as 
$ignore) {
 
 2981            if (!empty(
$ignore[
'start'])) {
 
 2982                if (is_int($start_quote = strpos(
$query, 
$ignore[
'start'], $position)) && $start_quote < $p_position) {
 
 2983                    $end_quote = $start_quote;
 
 2985                        if (!is_int($end_quote = strpos(
$query, 
$ignore[
'end'], $end_quote + 1))) {
 
 2986                            if (
$ignore[
'end'] === 
"\n") {
 
 2987                                $end_quote = strlen(
$query) - 1;
 
 2990                                    'query with an unterminated text string specified', __FUNCTION__);
 
 2995                    $position = $end_quote + 1;
 
 3020    function quote($value, 
$type = 
null, $quote = 
true, $escape_wildcards = 
false)
 
 3027        return $this->datatype->quote($value, 
$type, $quote, $escape_wildcards);
 
 3052        return $this->datatype->getDeclaration(
$type, 
$name, $field);
 
 3074        return $this->datatype->compareDefinition(
$current, $previous);
 
 3094        if (array_key_exists($feature, $this->supported)) {
 
 3095            return $this->supported[$feature];
 
 3098            "unknown support feature $feature", __FUNCTION__);
 
 3115        return sprintf($this->options[
'seqname_format'],
 
 3116            preg_replace(
'/[^a-z0-9_\$.]/i', 
'_', $sqn));
 
 3133        return sprintf($this->options[
'idxname_format'],
 
 3134            preg_replace(
'/[^a-z0-9_\$]/i', 
'_', $idx));
 
 3153            'method not implemented', __FUNCTION__);
 
 3173            'method not implemented', __FUNCTION__);
 
 3190        $this->warnings[] = 
'database does not support getting current 
 3191            sequence value, the sequence value was incremented';
 
 3192        return $this->
nextID($seq_name);
 
 3221        $one = 
$result->fetchOne($colnum);
 
 3282        $col = 
$result->fetchCol($colnum);
 
 3315        $rekey = 
false, $force_array = 
false, $group = 
false)
 
 3346require_once(
'./Services/Database/interfaces/interface.ilDBStatement.php');
 
 3379        $this->limit = max(0, 
$limit - 1);
 
 3384        return $this->
fetchRow($fetch_mode);
 
 3434        $load = $this->db->loadModule(
'Datatype', 
null, 
true);
 
 3438        $types = $this->db->datatype->checkResultTypes(
$types);
 
 3461        if ($this->rownum > $target_rownum) {
 
 3463                'seeking to previous rows not implemented', __FUNCTION__);
 
 3465        while ($this->rownum < $target_rownum) {
 
 3487            'method not implemented', __FUNCTION__);
 
 3511        if (!array_key_exists($colnum, 
$row)) {
 
 3513                'column is not defined in the result set: '.$colnum, __FUNCTION__);
 
 3515        return $row[$colnum];
 
 3535        if (is_array(
$row)) {
 
 3536            if (!array_key_exists($colnum, 
$row)) {
 
 3538                    'column is not defined in the result set: '.$colnum, __FUNCTION__);
 
 3542            } 
while (is_array(
$row = $this->
fetchRow($fetchmode)));
 
 3577        $force_array = 
false, $group = 
false)
 
 3587        $shift_array = $rekey ? false : 
null;
 
 3588        if (!is_null($shift_array)) {
 
 3589            if (is_object(
$row)) {
 
 3590                $colnum = count(get_object_vars(
$row));
 
 3592                $colnum = count(
$row);
 
 3596                    'rekey feature requires atleast 2 column', __FUNCTION__);
 
 3598            $shift_array = (!$force_array && $colnum == 2);
 
 3603                if (is_object(
$row)) {
 
 3604                    $arr = get_object_vars(
$row);
 
 3627                    $all[
$key][] = $val;
 
 3649        return $this->rownum + 1;
 
 3665            'method not implemented', __FUNCTION__);
 
 3681            'method not implemented', __FUNCTION__);
 
 3702        if (!isset($this->column_names)) {
 
 3703            $result = $this->_getColumnNames();
 
 3707            $this->column_names = 
$result;
 
 3710            return array_flip($this->column_names);
 
 3712        return $this->column_names;
 
 3731            'method not implemented', __FUNCTION__);
 
 3748            'method not implemented', __FUNCTION__);
 
 3783            $column_names = $this->getColumnNames();
 
 3785                if ($this->db->options[
'field_case'] == CASE_LOWER) {
 
 3793        $this->values[
$column] =& $value;
 
 3794        if (!is_null(
$type)) {
 
 3816            if (array_key_exists(
$column, $this->values)) {
 
 3817                $this->values[
$column] = $value;
 
 3835        $this->result = 
false;
 
 3846                $res = $this->result->execute($a_data);
 
 3848                        throw new ilDatabaseException(
"There was an MDB2 error executing the prepared query: ".$this->result->getMessage());
 
 3930        $this->positions = $positions;
 
 3932        $this->types = (array)
$types;
 
 3968        if (!is_numeric($parameter)) {
 
 3969            $parameter = preg_replace(
'/^:(.*)$/', 
'\\1', $parameter);
 
 3971        if (!in_array($parameter, $this->positions)) {
 
 3973                'Unable to bind to missing placeholder: '.$parameter, __FUNCTION__);
 
 3975        $this->values[$parameter] = $value;
 
 3976        if (!is_null(
$type)) {
 
 3977            $this->types[$parameter] = 
$type;
 
 4001        $parameters = array_keys(
$values);
 
 4002        foreach ($parameters as 
$key => $parameter) {
 
 4029        if (!is_numeric($parameter)) {
 
 4030            $parameter = preg_replace(
'/^:(.*)$/', 
'\\1', $parameter);
 
 4032        if (!in_array($parameter, $this->positions)) {
 
 4034                'Unable to bind to missing placeholder: '.$parameter, __FUNCTION__);
 
 4036        $this->values[$parameter] =& $value;
 
 4037        if (!is_null(
$type)) {
 
 4038            $this->types[$parameter] = 
$type;
 
 4062        $parameters = array_keys(
$values);
 
 4063        foreach ($parameters as 
$key => $parameter) {
 
 4090        if (is_null($this->positions)) {
 
 4091            return $this->db->raiseError(
MDB2_ERROR, 
null, 
null,
 
 4092                'Prepared statement has already been freed', __FUNCTION__);
 
 4099                return $this->db->raiseError(
MDB2_ERROR, 
null, 
null,
 
 4100                                            'Binding Values failed with message: ' . $err->getMessage(), __FUNCTION__);
 
 4120    function &
_execute($result_class = 
true, $result_wrap_class = 
false)
 
 4125        foreach ($this->positions as $current_position => $parameter) {
 
 4126            if (!array_key_exists($parameter, $this->values)) {
 
 4128                    'Unable to bind to missing placeholder: '.$parameter, __FUNCTION__);
 
 4130            $value = $this->values[$parameter];
 
 4131            $query.= substr($this->query, $last_position, $current_position - $last_position);
 
 4132            if (!isset($value)) {
 
 4133                $value_quoted = 
'NULL';
 
 4135                $type = !empty($this->types[$parameter]) ? $this->types[$parameter] : 
null;
 
 4136                $value_quoted = $this->db->quote($value, 
$type);
 
 4138                    return $value_quoted;
 
 4142            $last_position = $current_position + 1;
 
 4144        $query.= substr($this->query, $last_position);
 
 4148        if ($this->is_manip) {
 
 4151            $result =& $this->db->query(
$query, $this->result_types, $result_class, $result_wrap_class);
 
 4168        if (is_null($this->positions)) {
 
 4169            return $this->db->raiseError(
MDB2_ERROR, 
null, 
null,
 
 4170                'Prepared statement has already been freed', __FUNCTION__);
 
 4173        $this->statement = 
null;
 
 4174        $this->positions = 
null;
 
 4175        $this->query = 
null;
 
 4176        $this->types = 
null;
 
 4177        $this->result_types = 
null;
 
 4178        $this->limit = 
null;
 
 4179        $this->is_manip = 
null;
 
 4180        $this->offset = 
null;
 
 4181        $this->values = 
null;
 
 4246        if (isset(
$GLOBALS[
'_MDB2_databases'][$this->db_index])) {
 
 4250                'could not find MDB2 instance');
 
 4271    reset(
$GLOBALS[
'_MDB2_databases']);
 
 4272    while (next(
$GLOBALS[
'_MDB2_databases'])) {
 
 4274        if (
$GLOBALS[
'_MDB2_databases'][
$key]->opened_persistent
 
 4303    $db->debug_output.= $scope.
'('.$db->db_index.
'): ';
 
 4304    $db->debug_output.= 
$message.$db->getOption(
'log_line_break');
 
sprintf('%.4f', $callTime)
MDB2_defaultDebugOutput(&$db, $scope, $message, $context=array())
default debug output handler
const MDB2_ERROR_ACCESS_VIOLATION
const MDB2_FETCHMODE_FLIPPED
For multi-dimensional results: normally the first level of arrays is the row number,...
const MDB2_ERROR_UNSUPPORTED
const MDB2_PORTABILITY_ALL
Portability: turn on all portability features.
const MDB2_ERROR_NODBSELECTED
const MDB2_PORTABILITY_RTRIM
Portability: right trim the data output by query*() and fetch*().
const MDB2_ERROR_DEADLOCK
const MDB2_ERROR_INVALID_DATE
const MDB2_FETCHMODE_DEFAULT
This is a special constant that tells MDB2 the user hasn't specified any particular get mode,...
const MDB2_ERROR_CANNOT_DELETE
const MDB2_ERROR_CONSTRAINT_NOT_NULL
const MDB2_PORTABILITY_FIX_CASE
Portability: convert names of tables and fields to case defined in the "field_case" option when using...
const MDB2_ERROR_MISMATCH
const MDB2_PORTABILITY_FIX_ASSOC_FIELD_NAMES
Portability: removes database/table qualifiers from associative indexes.
const MDB2_ERROR_NOT_LOCKED
const MDB2_ERROR_NOT_FOUND
const MDB2_ERROR_VALUE_COUNT_ON_ROW
const MDB2_ERROR_CANNOT_CREATE
const MDB2_ERROR_INVALID_NUMBER
const MDB2_ERROR_EXTENSION_NOT_FOUND
const MDB2_ERROR_LOADMODULE
const MDB2_ERROR_INVALID_DSN
$GLOBALS['_MDB2_databases']
These are global variables that are used to track the various class instances.
const MDB2_OK(!class_exists('PEAR'))
The method mapErrorCode in each MDB2_dbtype implementation maps native error codes to one of these.
const MDB2_PREPARE_MANIP
These are just helper constants to more verbosely express parameters to prepare()
const MDB2_ERROR_NOT_CAPABLE
const MDB2_ERROR_ALREADY_EXISTS
const MDB2_PORTABILITY_EMPTY_TO_NULL
Portability: convert empty values to null strings in data output by query*() and fetch*().
const MDB2_ERROR_CONSTRAINT
const MDB2_FETCHMODE_OBJECT
Column data as object properties.
const MDB2_FETCHMODE_ORDERED
Column data indexed by numbers, ordered from 0 and up.
const MDB2_ERROR_NOSUCHFIELD
const MDB2_ERROR_CANNOT_ALTER
const MDB2_ERROR_TRUNCATED
const MDB2_ERROR_NEED_MORE_DATA
const MDB2_ERROR_NOSUCHTABLE
const MDB2_ERROR_CONNECT_FAILED
const MDB2_ERROR_NOSUCHDB
const MDB2_ERROR_CANNOT_REPLACE
MDB2_closeOpenTransactions()
Close any open transactions form persistent connections.
const MDB2_FETCHMODE_ASSOC
Column data indexed by column names.
const MDB2_ERROR_CANNOT_DROP
const PEAR_ERROR_RETURN
#+ ERROR constants
while(false !==( $line=fgets( $in))) if(! $columns) $ignore
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
disconnect($force=true)
Log out and disconnect from the database.
setTransactionIsolation($isolation, $options=array())
Set the transacton isolation level.
__call($method, $params)
Calls a module method using the __call magic method.
inTransaction($ignore_nested=false)
If a transaction is currently open.
getConnection()
Returns a native connection.
& standaloneQuery($query, $types=null, $is_manip=false)
execute a query as database administrator
subSelect($query, $type=false)
simple subselect emulation: leaves the query untouched for all RDBMS that support subselects
getNestedTransactionError()
The first error that occured since the transaction start.
queryAll($query, $types=null, $fetchmode=MDB2_FETCHMODE_DEFAULT, $rekey=false, $force_array=false, $group=false)
Execute the specified query, fetch all the rows of the result set into a two dimensional array and th...
resetWarnings()
reset the warning array
debug($message, $scope='', $context=array())
set a debug message
queryOne($query, $type=null, $colnum=0)
Execute the specified query, fetch the value from the first column of the first row of the result set...
getDatabase()
Get the current database.
escape($text, $escape_wildcards=false)
Quotes a string so it can be safely used in a query.
compareDefinition($current, $previous)
Obtain an array of changes that may need to applied.
completeNestedTransaction($force_rollback=false)
Finish a nested transaction by rolling back if an error occured or committing otherwise.
getSequenceName($sqn)
adds sequence name formatting to a sequence name
& query($query, $types=null, $result_class=true, $result_wrap_class=false)
Send a query to the database and return any results.
lastInsertID($table=null, $field=null)
Returns the autoincrement ID if supported or $id or fetches the current ID in a sequence called: $tab...
_affectedRows($connection, $result=null)
Returns the number of rows affected.
& _wrapResult($result, $types=array(), $result_class=true, $result_wrap_class=false, $limit=null, $offset=null)
wrap a result set into the correct class
& _doQuery($query, $is_manip=false, $connection=null, $database_name=null)
Execute a query.
replace($table, $fields)
Execute a SQL REPLACE query.
errorInfo($error=null)
This method is used to collect information about an error.
rollback($savepoint=null)
Cancel any database changes done during a transaction or since a specific savepoint that is in progre...
$nested_transaction_counter
_modifyQuery($query, $is_manip, $limit, $offset)
Changes a query string for various DBMS specific reasons.
supports($feature)
Tell whether a DB implementation or its backend extension supports a given feature.
setCharset($charset, $connection=null)
Set the charset on the current connection.
currID($seq_name)
Returns the current id of a sequence.
__toString()
String conversation.
nextID($seq_name, $ondemand=true)
Returns the next free id of a sequence.
getDeclaration($type, $name, $field)
Obtain DBMS specific SQL code portion needed to declare of the given type.
beginNestedTransaction()
Start a nested transaction.
& loadModule($module, $property=null, $phptype_specific=null)
loads a module
getWarnings()
Get all warnings in reverse order.
setFetchMode($fetchmode, $object_class='stdClass')
Sets which fetch mode should be used by default on queries on this connection.
setOption($option, $value)
set the option for the db class
getServerVersion($native=false)
return version information about the server
queryRow($query, $types=null, $fetchmode=MDB2_FETCHMODE_DEFAULT)
Execute the specified query, fetch the values from the first row of the result set into an array and ...
setDatabase($name)
Select a different database.
setLimit($limit, $offset=null)
set the range of the next query
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is used to communicate an error and invoke error callbacks etc.
quoteIdentifier($str, $check_option=false)
Quote a string so it can be safely used as a table or column name.
queryCol($query, $type=null, $colnum=0)
Execute the specified query, fetch the value from the first column of each row of the result set into...
escapePattern($text)
Quotes pattern (% and _) characters in a string)
& exec($query)
Execute a manipulation query to the database and return the number of affected rows.
_skipDelimitedStrings($query, $position, $p_position)
Utility method, used by prepare() to avoid replacing placeholders within delimited strings.
quote($value, $type=null, $quote=true, $escape_wildcards=false)
Convert a text value into a DBMS specific format that is suitable to compose query statements.
commit($savepoint=null)
Commit the database changes done during a transaction that is in progress or release a savepoint.
MDB2_Driver_Common()
PHP 4 Constructor.
free()
Free the internal references so that the instance can be destroyed.
failNestedTransaction($error=null, $immediately=false)
Force setting nested transaction to failed.
getOption($option)
Returns the value of an option.
getDebugOutput()
output debug info
getIndexName($idx)
adds index name formatting to a index name
getAsKeyword()
Gets the string to alias column.
& prepare($query, $types=null, $result_types=null, $lobs=array())
Prepares a query for multiple execution with execute().
getDSN($type='string', $hidepw=false)
return the DSN as a string
__construct()
Constructor.
connect()
Connect to the database.
beginTransaction($savepoint=null)
Start a transaction or set a savepoint.
_fixResultArrayValues(&$row, $mode)
Do all necessary conversions on result arrays to fix DBMS quirks.
__construct($code=MDB2_ERROR, $mode=PEAR_ERROR_RETURN, $level=E_USER_NOTICE, $debuginfo=null)
MDB2_Error constructor.
& getDBInstance()
Get the instance of MDB2 associated with the module instance.
__construct($db_index)
Constructor.
MDB2_Module_Common($db_index)
PHP 4 Constructor.
& fetchRow($fetchmode=MDB2_FETCHMODE_DEFAULT, $rownum=null)
Fetch and return a row of data.
fetchOne($colnum=0, $rownum=null)
fetch single column from the next row from a result set
__construct($db, $result, $limit=0, $offset=0)
Constructor.
getResource()
return the resource associated with the result object
rowCount()
Returns the actual row number that was last fetched (count from 0)
MDB2_Result_Common($db, $result, $limit=0, $offset=0)
PHP 4 Constructor.
bindColumn($column, &$value, $type=null)
Set bind variable to a column.
getColumnNames($flip=false)
Retrieve the names of columns returned by the DBMS in a query result or from the cache.
numRows()
Returns the number of rows in a result object.
nextResult()
Move the internal result pointer to the next available result.
setResultTypes($types)
Define the list of types to be associated with the columns of a given result set.
fetch($fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
free()
Free the internal resources associated with result.
_assignBindColumns($row)
Bind a variable to a value in the result row.
_getColumnNames()
Retrieve the names of columns returned by the DBMS in a query result.
numCols()
Count the number of columns returned by the DBMS in a query result.
seek($rownum=0)
Seek to a specific row in a result set.
fetchAll($fetchmode=MDB2_FETCHMODE_DEFAULT, $rekey=false, $force_array=false, $group=false)
Fetch and return all rows from the current row pointer position.
fetchCol($colnum=0)
Fetch and return a column from the current row pointer position.
MDB2_Row(&$row)
PHP 4 Constructor.
__construct(&$row)
constructor
bindParamArray(&$values, $types=null)
Bind the variables of multiple a parameter of a prepared query in bulk.
bindValue($parameter, $value, $type=null)
Set the value of a parameter of a prepared query.
bindValueArray($values, $types=null)
Set the values of multiple a parameter of a prepared query in bulk.
& _execute($result_class=true, $result_wrap_class=false)
Execute a prepared query statement helper method.
& execute($values=null, $result_class=true, $result_wrap_class=false)
Execute a prepared query statement.
MDB2_Statement_Common(&$db, &$statement, $positions, $query, $types, $result_types, $is_manip=false, $limit=null, $offset=null)
PHP 4 Constructor.
bindParam($parameter, &$value, $type=null)
Bind a variable to a parameter of a prepared query.
__construct(&$db, &$statement, $positions, $query, $types, $result_types, $is_manip=false, $limit=null, $offset=null)
Constructor.
free()
Release resources allocated for the specified prepared query.
isStatement($value)
Tell whether a value is a MDB2 statement interface.
fileExists($file)
Checks if a file exists in the include path.
isError($data, $code=null)
Tell whether a value is a MDB2 error.
classExists($classname)
Checks if a class exists without triggering __autoload.
isResultCommon($value)
Tell whether a value is a MDB2 result implementing the common interface.
isResult($value)
Tell whether a value is a MDB2 result.
isConnection($value)
Tell whether a value is a MDB2 connection.
loadFile($file)
load a file (like 'Date')
errorMessage($value=null)
Return a textual error message for a MDB2 error code.
loadClass($class_name, $debug)
Loads a PEAR class.
apiVersion()
Return the MDB2 API version.
setOptions(&$db, $options)
set option array in an exiting database object
& raiseError($code=null, $mode=null, $options=null, $userinfo=null)
This method is used to communicate an error and invoke error callbacks etc.
& connect($dsn, $options=false)
Create a new MDB2 connection object and connect to the specified database.
& factory($dsn, $options=false)
Create a new MDB2 object for the specified database type.
& singleton($dsn=null, $options=false)
Returns a MDB2 connection with the requested DSN.
isError($data, $code=null)
Tell whether a value is a PEAR error.
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
Class ilDatabaseException.
catch(Exception $e) $message
if($modEnd===false) $module
The main 'MDB2' class is simply a container class with some static methods for creating DB objects as...
if(empty($password)) $table
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
foreach($_POST as $key=> $value) $res