Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

Firebird driver.

Copyright: 2000-2013 John Lim
Copyright: 2014 Damien Regad, Mark Newnham and the ADOdb community
License: BSD-3-Clause
License: LGPL-2.1-or-later
File Size: 1316 lines (34 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

ADODB_firebird:: (32 methods):
  __construct()
  setTransactionMode()
  _connect()
  _pconnect()
  metaPrimaryKeys()
  serverInfo()
  beginTrans()
  commitTrans()
  _affectedrows()
  rollbackTrans()
  metaIndexes()
  rowLock()
  createSequence()
  genID()
  selectDB()
  _handleError()
  errorNo()
  errorMsg()
  prepare()
  _query()
  _close()
  _ConvertFieldType()
  metaColumns()
  metaTables()
  blobEncode()
  blobDecode()
  _blobDecode()
  updateBlobFile()
  updateBlob()
  sqlDate()
  offsetDate()
  selectLimit()

ADORecordset_firebird:: (9 methods):
  __construct()
  _fetchField()
  fetchField()
  _initrs()
  _seek()
  _fetch()
  fields()
  _close()
  metaType()


Class: ADODB_firebird  - X-Ref

__construct()   X-Ref
No description

setTransactionMode($transaction_mode)   X-Ref
Sets the isolation level of a transaction.

The default behavior is a more practical IBASE_WAIT | IBASE_REC_VERSION | IBASE_COMMITTED
instead of IBASE_DEFAULT

param: string $transaction_mode The transaction mode to set.
return: void

_connect($argHostname, $argUsername, $argPassword, $argDatabasename,$persist=false)   X-Ref
Connect to a database.

param: string|null $argHostname (Optional) The host to connect to.
param: string|null $argUsername (Optional) The username to connect as.
param: string|null $argPassword (Optional) The password to connect with.
param: string|null $argDatabasename (Optional) The name of the database to start in when connected.
param: bool $persist (Optional) Whether or not to use a persistent connection.
return: bool|null True if connected successfully, false if connection failed, or null if the mysqli extension

_pconnect($argHostname, $argUsername, $argPassword, $argDatabasename)   X-Ref
Connect to a database with a persistent connection.

param: string|null $argHostname The host to connect to.
param: string|null $argUsername The username to connect as.
param: string|null $argPassword The password to connect with.
param: string|null $argDatabasename The name of the database to start in when connected.
return: bool|null True if connected successfully, false if connection failed, or null if the mysqli extension

metaPrimaryKeys($table,$owner_notused=false,$internalKey=false)   X-Ref
No description

serverInfo()   X-Ref
Get information about the current Firebird server.

return: array

beginTrans()   X-Ref
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().

return: bool true if succeeded or false if database does not support transactions

commitTrans($ok=true)   X-Ref
Commits a transaction.

param: bool $ok  false to rollback transaction, true to commit
return: bool

_affectedrows()   X-Ref
No description

rollbackTrans()   X-Ref
Rollback a smart transaction.

return: bool

metaIndexes($table, $primary = false, $owner = false)   X-Ref
Get a list of indexes on the specified table.

param: string $table The name of the table to get indexes for.
param: bool $primary (Optional) Whether or not to include the primary key.
param: bool $owner (Optional) Unused.
return: array|bool An array of the indexes, or false if the query to get the indexes failed.

rowLock($table,$where,$col=false)   X-Ref
Lock a table row for a duration of a transaction.

param: string $table The table(s) to lock rows for.
param: string $where (Optional) The WHERE clause to use to determine which rows to lock.
param: string $col (Optional) The columns to select.
return: bool True if the locking SQL statement executed successfully, otherwise false.

createSequence($seqname='adodbseq', $startID = 1)   X-Ref
Creates a sequence in the database.

param: string $seqname The sequence name.
param: int $startID The start id.
return: ADORecordSet|bool A record set if executed successfully, otherwise false.

genID($seqname='adodbseq',$startID=1)   X-Ref
A portable method of creating sequence numbers.

param: string $seqname (Optional) The name of the sequence to use.
param: int $startID (Optional) The point to start at in the sequence.
return: int

selectDB($dbName)   X-Ref
No description

_handleError()   X-Ref
No description

errorNo()   X-Ref
No description

errorMsg()   X-Ref
No description

prepare($sql)   X-Ref
Prepares an SQL statement and returns a handle to use.
This is not used by bound parameters anymore

param: string $sql The SQL to prepare.
return: bool|array The SQL that was provided and the prepared parameters,

_query($sql, $iarr = false)   X-Ref
Return the query id.

param: string|array $sql
param: array $iarr
return: bool|object

_close()   X-Ref
No description

_ConvertFieldType(&$fld, $ftype, $flen, $fscale, $fsubtype, $fprecision, $dialect3)   X-Ref
No description

metaColumns($table, $normalize = true)   X-Ref
Return an array of information about a table's columns.

param: string $table The name of the table to get the column info for.
param: bool $normalize (Optional) Unused.
return: ADOFieldObject[]|bool An array of info for each column,

metaTables($ttype = false, $showSchema = false, $mask = false)   X-Ref
Retrieves a list of tables based on given criteria

param: string|bool $ttype (Optional) Table type = 'TABLE', 'VIEW' or false=both (default)
param: string|bool $showSchema (Optional) schema name, false = current schema (default)
param: string|bool $mask (Optional) filters the table by name
return: array list of tables

blobEncode( $blob )   X-Ref
Encodes a blob, then assigns an id ready to be used

param: string $blob The blob to be encoded
return: bool success

blobDecode($blob)   X-Ref
Manually decode a blob

since we auto-decode all blob's since 2.42,
BlobDecode should not do any transforms

param: string $blob
return: string the same blob

_blobDecode($blob)   X-Ref
Auto function called on read of blob to decode

param: string $blob Value to decode
return: string Decoded blob

updateBlobFile($table,$column,$path,$where,$blobtype='BLOB')   X-Ref
Insert blob data into a database column directly
from file

param: string $table table to insert
param: string $column column to insert
param: string $path  physical file name
param: string $where string to find unique record
param: string $blobtype BLOB or CLOB
return: bool success

updateBlob($table,$column,$val,$where,$blobtype='BLOB')   X-Ref
Insert blob data into a database column

param: string $table table to insert
param: string $column column to insert
param: string $val    value to insert
param: string $where string to find unique record
param: string $blobtype BLOB or CLOB
return: bool success

sqlDate($fmt, $col=false)   X-Ref
Returns a portably-formatted date string from a timestamp database column.

param: string $fmt The date format to use.
param: string|bool $col (Optional) The table column to date format, or if false, use NOW().
return: string The SQL DATE_FORMAT() string, or empty if the provided date format was empty.

offsetDate($dayFraction, $date=false)   X-Ref
Creates a portable date offset field, for use in SQL statements.

param: float $dayFraction A day in floating point
param: string|bool $date (Optional) The date to offset. If false, uses CURDATE()
return: string

selectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $secs2cache=0)   X-Ref
Executes a provided SQL statement and returns a handle to the result, with the ability to supply a starting
offset and record count.

