SQL
[ class tree: SQL ] [ index: SQL ] [ all elements ]

Class: Sql_Module

Source Location: /sql.php

Class Overview

Module_Skeleton
   |
   --Sql_Module



Variables

Methods



Class Details

[line 7]


[ Top ]


Class Variables

$mysql =

[line 8]



Tags:

access:  public

Type:   mixed


[ Top ]

$pgsql =

[line 9]



Tags:

access:  public

Type:   mixed


[ Top ]



Class Methods


method add_mysql_backup [line 981]

void add_mysql_backup( $mDB, $mExtension, $mSpan, [ $mPreserve = '0'], [ $mEmail = ''])



Tags:

access:  public


Parameters:

   $mDB  
   $mExtension  
   $mSpan  
   $mPreserve  
   $mEmail  

[ Top ]

method add_mysql_user [line 299]

void add_mysql_user( $mUser, $mHost, $mPassword, [ $mMaxConn = 5], [ $mMaxUpdates = 0], [ $mMaxQ = 0], [ $mSSL = ''], [ $mCipher = ''], [ $mIssuer = ''], [ $mSubject = ''])

bool add_mysql_user(string, string, string[, int[, int[, int[, string[, string[, string[, string]]]]]]])



Tags:

access:  public


Parameters:

   $mUser  
   $mHost  
   $mPassword  
   $mMaxConn  
   $mMaxUpdates  
   $mMaxQ  
   $mSSL  
   $mCipher  
   $mIssuer  
   $mSubject  

[ Top ]

method add_mysql_user_permissions [line 377]

void add_mysql_user_permissions( string $mUser, string $mHost, string $mDB, $mOpts)

bool add_mysql_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



Tags:

access:  public


Parameters:

string   $mUser  
string   $mHost  
string   $mDB  
array   $mOpts  

[ Top ]

method add_pgsql_backup [line 982]

void add_pgsql_backup( $mDB, $mExtension, $mSpan, [ $mPreserve = '0'], [ $mEmail = ''])



Tags:

access:  public


Parameters:

   $mDB  
   $mExtension  
   $mSpan  
   $mPreserve  
   $mEmail  

[ Top ]

method add_pgsql_user [line 718]

void add_pgsql_user( $mUser, $mPassword, [ $mMaxConn = 5])

bool add_pgsql_user(string, string[, int])



Tags:

access:  public


Parameters:

   $mUser  
   $mPassword  
   $mMaxConn  

[ Top ]

method add_pgsql_user_permissions [line 789]

void add_pgsql_user_permissions( string $mUser, string $mDB, $mOpts)

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



Tags:

access:  public


Parameters:

string   $mUser  
string   $mDB  
array   $mOpts  

[ Top ]

method assert_mysql_permissions [line 544]

void assert_mysql_permissions( )

Ensure that /var/lib/mysql/ has mysql:<group id> ownership



Tags:

access:  public


[ Top ]

method create_mysql_database [line 351]

bool create_mysql_database( $mName, string $mDBName)

bool create_mysql_database (string)



Tags:

return:  creation succeeded
access:  public


Parameters:

string   $mDBName  
   $mName  

[ Top ]

method create_mysql_database_backend [line 483]

void create_mysql_database_backend( $mName)

bool create_mysql_database_backend (string)

create_mysql_database




Tags:

access:  public


Parameters:

   $mName  

[ Top ]

method create_pgsql_database [line 742]

bool create_pgsql_database( $mName, string $mDBName)

bool create_pgsql_database (string)



Tags:

return:  creation succeeded
access:  public


Parameters:

string   $mDBName  
   $mName  

[ Top ]

method decrypt_sql_password [line 108]

string decrypt_sql_password( string $mSQLPasswd, string $mSalt)

string decrypt_sql_password (string, string)



Tags:

return:  plaintext password
access:  public


Parameters:

string   $mSQLPasswd   base64-encoded password
string   $mSalt   salt used to encrypt the password

[ Top ]

method delete_mysql_backup [line 987]

void delete_mysql_backup( $mDB)



Tags:

access:  public


Parameters:

   $mDB  

[ Top ]

method delete_mysql_database [line 514]

bool delete_mysql_database( string $mDBName)

bool delete_mysql_database(string)

Revokes all permissions from the database and permanently drops it




Tags:

return:  drop succeeded
access:  public


Parameters:

string   $mDBName  

[ Top ]

method delete_mysql_database_backend [line 553]

void delete_mysql_database_backend( $mDBName)



Tags:

access:  public


Parameters:

   $mDBName  

[ Top ]

method delete_mysql_user [line 672]

