PHP Класс Habari\SQLiteConnection

Наследование: extends DatabaseConnection
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
filter_fieldnames ( StdClass $row ) : string Filter out the fieldnames from whole pragma rows

Описание методов

connect() публичный Метод

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
Результат boolean True if connection succeeded, false if not.

dbdelta() публичный Метод

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
Результат string translated SQL string

execute_procedure() публичный Метод

Execute a stored procedure
public execute_procedure ( $procedure, $args = [] ) : mixed
Результат mixed whatever the procedure returns... Not supported with SQLite

filter_fieldnames() защищенный Метод

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
Результат string The name of the associated field

replace_concat() публичный Метод

Replaces the MySQL CONCAT function with SQLite-compatible statements
См. также: SQLiteConnection::sql_t()
public replace_concat ( array $matches ) : string
$matches array Matches from the regex in sql_t()
Результат string The replacement for the MySQL SQL

sql_t() публичный Метод

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
Результат string translated SQL string

upgrade_post() публичный Метод

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
Результат boolean True on success

upgrade_pre() публичный Метод

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
Результат boolean True on success