Methods |
public
|
__construct()
{{{ void __construct(void)
{{{ void __construct(void)
|
#
|
public
|
mysql_user_exists($user, $host = 'localhost')
|
#
|
public
|
delete_mysql_user(string $user, string $host, string $cascade = true)
bool delete_mysql_user(string, string[, bool = false])
Delete a MySQL user
bool delete_mysql_user(string, string[, bool = false])
Delete a MySQL user
Parameters
$user |
username
|
$host |
hostname
|
$cascade |
revoke all privileges from databases
|
|
#
|
public
|
pgsql_user_exists($user)
|
#
|
public
|
delete_pgsql_user(string $user, bool $cascade = false): bool
bool delete_pgsql_user(string[, bool = false])
Delete a PostgreSQL user
bool delete_pgsql_user(string[, bool = false])
Delete a PostgreSQL user
Parameters
$user |
username
|
$cascade |
casecade delete
|
|
#
|
public
|
store_sql_password(string $sqlpasswd, string $type): bool
bool store_sql_password (string, string)
bool store_sql_password (string, string)
Parameters
$sqlpasswd |
base64 encoded and encrypted password @{see encrypt_sql_password}
|
$type |
password type, where type is either "mysql" or "pgsql"
|
|
#
|
public
|
set_mysql_option(string $option, string $value = null, string $group = 'client'): bool
Set MySQL client option
Set MySQL client option
Reads from ~/.my.cnf and creates if necessary.
Specify a value of null to remove an option.
|
#
|
public
|
set_pgsql_password($password)
|
#
|
public
|
set_pgsql_username($user)
|
#
|
public
|
get_pgsql_password($user = null)
|
#
|
public
|
get_mysql_option(string $option, string $group = 'client'): mixed
Get option from MySQL client/server configuration
Get option from MySQL client/server configuration
Parameters
$option |
option name
|
$group |
option group
|
Returns
option value, false on failure, null on empty value
|
#
|
public
|
get_elevated_password_backend()
|
#
|
public
|
import_mysql($db, $file)
bool mysql_import(string, string, string, strin)
bool mysql_import(string, string, string, strin)
|
#
|
public
|
list_mysql_databases(): array
array list_mysql_databases ()
Queries the db table in the mysql database for applicable grants
array list_mysql_databases ()
Queries the db table in the mysql database for applicable grants
Returns
|
#
|
public
|
change_prefix(string $prefix): bool
Change account database prefix
Change account database prefix
|
#
|
public
|
get_sql_prefix()
|
#
|
public
|
get_prefix()
|
#
|
public
|
list_mysql_users()
array list_mysql_users ()
Lists all created users for MySQL
array list_mysql_users ()
Lists all created users for MySQL
|
#
|
public
|
add_mysql_user(
$user,
$host,
$password,
$maxconn = 5,
$maxupdates = 0,
$maxquery = 0,
$ssl = '',
$cipher = '',
$issuer = '',
$subject = '',
)
bool add_mysql_user(string, string, string[, int[, int[, int[, string[, string[, string[, string]]]]]]])
bool add_mysql_user(string, string, string[, int[, int[, int[, string[, string[, string[, string]]]]]]])
|
#
|
public
|
get_mysql_database_charset($db)
|
#
|
public
|
create_mysql_database(string $db, string $charset = 'latin1', string $collation = 'latin1_general_ci'): bool
Create a new mysql database
Create a new mysql database
Parameters
$charset |
optional default charset
|
$collation |
optional default collation
|
Returns
|
#
|
public
|
mysql_charset_valid($charset)
|
#
|
public
|
get_supported_mysql_charsets()
|
#
|
public
|
mysql_collation_valid(string $collation): bool
Validate collation name
|
#
|
public
|
get_supported_mysql_collations()
|
#
|
public
|
mysql_collation_compatible(string $collation, string $charset): bool
Verify collation + charset combination are compatible
Verify collation + charset combination are compatible
|
#
|
public
|
mysql_database_exists(string $db): bool
Query information_schema for existence of MySQL database
Query information_schema for existence of MySQL database
Parameters
|
#
|
public
|
add_mysql_user_permissions(string $user, string $host, string $db, array $opts): bool
bool add_mysql_user_permissions (string, string, string, array)
bool add_mysql_user_permissions (string, string, string, array)
|
#
|
public
|
set_mysql_privileges(string $user, string $host, string $db, array $privileges): bool
Set grants for a MySQL user
Set grants for a MySQL user
|
#
|
public
|
delete_mysql_user_permissions($user, $host, $db)
|
#
|
public
|
revoke_from_mysql_db(string $user, string $host, string $db): bool
Revoke all privileges on a database from a MySQL user
Revoke all privileges on a database from a MySQL user
|
#
|
public
|
get_mysql_user_permissions($user, $host, $db)
|
#
|
public
|
get_mysql_privileges(string $user, string $host, string $db): array
Get MySQL grants for a user on a database
Get MySQL grants for a user on a database
|
#
|
public
|
mysql_version($pretty = false): int|string
Returns the version of the MySQL server as an integer
Returns the version of the MySQL server as an integer
The form of this version number is
main_version * 10000 + minor_version * 100 + sub_version
(i.e. version 4.1.0 is 40100)
Returns
integer representing the server version or string
|
#
|
public
|
delete_mysql_database(string $db): bool
Delete MySQL database from system
Delete MySQL database from system
Parameters
|
#
|
public
|
delete_mysql_backup(string $db): bool
Remove MySQL Backup
|
#
|
public
|
assert_mysql_permissions()
Ensure that /var/lib/mysql/ has mysql:<group id> ownership
Ensure that /var/lib/mysql/ has mysql: ownership
|
#
|
public
|
edit_mysql_user(string $user, string $host, array $opts): bool
bool edit_mysql_user(string, string, array)
Note when calling through SOAP, all options must be given, otherwise
the…
bool edit_mysql_user(string, string, array)
Note when calling through SOAP, all options must be given, otherwise
the will default to server preferences.
Parameters
$user |
user
|
$host |
hostname
|
$opts |
array of options, valid indexes:
host
password
max_user_connections
max_updates
max_questions
use_ssl
cipher_type
ssl_cipher
x509_subject
x509_issuer
|
Returns
|
#
|
public
|
service_enabled(string $service): bool
bool service_enabled (string)
bool service_enabled (string)
Checks to see if a service is enabled
Deprecated
Parameters
$service |
service name, either "pgsql" or "mysql"
|
|
#
|
public
|
enabled(string $svc_name): bool
MySQL/PostgreSQL service enabled on account
MySQL/PostgreSQL service enabled on account
Checks to see if either MySQL or PostgreSQL is enabled on an account
Parameters
$svc_name |
service name to check (mysql, pgsql)
|
|
#
|
public
|
add_pgsql_user($user, $password, $maxconn = 5)
bool add_pgsql_user(string, string[, int])
bool add_pgsql_user(string, string[, int])
|
#
|
public
|
create_pgsql_database(string $db): bool
bool create_pgsql_database (string)
bool create_pgsql_database (string)
Returns
|
#
|
public
|
pgsql_database_exists(string $db): bool
Query PostgreSQL system table for existence of database
Query PostgreSQL system table for existence of database
Parameters
|
#
|
public
|
prep_tablespace()
void prep_tablespace ()
Checks to see if tablespace exists, if not, creates it
void prep_tablespace ()
Checks to see if tablespace exists, if not, creates it
|
#
|
public
|
add_pgsql_extension($db, $extension)
|
#
|
public
|
list_pgsql_databases(): array
array list_mysql_databases ()
Queries the db table in the mysql database for applicable grants
array list_mysql_databases ()
Queries the db table in the mysql database for applicable grants
Returns
|
#
|
public
|
add_pgsql_user_permissions(string $user, string $db, array $opts)
bool add_pgsql_user_permissions (string, string, string, array)
Add/removes privileges for a user to a table, any value…
bool add_pgsql_user_permissions (string, string, string, array)
Add/removes privileges for a user to a table, any value listed as
false or not supplied as an array key will revoke the privilege
|
#
|
public
|
delete_pgsql_user_permissions($user, $db)
|
#
|
public
|
get_pgsql_user_permissions($user, $db): void
void get_pgsql_user_permissions(string, string)
Function not implemented in PostgreSQL
void get_pgsql_user_permissions(string, string)
Function not implemented in PostgreSQL
|
#
|
public
|
delete_pgsql_database(string $db): bool
bool delete_pgsql_database(string)
Drops the database and revokes all permssions
bool delete_pgsql_database(string)
Drops the database and revokes all permssions
Returns
|
#
|
public
|
delete_pgsql_backup(string $db): bool
Remove PostgreSQL Backup
|
#
|
public
|
edit_pgsql_user(string $user, string $password, int $maxconn = null): bool
Modify use password and connection limit
Modify use password and connection limit
NOTE: Not implemented with PostgreSQL, owner of database automatically
receives grants. Varying degrees of grants impact the usability of
this function, i.e. common grants [SELECT, INSERT, UPDATE, DELETE] exist
solely on the table level, while [CREATE, TEMP] exist on the database
level
Parameters
$user |
user
|
$maxconn |
connection limit
|
Returns
|
#
|
public
|
get_pgsql_username()
|
#
|
public
|
list_pgsql_users(): array
array list_pgsql_users ()
Lists all created users for PostgreSQL
array list_pgsql_users ()
Lists all created users for PostgreSQL
|
#
|
public
|
pg_vacuum_db($db): string
string pg_vacuum_db (string)
Vacuums a database
string pg_vacuum_db (string)
Vacuums a database
Returns
|
#
|
public
|
truncate_pgsql_database($db)
|
#
|
public
|
pgsql_version($pretty = false)
|
#
|
public
|
empty_pgsql_database($db)
|
#
|
public
|
import_pgsql($db, $file)
bool pgsql_import(string, string, string, strin)
bool pgsql_import(string, string, string, strin)
|
#
|
public
|
truncate_mysql_database($db)
|
#
|
public
|
empty_mysql_database($db)
|
#
|
public
|
export_mysql(string $db, string|null $file = null): mixed
Export a MySQL database
Parameters
Returns
path of export or false on failure
|
#
|
public
|
get_database_size(string $type, string $db): int
Get disk space occupied by database
Get disk space occupied by database
Parameters
$type |
database type, "mysql" or "pgsql"
|
$db |
database name
|
Returns
|
#
|
public
|
export_mysql_pipe($db): bool|void
Export a db to a named pipe for immediate download
Export a db to a named pipe for immediate download
|
#
|
public
|
export_mysql_pipe_real($db, $user): bool|string
Export a database to a named pipe
Export a database to a named pipe
Differs from export_mysql_pipe in that it may only be called internally
or from backend, no API access
|
#
|
public
|
export_pgsql($db, $file = null)
|
#
|
public
|
export_pgsql_pipe($db): bool|void
Export a PGSQL db to a named pipe for immediate download
Export a PGSQL db to a named pipe for immediate download
|
#
|
public
|
get_pgsql_uptime(): int
int get_pgsql_uptime
|
#
|
public
|
get_mysql_uptime(): int
int get_mysql_uptime
|
#
|
public
|
add_mysql_backup($db, $extension = 'zip', $span = 5, $preserve = '0', $email = '')
|
#
|
public
|
add_pgsql_backup($db, $extension = 'zip', $span = 5, $preserve = '0', $email = '')
|
#
|
public
|
edit_mysql_backup($db, $extension, $span = '0', $preserve = '0', $email = '')
|
#
|
public
|
edit_pgsql_backup($db, $extension, $span = '0', $preserve = '0', $email = '')
|
#
|
public
|
list_mysql_backups()
|
#
|
public
|
list_pgsql_backups()
|
#
|
public
|
get_mysql_backup_config(string $db): array
Fetch MySQL backup task information
Fetch MySQL backup task information
span => (integer) days between backups
hold => (integer) number of backups to preserve
next => (integer) unix timestamp of next backup
ext => (string) extension of backup
email => (string) notify address after backup
Parameters
|
#
|
public
|
get_pgsql_backup_config(string $db): array
Fetch backup information
|
#
|
public
|
repair_mysql_database($db)
|
#
|
public
|
mysql_kill(integer $id): bool
Kill a mysql connection
|
#
|
public
|
mysql_processlist(): array
Get active mysql connections
Get active mysql connections
Array
(
[0] => Array
(
[id] => 11024
[user] => debug
[host] => localhost
[db] => debug
[command] => Query
[state] => User sleep
[info] => select sleep(1000)
)
)
|
#
|
public
|
mysql_schema_column_maxlen(string $field): int
Get max length of a column in mysql schema
Get max length of a column in mysql schema
|
#
|
public
|
_edit()
|
#
|
public
|
_delete()
|
#
|