void delete_mysql_user( string $mUser, string $mHost, [string $mCascadeDB = false])

bool delete_mysql_user(string, string[, bool = false])

Delete a MySQL user




Tags:

access:  public


Parameters:

string   $mUser   username
string   $mHost   hostname
string   $mCascadeDB   revoke all privileges from databases

[ Top ]

method delete_mysql_user_permissions [line 425]

void delete_mysql_user_permissions( $mUser, $mHost, $mDB)



Tags:

access:  public


Parameters:

   $mUser  
   $mHost  
   $mDB  

[ Top ]

method delete_pgsql_backup [line 988]

void delete_pgsql_backup( $mDB)



Tags:

access:  public


Parameters:

   $mDB  

[ Top ]

method delete_pgsql_database [line 811]

bool delete_pgsql_database( string $mDBName)

bool delete_pgsql_database(string)

Drops the database and revokes all permssions




Tags:

return:  drop succeeded
access:  public


Parameters:

string   $mDBName  

[ Top ]

method delete_pgsql_user [line 894]

void delete_pgsql_user( string $mUser, [ $mCascadeDB = false])

bool delete_pgsql_user(string[, bool = false])

Delete a PostgreSQL user




Tags:

access:  public


Parameters:

string   $mUser   username
   $mCascadeDB  

[ Top ]

method delete_pgsql_user_permissions [line 793]

void delete_pgsql_user_permissions( $mUser, $mDB)



Tags:

access:  public


Parameters:

   $mUser  
   $mDB  

[ Top ]

method delete_sql_password [line 168]

void delete_sql_password( $mUser, [ $mType = NULL])

bool delete_sql_password (string[, string])

Removes a stored SQL password




Tags:

TODO:  
access:  public


Parameters:

   $mUser  
   $mType  

[ Top ]

method edit_mysql_backup [line 983]

void edit_mysql_backup( $mDB, $mExtension, [ $mSpan = '0'], [ $mPreserve = '0'], [ $mEmail = ''])



Tags:

access:  public


Parameters:

   $mDB  
   $mExtension  
   $mSpan  
   $mPreserve  
   $mEmail  

[ Top ]

method edit_mysql_user [line 580]

bool edit_mysql_user( string $mUser, string $mHost, array $mOpts)

bool edit_mysql_user(string, string, array) Note when calling through SOAP, all options must be given, otherwise the will default to server preferences.



Tags:

return:  query succeeded
access:  public


Parameters:

string   $mUser   user
string   $mHost   hostname
array   $mOpts   array of options, valid indexes: host password max_user_connections max_updates max_questions use_ssl cipher_type ssl_cipher x509_subject x509_issuer

[ Top ]

method edit_pgsql_backup [line 984]

void edit_pgsql_backup( $mDB, $mExtension, [ $mSpan = '0'], [ $mPreserve = '0'], [ $mEmail = ''])



Tags:

access:  public


Parameters:

   $mDB  
   $mExtension  
   $mSpan  
   $mPreserve  
   $mEmail  

[ Top ]

method edit_pgsql_user [line 849]

bool edit_pgsql_user( string $mUser, string $mPassword, [int $mConnLimit = NULL])

bool edit_pgsql_user(string, string, array)

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




Tags:

return:  query succeeded
access:  public


Parameters:

string   $mUser   user
string   $mPassword  
int   $mConnLimit   connection limit

[ Top ]

method encrypt_sql_password [line 86]

string encrypt_sql_password( string $mSQLPasswd, string $mSalt)

string encrypt_sql_password(string, string)



Tags:

return:  base64-encoded and encrypted password
access:  public


Parameters:

string   $mSQLPasswd   plaintext SQL password
string   $mSalt   salt used to encrypt it

[ Top ]

method get_database_size [line 260]

void get_database_size( string $mType, string $mName)

int get_database_size(string, string)



Tags:

access:  public


Parameters:

string   $mType   database type, "mysql" or "postgresql"
string   $mName   database name

[ Top ]

method get_database_size_backend [line 276]

int get_database_size_backend( string $mType, string $mName)

int get_database_size_backend(string, string)



Tags:

return:  size in bytes get_database_size
access:  public


Parameters:

string   $mType   database type, valid values: [mysql, postgresql]
string   $mName   database name

[ Top ]

method get_elevated_password_backend [line 181]

void get_elevated_password_backend( )



Tags:

access:  public


[ Top ]

method get_mysql_uptime [line 977]

int get_mysql_uptime( )

int get_mysql_uptime



Tags:

return:  time in seconds
access:  public


[ Top ]

method get_mysql_user_permissions [line 441]

void get_mysql_user_permissions( $mUser, $mHost, $mDB)



