Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
eZSQLite3DB Class Reference

## Public Member Functions
| __construct ( $databaseFileName)
| isA ()
| error ()
& | query ( $sql, $print=false, $debug=false)
| array_query (&$array, $sql, $min=0, $max=-1, $column=false)
| query_single (&$row, $sql, $column=false)
| array_query_append (&$array, $sql, $min=0, $max=-1, $column=false)
| dateToNative (&$date)
| lock ( $table)
| unlock ()
| begin ()
| commit ()
| rollback ()
| nextID ( $table, $field="ID")
| escapeString ( $str)
| close ()
| printConnection ()
| counter ()
| md5 ( $str)
| md5UDF ( $str)
| connectRetryCount ()
| connectRetryWaitTime ()

## Static Public Member Functions
| fieldName ( $str)

## Public Attributes
| $Server
| $DB
| $User
| $Password
| $Database
| $Error
| $Counter
| $DatabaseFileName
| $DatabaseSQLitePath
| $IsConnected
| $ConnectRetries

## Private Member Functions
| connect ( $fileName)

## Detailed Description

! eZCommon The eZSQLite3DB class provides database functions.

eZSQLite3DB implementes SQLite specific database code.

Definition at line 36 of file ezsqlite3db.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZSQLite3DB::__construct | ( |  | $databaseFileName | ) |

Definition at line 38 of file ezsqlite3db.php.

References $db, $ini, $ret, connect(), error(), exit, and query().

## Member Function Documentation

## ◆ array_query()

eZSQLite3DB::array_query | ( | & | $array,
|  |  | $sql,
|  |  | $min = `0`,
|  |  | $max = `-1`,
|  |  | $column = `false`
| ) |  |

Executes a SELECT query that returns multiple rows and puts the results into the passed array as an indexed associative array. The array is cleared first. The results start with the array start at 0, and the number of results can be found with the count() function. The minimum and maximum expected rows can be set by supplying $min and $max, default is to allow zero or more rows. If a string is supplied to $column it is used for extracting a specific column from the query into the resulting array, this is useful when you just want one column from the query and don't want to iterate over it afterwards to extract the column.

Definition at line 268 of file ezsqlite3db.php.

References $results, and array_query_append().

Referenced by nextID().

## ◆ array_query_append()

eZSQLite3DB::array_query_append | ( | & | $array,
|  |  | $sql,
|  |  | $min = `0`,
|  |  | $max = `-1`,
|  |  | $column = `false`
| ) |  |

Differs from the above function only by not creating av empty array, but simply appends to the array passed as an argument.

Definition at line 294 of file ezsqlite3db.php.

References $i, $limit, $offset, $results, and $row.

Referenced by array_query(), and query_single().

## ◆ begin()

eZSQLite3DB::begin | ( |  | ) |

Starts a new transaction.

Definition at line 415 of file ezsqlite3db.php.

References query().

## ◆ close()

eZSQLite3DB::close | ( |  | ) |

Will close the database connection.

Definition at line 490 of file ezsqlite3db.php.

## ◆ commit()

eZSQLite3DB::commit | ( |  | ) |

Commits the transaction.

Definition at line 423 of file ezsqlite3db.php.

References query().

## ◆ connect()

eZSQLite3DB::connect | ( |  | $fileName | ) |
| private

Opens a new connection to a SQLite database and returns the connection

Definition at line 80 of file ezsqlite3db.php.

References $error, $fh, $fileName, $ini, connectRetryCount(), connectRetryWaitTime(), file_exists(), eZDebug\writeDebug(), and eZDebug\writeError().

Referenced by __construct().

## ◆ connectRetryCount()

eZSQLite3DB::connectRetryCount | ( |  | ) |

Returns the number of times the db handler should try to reconnect if it fails.

Returns
  int

Definition at line 523 of file ezsqlite3db.php.

References $ConnectRetries.

Referenced by connect().

## ◆ connectRetryWaitTime()

eZSQLite3DB::connectRetryWaitTime | ( |  | ) |

Returns the number of seconds the db handler should wait before rereconnecting.

Returns
  int

Definition at line 533 of file ezsqlite3db.php.

Referenced by connect().

## ◆ counter()

eZSQLite3DB::counter | ( |  | ) |

Definition at line 503 of file ezsqlite3db.php.

References $Counter.

## ◆ dateToNative()

eZSQLite3DB::dateToNative | ( | & | $date | ) |

Definition at line 383 of file ezsqlite3db.php.

