PHP Class Piwik\Db\Schema\Mysql

Inheritance: implements Piwik\Db\SchemaInterface
Show file Open project: piwik/piwik

Public Methods

Method Description
createAnonymousUser ( ) Creates an entry in the User table for the "anonymous" user.
createDatabase ( string $dbName = null ) Create database
createTable ( string $nameWithoutPrefix, string $createDefinition ) Creates a new table in the database.
createTables ( ) Create all tables
dropDatabase ( $dbName = null ) Drop database
getTableColumns ( string $tableName ) : array Get list of installed columns in a table
getTableCreateSql ( string $tableName ) : string Get the SQL to create a specific Piwik table
getTablesCreateSql ( ) : array Get the SQL to create Piwik tables
getTablesInstalled ( boolean $forceReload = true ) : array Get list of tables installed
getTablesNames ( ) : array Names of all the prefixed tables in piwik Doesn't use the DB
hasTables ( ) : boolean Checks whether any table exists
truncateAllTables ( ) Truncate all tables

Private Methods

Method Description
getAllExistingTables ( $prefixTables = false )
getDb ( )
getDbName ( )
getDbSettings ( )
getTableEngine ( )
getTablePrefix ( )
getTablePrefixEscaped ( )

Method Details

createAnonymousUser() public method

Creates an entry in the User table for the "anonymous" user.
public createAnonymousUser ( )

createDatabase() public method

Create database
public createDatabase ( string $dbName = null )
$dbName string Name of the database to create

createTable() public method

Creates a new table in the database.
public createTable ( string $nameWithoutPrefix, string $createDefinition )
$nameWithoutPrefix string The name of the table without any piwik prefix.
$createDefinition string The table create definition, see the "MySQL CREATE TABLE" specification for more information.

createTables() public method

Create all tables
public createTables ( )

dropDatabase() public method

Drop database
public dropDatabase ( $dbName = null )

getTableColumns() public method

Get list of installed columns in a table
public getTableColumns ( string $tableName ) : array
$tableName string The name of a table.
return array Installed columns indexed by the column name.

getTableCreateSql() public method

Get the SQL to create a specific Piwik table
public getTableCreateSql ( string $tableName ) : string
$tableName string
return string SQL

getTablesCreateSql() public method

Get the SQL to create Piwik tables
public getTablesCreateSql ( ) : array
return array array of strings containing SQL

getTablesInstalled() public method

Get list of tables installed
public getTablesInstalled ( boolean $forceReload = true ) : array
$forceReload boolean Invalidate cache
return array installed Tables

getTablesNames() public method

Names of all the prefixed tables in piwik Doesn't use the DB
public getTablesNames ( ) : array
return array Table names

hasTables() public method

Checks whether any table exists
public hasTables ( ) : boolean
return boolean True if tables exist; false otherwise

truncateAllTables() public method

Truncate all tables
public truncateAllTables ( )