Class WPDADB

Manage local and remote database connections.

author Peter Schulz
since 3.0.0
package WPDataAccess\Connection

 Methods

add_remote_database()

add_remote_database($database, $host, $user, $passwd, $port, $schema) 
Static

Parameters

$database

$host

$user

$passwd

$port

$schema

Check if a connection with a remote database can be established

check_remote_database_connection() : \wpdb

Returns

\wpdb

del_remote_database()

del_remote_database($database) 
Static

Parameters

$database

Get database connection

get_db_connection(string $schema_name) : mixed | \wpdb
Static

Remote schema name starts with prefix "rdb:"

Parameters

$schema_name

string

Database (schema) name

Returns

mixed\wpdb

get_remote_database()

get_remote_database($database, $include_disabled = false
Static

Parameters

$database

$include_disabled

get_remote_databases()

get_remote_databases($include_disabled = false
Static

Parameters

$include_disabled

iswpdb()

iswpdb($schema_name) 
Static

Parameters

$schema_name

load_remote_databases()

load_remote_databases() 
Static

save_remote_databases()

save_remote_databases() 
Static

Decrypt a string with the WPDA secret key and iv

string_decrypt(string $string) : string
Static

Parameters

$string

string

String to be decrypted

Returns

string

Encrypt a string with the WPDA secret key and iv

string_encrypt(string $string) : string
Static

Parameters

$string

string

String to be encrypted

Returns

string

upd_remote_database()

upd_remote_database($database, $host, $user, $passwd, $port, $schema, $disabled, $database_old = false
Static

Parameters

$database

$host

$user

$passwd

$port

$schema

$disabled

$database_old

 Properties

 

Database connections cached per database name (schema_name)

$db_connections : array

Default

array()
Static

Remote database are prefixed with "rdb:"

 

Stores te lower_case_table_names db value

$lower_case_table_names : null | integer

Default

null
Static
 

Remote database access definitions

$remote_databases : array | boolean

Default

false
Static