param: string $sql The SQL to execute.
param: int $nrows (Optional) The limit for the number of records you want returned. By default, all results.
param: int $offset (Optional) The offset to use when selecting the results. By default, no offset.
param: array|bool $inputarr (Optional) Any parameter values required by the SQL statement, or false if none.
param: int $secs2cache (Optional) If greater than 0, perform a cached execute. By default, normal execution.
return: ADORecordSet|false The query results, or false if the query failed to execute.

Class: ADORecordset_firebird  - X-Ref

Class ADORecordset_firebird

__construct($id, $mode = false)   X-Ref


_fetchField($fieldOffset = -1)   X-Ref
Returns: an object containing field information.

Get column information in the Recordset object. fetchField()
can be used in order to obtain information about fields in a
certain query result. If the field offset isn't specified,
the next field that wasn't yet retrieved by fetchField()
is retrieved.

$param int $fieldOffset (optional default=-1 for all
return: mixed an ADOFieldObject, or array of objects

fetchField($fieldOffset = -1)   X-Ref
Fetchfield copies the oracle method, it loads the field information
into the _fieldobjs array once, to save multiple calls to the
fbird_ function

param: int $fieldOffset (optional)
return: adoFieldObject|false

_initrs()   X-Ref
No description

_seek($row)   X-Ref
No description

_fetch()   X-Ref
No description

fields($colname)   X-Ref
Get the value of a field in the current row by column name.
Will not work if ADODB_FETCH_MODE is set to ADODB_FETCH_NUM.

param: string $colname is the field to access
return: mixed the value of $colname column

_close()   X-Ref
No description

metaType($t, $len = -1, $fieldObj = false)   X-Ref
No description