PHP Class Habari\SQLiteConnection

Inheritance: extends DatabaseConnection
Afficher le fichier Open project: habari/system

Méthodes publiques

Méthode Description
connect ( $connect_string, $db_user, $db_pass ) : boolean Connect to SQLite Overrides the DatabaseConnection to return false if the SQLite file doesn't exist.
dbdelta ( $queries, $execute = true, $silent = true, $doinserts = false ) : string automatic diffing function - used for determining required database upgrades based on Owen Winkler's microwiki upgrade function
execute_procedure ( $procedure, $args = [] ) : mixed Execute a stored procedure
replace_concat ( array $matches ) : string Replaces the MySQL CONCAT function with SQLite-compatible statements
sql_t ( string $sql, array &$args ) : string database specific SQL translation function, loosely modelled on the internationalization _t() function Call with a database independent SQL string and it will be translated to a SQLite specific SQL string
upgrade_post ( integer $old_version, $upgrade_path = '' ) : boolean Run all of the upgrades slated for post-dbdelta since the last database revision.
upgrade_pre ( integer $old_version, $upgrade_path = '' ) : boolean Run all of the upgrades slated for pre-dbdelta since the last database revision.

Méthodes protégées

Méthode Description
filter_fieldnames ( StdClass $row ) : string Filter out the fieldnames from whole pragma rows

Method Details

connect() public méthode

Connect to SQLite Overrides the DatabaseConnection to return false if the SQLite file doesn't exist.
public connect ( $connect_string, $db_user, $db_pass ) : boolean
Résultat boolean True if connection succeeded, false if not.

dbdelta() public méthode

automatic diffing function - used for determining required database upgrades based on Owen Winkler's microwiki upgrade function
public dbdelta ( $queries, $execute = true, $silent = true, $doinserts = false ) : string
Résultat string translated SQL string

execute_procedure() public méthode

Execute a stored procedure
public execute_procedure ( $procedure, $args = [] ) : mixed
Résultat mixed whatever the procedure returns... Not supported with SQLite

filter_fieldnames() protected méthode

Filter out the fieldnames from whole pragma rows
protected filter_fieldnames ( StdClass $row ) : string
$row StdClass A row result from a SQLite PRAGMA table_info query
Résultat string The name of the associated field

replace_concat() public méthode

Replaces the MySQL CONCAT function with SQLite-compatible statements
See also: SQLiteConnection::sql_t()
public replace_concat ( array $matches ) : string
$matches array Matches from the regex in sql_t()
Résultat string The replacement for the MySQL SQL

sql_t() public méthode

database specific SQL translation function, loosely modelled on the internationalization _t() function Call with a database independent SQL string and it will be translated to a SQLite specific SQL string
public sql_t ( string $sql, array &$args ) : string
$sql string database independent SQL
$args array An array of SQL arguments
Résultat string translated SQL string

upgrade_post() public méthode

Run all of the upgrades slated for post-dbdelta since the last database revision.
public upgrade_post ( integer $old_version, $upgrade_path = '' ) : boolean
$old_version integer The current version of the database that is being upgraded
Résultat boolean True on success

upgrade_pre() public méthode

Run all of the upgrades slated for pre-dbdelta since the last database revision.
public upgrade_pre ( integer $old_version, $upgrade_path = '' ) : boolean
$old_version integer The current version of the database that is being upgraded
Résultat boolean True on success