PHP Class Piwik\Plugins\Installation\Rule_checkUserPrivileges

The following privileges are required for Piwik to run: - CREATE - ALTER - SELECT - INSERT - UPDATE - DELETE - DROP - CREATE TEMPORARY TABLES
Inheritance: extends HTML_QuickForm2_Rul\HTML_QuickForm2_Rule
显示文件 Open project: piwik/piwik Class Usage Examples

Public Methods

Method Description
getRequiredPrivileges ( ) : array Returns an array describing the database privileges required for Piwik to run. The array maps privilege names with one or more SQL queries that can be used to test if the current user has the privilege.
getRequiredPrivilegesPretty ( ) : string Returns a string description of the database privileges required for Piwik to run.
validateOwner ( ) Checks that the DB user entered in the form has the necessary privileges for Piwik to run.

Private Methods

Method Description
createDatabaseObject ( ) : array Creates a database object using the connection information entered in the form.
dropExtraTables ( Piwik\Db $db ) Drops the tables created by the privilege checking queries, if they exist.
isAccessDenied ( Exception $ex ) : boolean Checks if an exception that was thrown after running a query represents an 'access denied' error.

Method Details

getRequiredPrivileges() public static method

NOTE: LOAD DATA INFILE & LOCK TABLES privileges are not **required** so they're not checked.
public static getRequiredPrivileges ( ) : array
return array

getRequiredPrivilegesPretty() public static method

Returns a string description of the database privileges required for Piwik to run.
public static getRequiredPrivilegesPretty ( ) : string
return string

validateOwner() public method

Checks that the DB user entered in the form has the necessary privileges for Piwik to run.
public validateOwner ( )