Tags:

access:  public


Parameters:

   $mUser  
   $mHost  
   $mDB  

[ Top ]

method get_pgsql_uptime [line 968]

int get_pgsql_uptime( )

int get_pgsql_uptime



Tags:

return:  time in seconds
access:  public


[ Top ]

method get_pgsql_user_permissions [line 801]

void get_pgsql_user_permissions( $mUser, $mDB)

void get_pgsql_user_permissions(string, string)

Function not implemented in PostgreSQL




Tags:

access:  public


Parameters:

   $mUser  
   $mDB  

[ Top ]

method get_sql_prefix [line 217]

void get_sql_prefix( )



Tags:

access:  public


[ Top ]

method list_mysql_backups [line 985]

void list_mysql_backups( )



Tags:

access:  public


[ Top ]

method list_mysql_databases [line 195]

array list_mysql_databases( )

array list_mysql_databases ()

Queries the db table in the mysql database for applicable grants




Tags:

return:  list of databases
access:  public


[ Top ]

method list_mysql_users [line 225]

void list_mysql_users( )

array list_mysql_users ()

Lists all created users for MySQL




Tags:

access:  public


[ Top ]

method list_pgsql_backups [line 986]

void list_pgsql_backups( )



Tags:

access:  public


[ Top ]

method list_pgsql_databases [line 827]

array list_pgsql_databases( )

array list_mysql_databases ()

Queries the db table in the mysql database for applicable grants




Tags:

return:  list of databases
access:  public


[ Top ]

method list_pgsql_users [line 876]

array list_pgsql_users( )

array list_pgsql_users ()

Lists all created users for PostgreSQL




Tags:

access:  public


[ Top ]

method mysql_dump [line 940]

void mysql_dump( $mUser, $mPassword, $mDB, [ $mFileName = null])



Tags:

access:  public


Parameters:

   $mUser  
   $mPassword  
   $mDB  
   $mFileName  

[ Top ]

method mysql_dump_backend [line 950]

void mysql_dump_backend( $mUser, $mPassword, $mDB, $mFileName)



Tags:

access:  public


Parameters:

   $mUser  
   $mPassword  
   $mDB  
   $mFileName  

[ Top ]

method mysql_import [line 212]

void mysql_import( $mScript, $mUser, $mPassword, $mDB)

bool mysql_import(string, string, string, strin)



Tags:

access:  public


Parameters:

   $mScript  
   $mUser  
   $mPassword  
   $mDB  

[ Top ]

method pgsql_dump [line 958]

void pgsql_dump( $mUser, $mPassword, $mDB, $mFileName)



Tags:

access:  public


Parameters:

   $mUser  
   $mPassword  
   $mDB  
   $mFileName  

[ Top ]

method pgsql_import [line 931]

void pgsql_import( $mScript, $mUser, $mPassword, $mDB)

bool pgsql_import(string, string, string, strin)



Tags:

access:  public


Parameters:

   $mScript  
   $mUser  
   $mPassword  
   $mDB  

[ Top ]

method pg_vacuum_db [line 912]

string pg_vacuum_db( $mDBName)

string pg_vacuum_db (string)

Vacuums a database




Tags:

return:  vacuum output
access:  public


Parameters:

   $mDBName  

[ Top ]

method pg_vacuum_db_backend [line 920]

void pg_vacuum_db_backend( $mDBName)



Tags:

access:  public


Parameters:

   $mDBName  

[ Top ]

method prep_tablespace_backend [line 773]

void prep_tablespace_backend( )

void prep_tablespace_backend ()

prep_tablespace




Tags:

access:  public


[ Top ]

method retrieve_sql_password [line 154]

string retrieve_sql_password( string $mType)

string retrieve_sql_password (string)



Tags:

return:  base64-encoded and encrypted password on record
access:  public


Parameters:

string   $mType   SQL type, either "postgresql" or "mysql"

[ Top ]

method service_enabled [line 705]

service service_enabled( string $mSrvcName)

bool service_enabled (string)

Checks to see if a service is enabled




Tags:

return:  enabled for the domain
access:  public


Parameters:

string   $mSrvcName   service name, either "postgresql" or "mysql"

[ Top ]

method store_sql_password [line 129]

void store_sql_password( string $mSQLPasswd, string $mType)

bool store_sql_password (string, string)



Tags:

access:  public


Parameters:

string   $mSQLPasswd   base64 encoded and encrypted password @{see encrypt_sql_password}
string   $mType   password type, where type is either "mysql" or "postgresql"

[ Top ]


Documentation generated on Sat, 05 Jul 2008 04:00:45 -0400 by phpDocumentor 1.4.0