\Pop\Debug\StorageSqlite

Debug sqlite storage class

Summary

Methods
Properties
Constants
__construct()
setFormat()
isText()
isPhp()
isJson()
getFormat()
save()
get()
has()
delete()
clear()
encodeValue()
setDb()
getDb()
getTable()
setTable()
query()
No public properties found
No constants found
prepare()
bindParams()
execute()
checkTable()
$format
$db
$table
$sqlite
$statement
$result
$isPdo
N/A
No private methods found
No private properties found
N/A

Properties

$format

$format : string

Storage format

Type

string

$db

$db : string

Debug db file

Type

string

$table

$table : string

Debug db table

Type

string

$sqlite

$sqlite : \PDO|\SQLite3

Sqlite DB object

Type

\PDO|\SQLite3

$statement

$statement : mixed

Sqlite DB statement object (either a PDOStatement or SQLite3Stmt object)

Type

mixed

$result

$result : resource

Database results

Type

resource

$isPdo

$isPdo : boolean

PDO flag

Type

boolean

Methods

__construct()

__construct(string  $db, string  $format = 'json', string  $table = 'pop_debug', boolean  $pdo = false) 

Constructor

Instantiate the debug db object

Parameters

string $db
string $format
string $table
boolean $pdo

Throws

\Pop\Debug\Storage\Exception

isText()

isText() : boolean

Determine if the format is text

Returns

boolean

isPhp()

isPhp() : boolean

Determine if the format is PHP

Returns

boolean

isJson()

isJson() : boolean

Determine if the format is JSON

Returns

boolean

getFormat()

getFormat() : string

Get the storage format

Returns

string

save()

save(string  $id, mixed  $value, integer  $ttl = null) : \Pop\Debug\Storage\Sqlite

Save debug data

Parameters

string $id
mixed $value
integer $ttl

Returns

\Pop\Debug\Storage\Sqlite

get()

get(string  $id) : mixed

Get debug data

Parameters

string $id

Returns

mixed

has()

has(string  $id) : boolean

Determine if debug data exists

Parameters

string $id

Returns

boolean

delete()

delete(string  $id) : \Pop\Debug\Storage\Sqlite

Delete debug data

Parameters

string $id

Returns

\Pop\Debug\Storage\Sqlite

encodeValue()

encodeValue(mixed  $value) : string

Encode the value based on the format

Parameters

mixed $value

Throws

\Pop\Debug\Storage\Exception

Returns

string

setDb()

setDb(string  $db) : \Pop\Debug\Storage\Sqlite

Set the current debug db file.

Parameters

string $db

Throws

\Pop\Debug\Storage\Exception

Returns

\Pop\Debug\Storage\Sqlite

getDb()

getDb() : string

Get the current debug db file.

Returns

string

getTable()

getTable() : string

Get the current debug db table.

Returns

string

setTable()

setTable(string  $table) : \Pop\Debug\Storage\Sqlite

Set the debug db table

Parameters

string $table

Returns

\Pop\Debug\Storage\Sqlite

query()

query(string  $sql) : void

Execute the SQL query

Parameters

string $sql

Throws

\Pop\Debug\Storage\Exception

prepare()

prepare(string  $sql) : \Pop\Debug\Storage\Sqlite

Prepare a SQL query

Parameters

string $sql

Returns

\Pop\Debug\Storage\Sqlite

bindParams()

bindParams(array  $params) : \Pop\Debug\Storage\Sqlite

Bind parameters to for a prepared SQL query

Parameters

array $params

Returns

\Pop\Debug\Storage\Sqlite

execute()

execute() : void

Execute the prepared SQL query

Throws

\Pop\Debug\Storage\Exception

checkTable()

checkTable() : void

Check if debug table exists