Database
in package
Table of Contents
Properties
- $connection : object
- $dbna : string
- $host : string
- $pass : string
- $user : string
- $autoRedirect : bool
- $errorPage : string
- $logFile : string
- $logFilePath : string
Methods
- __construct() : mixed
- aff_rows() : mixed
- beginTransaction() : void
- Start a transaction.
- close() : mixed
- commit() : void
- Commit the current transaction.
- error_report() : mixed
- escape_string() : mixed
- execute() : mixed
- fetch() : mixed
- getDbna() : string
- getErrorPage() : string
- getHost() : string
- getLogfilePath() : string
- getUser() : string
- memory_free() : mixed
- num_rows() : mixed
- open() : mixed
- prepare() : mixed
- query() : mixed
- rollback() : void
- Roll back the current transaction.
- runQuery() : array<string|int, mixed>|int
- setAutoRedirect() : void
- setDbna() : void
- setErrorPage() : void
- setHost() : void
- setLogFilePath() : void
- setPass() : void
- setUser() : void
- handleError() : mixed
- logError() : mixed
- redirectToErrorPage() : mixed
- supportsTransactions() : bool
- Check if transactions are supported by the database.
Properties
$connection
public
object
$connection
$dbna
public
string
$dbna
= ''
$host
public
string
$host
= ''
$pass
public
string
$pass
= ''
$user
public
string
$user
= ''
$autoRedirect
private
bool
$autoRedirect
= false
$errorPage
private
string
$errorPage
$logFile
private
string
$logFile
= 'sqlerror.log'
$logFilePath
private
string
$logFilePath
Methods
__construct()
public
__construct([string|null $logFilePath = null ][, string|null $errorPagePath = null ]) : mixed
Parameters
- $logFilePath : string|null = null
- $errorPagePath : string|null = null
aff_rows()
public
aff_rows() : mixed
beginTransaction()
Start a transaction.
public
beginTransaction() : void
close()
public
close() : mixed
commit()
Commit the current transaction.
public
commit() : void
error_report()
public
error_report(mixed $script, mixed $line[, mixed $sql = "" ]) : mixed
Parameters
- $script : mixed
- $line : mixed
- $sql : mixed = ""
escape_string()
public
escape_string(mixed $string) : mixed
Parameters
- $string : mixed
execute()
public
execute(mixed $stmt[, mixed $params = [] ]) : mixed
Parameters
- $stmt : mixed
- $params : mixed = []
fetch()
public
fetch(mixed $result) : mixed
Parameters
- $result : mixed
getDbna()
public
getDbna() : string
Return values
stringgetErrorPage()
public
getErrorPage() : string
Return values
stringgetHost()
public
getHost() : string
Return values
stringgetLogfilePath()
public
getLogfilePath() : string
Return values
stringgetUser()
public
getUser() : string
Return values
stringmemory_free()
public
memory_free(mixed $result) : mixed
Parameters
- $result : mixed
num_rows()
public
num_rows(mixed $result) : mixed
Parameters
- $result : mixed
open()
public
open() : mixed
prepare()
public
prepare(mixed $query) : mixed
Parameters
- $query : mixed
query()
public
query(mixed $result) : mixed
Parameters
- $result : mixed
rollback()
Roll back the current transaction.
public
rollback() : void
runQuery()
public
runQuery(string $sql[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>|int
Parameters
- $sql : string
- $params : array<string|int, mixed> = []
Return values
array<string|int, mixed>|intsetAutoRedirect()
public
setAutoRedirect(bool $flag) : void
Parameters
- $flag : bool
setDbna()
public
setDbna(string $dbna) : void
Parameters
- $dbna : string
setErrorPage()
public
setErrorPage(string $errorPage) : void
Parameters
- $errorPage : string
setHost()
public
setHost(string $host) : void
Parameters
- $host : string
setLogFilePath()
public
setLogFilePath(string $logFilePath) : void
Parameters
- $logFilePath : string
setPass()
public
setPass(string $pass) : void
Parameters
- $pass : string
setUser()
public
setUser(string $user) : void
Parameters
- $user : string
handleError()
private
handleError(mixed $e[, mixed $query = '' ][, mixed $script = '' ][, mixed $line = 0 ]) : mixed
Parameters
- $e : mixed
- $query : mixed = ''
- $script : mixed = ''
- $line : mixed = 0
logError()
private
logError(mixed $e[, mixed $query = '' ][, mixed $line = 0 ][, mixed $script = '' ]) : mixed
Parameters
- $e : mixed
- $query : mixed = ''
- $line : mixed = 0
- $script : mixed = ''
redirectToErrorPage()
private
redirectToErrorPage([mixed $errorCode = 500 ][, mixed $errorMsg = '' ][, mixed $shop = '' ]) : mixed
Parameters
- $errorCode : mixed = 500
- $errorMsg : mixed = ''
- $shop : mixed = ''
supportsTransactions()
Check if transactions are supported by the database.
private
supportsTransactions() : bool