Methods Summary | ||
---|---|---|
public
|
#
__construct( )
|
|
public
|
||
public
|
#
delete_mysql_user( string $user , string $host , string $cascade = true )
bool delete_mysql_user(string, string[, bool = false])
Delete a MySQL user
|
|
public
|
||
public
|
#
delete_pgsql_user( string $user , bool $cascade = false )
bool delete_pgsql_user(string[, bool = false])
Delete a PostgreSQL user
|
|
public
|
||
public
|
#
set_mysql_option( string $option , string $value = NULL, string $group = 'client' )
Set MySQL client option
Reads from ~/.my.cnf and creates if necessary.
Specify a value of null to remove an option.
|
|
public
|
||
public
|
||
public
|
||
public
|
#
get_mysql_option( string $option , string $group = 'client' )
Get option from MySQL client/server configuration
|
|
public
|
||
public
|
||
public
|
#
list_mysql_databases( )
array list_mysql_databases ()
Queries the db table in the mysql database for applicable grants
|
|
public
|
||
public
|
||
public
|
||
public
|
||
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]]]]]]])
|
|
public
|
||
public
|
#
create_mysql_database( string $db , string $charset = 'latin1', string $collation = 'latin1_general_ci' )
Create a new mysql database
|
|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
mysql_collation_compatible( string $collation , string $charset )
Verify collation + charset combination are compatible
|
|
public
|
||
public
|
#
add_mysql_user_permissions( string $user , string $host , string $db , array $opts )
bool add_mysql_user_permissions (string, string, string, array)
Deprecatedseeset_mysql_privileges() |
|
public
|
#
set_mysql_privileges( string $user , string $host , string $db , array $privileges )
Set grants for a MySQL user
|
|
public
|
||
public
|
#
revoke_from_mysql_db( string $user , string $host , string $db )
Revoke all privileges on a database from a MySQL user
|
|
public
|
||
public
|
#
get_mysql_privileges( string $user , string $host , string $db )
Get MySQL grants for a user on a database
|
|
public
|
#
mysql_version( $pretty = false )
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)
|
|
public
|
||
public
|
||
public
|
||
public
|
#
edit_mysql_user( string $user , string $host , array $opts )
bool edit_mysql_user(string, string, array)
Note when calling through SOAP, all options must be given, otherwise
the will default to server preferences.
|
|
public
|
#
service_enabled( string $service )
bool service_enabled (string)
Checks to see if a service is enabled
Deprecated |
|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
prep_tablespace( )
void prep_tablespace ()
Checks to see if tablespace exists, if not, creates it
private |
|
public
|
||
public
|
#
list_pgsql_databases( )
array list_mysql_databases ()
Queries the db table in the mysql database for applicable grants
|
|
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 listed as
false or not supplied as an array key will revoke the privilege
|
|
public
|
||
public
|
#
get_pgsql_user_permissions( $user , $db )
void get_pgsql_user_permissions(string, string)
Function not implemented in PostgreSQL
|
|
public
|
#
delete_pgsql_database( string $db )
bool delete_pgsql_database(string)
Drops the database and revokes all permssions
|
|
public
|
||
public
|
#
edit_pgsql_user( string $user , string $password , int $maxconn = NULL )
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
|
|
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
export_mysql_pipe_real( $db , $user )
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
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
#
get_mysql_backup_config( string $db )
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
|
|
public
|
||
public
|
||
public
|
||
public
|
#
mysql_processlist( )
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
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
||
public
|
Methods inherited from Module\Skeleton\Standard |
---|
__construct() ,
setUserParameters() ,
autoloadModule() ,
__wakeup() ,
_invoke() ,
__debugInfo() ,
getExportedFunctions() ,
_reset() ,
cleanUserParameters() ,
query()
|
Constants Summary | ||
---|---|---|
public
int
|
MYSQL_USER_FIELD_SIZE
|
#
16
|
public
string
|
PG_TEMP_PASSWORD
|
#
'23f!eoj3'
|
public
string
|
MYSQL_DATADIR
|
#
'/var/lib/mysql'
|
public
string
|
PGSQL_DATADIR
|
#
'/var/lib/pgsql'
|
public
int
|
MIN_PASSWORD_LENGTH
|
#
3
|
public
int
|
PER_DATABASE_CONNECTION_LIMIT
|
#
20
|
public
int
|
MIN_PREFIX_LENGTH
|
#
3
|
public
string
|
MASTER_USER
|
#
'root'
|
public
double
|
DB_BIN2TXT_MULT
a bullshit constant to decide whether to
up the ulimit fsize or not before exporting a db
|
#
1.5
|
protected
array
|
PGSQL_PERMITTED_EXTENSIONS
|
#
array (
0 => 'pg_trgm',
1 => 'hstore',
)
|
Constants inherited from Module\Support\Sql |
---|
DEFAULT_CONCURRENCY_LIMIT
,
MIN_PASSWORD_LENGTH
,
MIN_PREFIX_LENGTH
,
MASTER_USER
,
DB_BIN2TXT_MULT
|
Constants inherited from Module\Skeleton\Standard |
---|
DEPENDENCY_MAP
|
Properties Summary | ||
---|---|---|
protected
|
$exportedFunctions
|
#
array (
'*' => 2,
'get_prefix' => 3,
'pgsql_version' => 15,
'mysql_version' => 15,
'version' => 15,
'get_mysql_uptime' => 15,
'assert_mysql_permissions' => 18,
'get_pgsql_uptime' => 15,
'set_mysql_option' => 15,
'get_mysql_option' => 15,
'get_pgsql_username' => 15,
'get_pgsql_password' => 15,
'set_pgsql_password' => 15,
'export_mysql_pipe_real' => 18,
'export_pgsql_pipe_real' => 18,
'enabled' => 3,
'repair_mysql_database' => 10,
'get_database_size' => 10,
'mysql_database_exists' => 10,
'pgsql_database_exists' => 10,
'_export_mysql_old' => 18,
)
|
Properties inherited from Module\Support\Sql |
---|
$_tempUsers
|
Properties inherited from Module\Skeleton\Standard |
---|
$exportedFunctions ,
$username ,
$password ,
$domain ,
$user_id ,
$group_id ,
$permission_level ,
$session_id ,
$site ,
$site_id
|