References $date, $ret, and eZDate\addZero().

## ◆ error()

eZSQLite3DB::error | ( |  | ) |

Definition at line 169 of file ezsqlite3db.php.

Referenced by __construct(), and query().

## ◆ escapeString()

eZSQLite3DB::escapeString | ( |  | $str | ) |

Will escape a string so it's ready to be inserted in the database.

Definition at line 471 of file ezsqlite3db.php.

References $str.

## ◆ fieldName()

eZSQLite3DB::fieldName | ( |  | $str | ) |
| static

Will just return the field name.

Definition at line 482 of file ezsqlite3db.php.

References $str.

## ◆ isA()

eZSQLite3DB::isA | ( |  | ) |

Returns the driver type.

Definition at line 164 of file ezsqlite3db.php.

## ◆ lock()

eZSQLite3DB::lock | ( |  | $table | ) |

Locks a table

Definition at line 399 of file ezsqlite3db.php.

## ◆ md5()

eZSQLite3DB::md5 | ( |  | $str | ) |

Definition at line 508 of file ezsqlite3db.php.

Referenced by md5UDF().

## ◆ md5UDF()

eZSQLite3DB::md5UDF | ( |  | $str | ) |

Definition at line 513 of file ezsqlite3db.php.

References $str, and md5().

## ◆ nextID()

eZSQLite3DB::nextID | ( |  | $table,
|  |  | $field = `"ID"`
| ) |  |

Returns the next value which can be used as a unique index value.

Remeber to lock the table before using this function and inserting the value.

Definition at line 441 of file ezsqlite3db.php.

References $id, $query, $result, $results, and array_query().

## ◆ printConnection()

eZSQLite3DB::printConnection | ( |  | ) |

Definition at line 495 of file ezsqlite3db.php.

References Password.

## ◆ query()

& eZSQLite3DB::query | ( |  | $sql,
|  |  | $print = `false`,
|  |  | $debug = `false`
| ) |  |

Execute a query on the global MySQL database link. If it returns an error, the script is halted and the attempted SQL query and MySQL error message are printed.

Definition at line 178 of file ezsqlite3db.php.

References $debug, $ini, $result, error(), and unlock().

Referenced by __construct(), begin(), commit(), and rollback().

## ◆ query_single()

eZSQLite3DB::query_single | ( | & | $row,
|  |  | $sql,
|  |  | $column = `false`
| ) |  |

Same as array_query() but expects to recieve 1 row only (no array), no more no less. $column is the same as in array_query().

Definition at line 279 of file ezsqlite3db.php.

References $ret, $row, and array_query_append().

## ◆ rollback()

eZSQLite3DB::rollback | ( |  | ) |

Cancels the transaction.

Definition at line 431 of file ezsqlite3db.php.

References query().

## ◆ unlock()

eZSQLite3DB::unlock | ( |  | ) |

Releases table locks.

Definition at line 407 of file ezsqlite3db.php.

Referenced by query().

## Member Data Documentation

## ◆ $ConnectRetries

eZSQLite3DB::$ConnectRetries

Definition at line 548 of file ezsqlite3db.php.

Referenced by connectRetryCount().

## ◆ $Counter

eZSQLite3DB::$Counter

Definition at line 544 of file ezsqlite3db.php.

Referenced by counter().

## ◆ $Database

eZSQLite3DB::$Database

Definition at line 542 of file ezsqlite3db.php.

## ◆ $DatabaseFileName

eZSQLite3DB::$DatabaseFileName

Definition at line 545 of file ezsqlite3db.php.

## ◆ $DatabaseSQLitePath

eZSQLite3DB::$DatabaseSQLitePath

Definition at line 546 of file ezsqlite3db.php.

## ◆ $DB

eZSQLite3DB::$DB

Definition at line 539 of file ezsqlite3db.php.

## ◆ $Error

eZSQLite3DB::$Error

Definition at line 543 of file ezsqlite3db.php.

## ◆ $IsConnected

eZSQLite3DB::$IsConnected

Definition at line 547 of file ezsqlite3db.php.

## ◆ $Password

eZSQLite3DB::$Password

Definition at line 541 of file ezsqlite3db.php.

## ◆ $Server

eZSQLite3DB::$Server

Definition at line 538 of file ezsqlite3db.php.

## ◆ $User

eZSQLite3DB::$User

Definition at line 540 of file ezsqlite3db.php.

The documentation for this class was generated from the following file:

- ezsqlite3db.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.