xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • mysql
  • mysql_Result
  • mysql_Result_Statement
  • mysql_Statement
  • odbc
  • odbc_Result
  • odbc_Statement
  • sqlite2
  • sqlite2_Result
  • sqlite2_Statement
  • sqlite3
  • sqlite3_Result
  • sqlite3_Statement

Class sqlite2

SQLite 2 storage driver.

The database file is always opened in read/write privileges mode and automatically created, if it does not yet exist. This is the default behaviour of the PHP SQLite extension.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\Storage
Extended by Core\Storage\Driver\sqlite2
Namespace: Core\Storage\Driver
Package: Core\Storage
Since: 3.0
Requires: PHP 5.3, SQLite
Version: 1.0
Located at Storage/Driver/sqlite2.inc.php

Methods summary

public
# __construct( Core\URI $uri )

Parses connection parameters. The database file is opened on first use (lazy initialisation).

Parses connection parameters. The database file is opened on first use (lazy initialisation).

Parameters

$uri
URI instance with SQLite 2 connection parameters.

Throws

Core\Exception\Parameter
The URI contains an invalid configuration parameter.

Since

3.0
public
# __destruct( )

Closes an open database file.

Closes an open database file.

Since

3.0
public
# __wakeUp( )

Resets internal database connection to support de-serialisation.

Resets internal database connection to support de-serialisation.

Since

3.0
public string
# backendVersion( )

Returns the back-end version string. Some drivers use different layers for their backend storage (e.g. an interface library and a server) with different versions for each layer. The most basic layer, available and significant version is returned (e.g. the database server version). SQLite does not connect to a remote server, hence client and server version are the same.

Returns the back-end version string. Some drivers use different layers for their backend storage (e.g. an interface library and a server) with different versions for each layer. The most basic layer, available and significant version is returned (e.g. the database server version). SQLite does not connect to a remote server, hence client and server version are the same.

Returns

string
Back-end system version string.

Since

3.0
public string|false
# begin( )

Begins a new (nested) transaction.

Begins a new (nested) transaction.

Returns

string|false

A transaction ID on success or false, if the transaction could not be started due to a non-fatal error (e.g. the storage engine does not support transactions). Otherwise an exception is thrown.

A non-zero return value does not guarantee that the storage system actually fully supports transaction but merely understands the syntax.

Remark

SQLite 2 does not support nested transactions (save points). An attempt to create a nested transaction will raise an exception.

If a transaction is started, SQLite 2 creates a temporary journal file in the directory of the database file. This can lead to an error stating that the database file cannot be opened when a transaction is started; ensure that the script has write permissions for the database directory.


Since

3.0
public string
# clientVersion( )

Returns the client version string. Some drivers use different layers for their back-end storage (e.g. an interface library and a server) with different versions for each layer. The highest layer, available and significant version is returned (e.g. the database client version). SQLite 2 does not connect to a remote server, hence client and server version are the same.

Returns the client version string. Some drivers use different layers for their back-end storage (e.g. an interface library and a server) with different versions for each layer. The highest layer, available and significant version is returned (e.g. the database client version). SQLite 2 does not connect to a remote server, hence client and server version are the same.

Returns

string
Client system version string.

Since

3.0
public
# commit( $transactionID = null )

Commits the currently active transaction.

Commits the currently active transaction.

Since

3.0
public string
# escape( string $value, boolean $addDelimiters = false )

Escapes a binary string specific to the storage back-end for direct usage. When performing direct commands on the back-end engine, most storage systems require the user to escaped data sequences (e.g. SQL). Each data sequence used for direct commands should therefore be preprocessed by this method prior to sending the command.

Escapes a binary string specific to the storage back-end for direct usage. When performing direct commands on the back-end engine, most storage systems require the user to escaped data sequences (e.g. SQL). Each data sequence used for direct commands should therefore be preprocessed by this method prior to sending the command.

Parameters

$value
Binary string to escape.
$addDelimiters

Optional. Controls whether the escaped data sequence should be packed into data sequence delimiters (e.g. string markers).

Returns

string
Escaped input string.

Since

3.0
public Storage_Result
# execute( mixed $statement, array $parameters = null )

Executes an accessor node, prepared storage statement or direct back-end query.

Executes an accessor node, prepared storage statement or direct back-end query.

Parameters

$statement

Prepared storage statement, raw storage accessor node or binary back-end specific query string for execution.

$parameters
Associative array of parameter values (including bindings).

Returns

Storage_Result
Driver-specific result object on success, otherwise an exception is thrown.

Since

3.0
public Core\Storage_Statement
# prepare( Core\Storage\Accessor_Node $query )

Prepares a query for optimised repeated execution.

Prepares a query for optimised repeated execution.

Parameters

$query
Storage accessor node to prepare for execution.

Returns

Core\Storage_Statement

Prepared driver-specific storage statement on success, otherwise an exception is thrown.

Since

3.0
public
# reset( )

Closes and re-opens the SQLite database file.

Closes and re-opens the SQLite database file.

Since

3.0
public
# rollback( $transactionID = null )

Cancels the currently active transaction.

Cancels the currently active transaction.

Since

3.0

Methods inherited from Core\Storage

autocreate()

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), __toString(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), hash(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

string StorageModeParameter

Storage mode parameter name.

Storage mode parameter name.

Since

3.0
# 'mode'
string FetchStorageMode

Fetching storage mode. Instructs SQLite not to cache query results but fetch a row on demand. This setting is useful to reduce the memory required to handle a result data set, but disables features such as the number of rows in unknown before completing the iteration on all rows.

Fetching storage mode. Instructs SQLite not to cache query results but fetch a row on demand. This setting is useful to reduce the memory required to handle a result data set, but disables features such as the number of rows in unknown before completing the iteration on all rows.

Since

3.0
# 'fetch'
string StoreStorageMode

Cached storage mode. Instructs SQLite to cache the complete query result set. This is the default.

Cached storage mode. Instructs SQLite to cache the complete query result set. This is the default.

Since

3.0
# 'store'
string IndexModeParameter

Index mode parameter name.

Index mode parameter name.

Since

3.0
# 'index'
string NumericIndexMode

Index modes that uses numeric indices for result columns. Column names are ignored. Slightly reduces memory overhead.

Index modes that uses numeric indices for result columns. Column names are ignored. Slightly reduces memory overhead.

Since

3.0
# 'numeric'
string AssociativeIndexMode

Index mode that uses associative indices for result columns. Indices are based on the table column name or selection expression. This is the default.

Index mode that uses associative indices for result columns. Indices are based on the table column name or selection expression. This is the default.

SQLite supports fully qualified and short column names. This driver always uses the short column names for compatibility with other database engines (i.e. only the exact name of the column is used). To ensure that an expression in a selection can be properly identified, always assign an alias to an expression.

Since

3.0
# 'assoc'

Constants inherited from Core\Storage

ContextArgument, DuplicateKeyError, Parameters, RowClass

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected array $_v_parameters

Cached driver configuration array.

Cached driver configuration array.

Since

3.0
#
protected Core\URI $_v_uri

Driver configuration URI. Required for re-connecting to the database.

Driver configuration URI. Required for re-connecting to the database.

Since

3.0
#
protected resource $_handle

Database file handle.

Database file handle.

Since

3.0
#

Properties inherited from Core\Storage

$_v_affectedRows, $_v_insertID

Magic properties

public read-only array $parameters

Cached driver configuration array.

public read-only Core\URI $uri

Driver configuration URI.

Magic properties inherited from Core\Storage

$affectedRows, $insertID

Magic properties inherited from Core\Object

$hash, $uuid

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen