PHP Class WPDKDB

1. Export
Since: 1.7.0
Author: =undo= ([email protected])
Inheritance: extends wpdb
Mostra file Open project: wpxtreme/wpdk Class Usage Examples

Public Properties

Property Type Description
$mysqli boolean Whether to use mysqli over mysql.

Public Methods

Method Description
__construct ( ) : WPDKDB Create an instance of WPDKDB class
addslashes ( string $value = '', boolean $is_like = false ) : mixed Better addslashes for SQL queries.
backquote ( string | array $value ) : array | string Add backquotes to string or array group. Return a string if input param is a string, otherwise return an array if the input params is an array.
dumpWithTable ( string $table, string $filename = '' ) : string Reads the Database table in $table and creates SQL Statements for recreating structure and data then return the DUMP SQL. If you set the $filename params then the dump is store on filesystem too.
executeQuery ( string $query ) : boolean | mysqli_result | resource Utility to execute a pure query in MySQL or MySQLi extension.
importWithFilename ( string $filename ) : boolean | mysqli_result | resource | WPDKError Utility method to import a SQL (pure) file usually an export.
init ( ) : WPDKDB Return a singleton instance of WPDKDB class
removeComments ( string $query ) : string Return a SQL statement without comments.

Method Details

__construct() public method

Create an instance of WPDKDB class
public __construct ( ) : WPDKDB
return WPDKDB

addslashes() public static method

Taken from phpMyAdmin.
public static addslashes ( string $value = '', boolean $is_like = false ) : mixed
$value string Optional. Default empty.
$is_like boolean Optional. Default FALSE.
return mixed

backquote() public static method

Add backquotes to string or array group. Return a string if input param is a string, otherwise return an array if the input params is an array.
public static backquote ( string | array $value ) : array | string
$value string | array Table or list of table.
return array | string

dumpWithTable() public method

Taken partially from phpMyAdmin and partially from Alain Wolf, Zurich - Switzerland Website: http://restkultur.ch/personal/wolf/scripts/db_backup/
public dumpWithTable ( string $table, string $filename = '' ) : string
$table string Table name.
$filename string Optional. Complete path of a filename where store the dump.
return string

executeQuery() public method

Utility to execute a pure query in MySQL or MySQLi extension.
public executeQuery ( string $query ) : boolean | mysqli_result | resource
$query string SQL statement.
return boolean | mysqli_result | resource

importWithFilename() public method

Utility method to import a SQL (pure) file usually an export.
public importWithFilename ( string $filename ) : boolean | mysqli_result | resource | WPDKError
$filename string Path of file.
return boolean | mysqli_result | resource | WPDKError

init() public static method

Return a singleton instance of WPDKDB class
public static init ( ) : WPDKDB
return WPDKDB

removeComments() public static method

Return a SQL statement without comments.
public static removeComments ( string $query ) : string
$query string SQL statement.
return string

Property Details

$mysqli public_oe property

Whether to use mysqli over mysql.
public bool $mysqli
return boolean