66 static $warning_issued =
false;
67 if (!$warning_issued) {
68 $warning_issued =
true;
69 $stack = debug_backtrace();
72 'Legacy XoopsDB is deprecated since 2.6.0; all calls should be using Doctrine through $xoops->db(). '
73 .
'Called from ' . $frame[
'function'] .
'() in ' . $frame[
'file'] .
' line '. $frame[
'line']
89 $this->
connect = (is_object($this->conn));
91 $this->allowWebChanges = (
$_SERVER[
'REQUEST_METHOD'] !=
'GET');
127 return $result->fetch(\PDO::FETCH_NUM);
145 return $result->fetch(\PDO::FETCH_ASSOC);
163 return $result->fetch(\PDO::FETCH_BOTH);
181 return $result->fetch(\PDO::FETCH_OBJ);
193 return $this->conn->lastInsertId();
220 return $this->lastResult->rowCount();
232 return $this->conn->close();
261 return $this->conn->errorInfo();
276 return $this->conn->errorCode();
292 return $this->
quote($str);
307 return $this->conn->quote($string);
322 $string = $this->
quote($input);
323 return substr($string, 1, -1);
348 $xoopsPreload->triggerEvent(
'core.database.query.start');
351 }
catch (Exception $e) {
355 $xoopsPreload->triggerEvent(
'core.database.query.end');
358 $xoopsPreload->triggerEvent(
'core.database.query.success', (array(
$sql)));
361 $xoopsPreload->triggerEvent(
'core.database.query.failure', (array(
$sql, $this)));
398 if (
false !== ($fp = fopen(
$file,
'r'))) {
399 $sql_queries = trim(fread($fp, filesize(
$file)));
401 foreach ($pieces as
$query) {
406 if ($prefixed_query !=
false) {
407 $this->
query($prefixed_query[0]);
430 return $temp[
'name'];
431 }
catch (PDOException $e) {
452 $t =
$temp[
'native_type'];
455 ((($t ==
'STRING') || ($t ==
'VAR_STRING') ) ?
'string' :
'' ) .
456 ( (in_array($t, array(
'TINY',
'SHORT',
'LONG',
'LONGLONG',
'INT24'))) ?
'int' :
'' ) .
457 ( (in_array($t, array(
'FLOAT',
'DOUBLE',
'DECIMAL',
'NEWDECIMAL'))) ?
'real' :
'' ) .
458 ( ($t ==
'TIMESTAMP') ?
'timestamp' :
'' ) .
459 ( ($t ==
'YEAR') ?
'year' :
'') .
460 ( (($t ==
'DATE') || ($t ==
'NEWDATE') ) ?
'date' :
'' ) .
461 ( ($t ==
'TIME') ?
'time' :
'' ) .
462 ( ($t ==
'SET') ?
'set' :
'' ) .
463 ( ($t ==
'ENUM') ?
'enum' :
'' ) .
464 ( ($t ==
'GEOMETRY') ?
'geometry' :
'' ) .
465 ( ($t ==
'DATETIME') ?
'datetime' :
'' ) .
466 ( (in_array($t, array(
'TINY_BLOB',
'BLOB',
'MEDIUM_BLOB',
'LONG_BLOB' ))) ?
'blob' :
'' ) .
467 ( ($t ==
'NULL') ?
'null' :
'' )
470 }
catch (PDOException $e) {
static prefixQuery($query, $prefix)
if(!isset($xoops->paths[$path_type])) if($path_type== 'var') $file
static splitMySqlFile(&$ret, $sql)
getFieldType($result, $offset)
query($sql, $limit=0, $start=0)
queryF($sql, $limit=0, $start=0)
getFieldName($result, $offset)