Class dmstr\console\controllers\MysqlController

Inheritancedmstr\console\controllers\MysqlController » yii\console\Controller

MySQL database maintenance command.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$dataOnly Bool [0|1] dump only data dmstr\console\controllers\MysqlController
$excludeTables array List of tables to exclude in dumps dmstr\console\controllers\MysqlController
$includeTables array List of tables to include in dumps dmstr\console\controllers\MysqlController
$mysqlRetryMaxCount int Number of retries for MySql create operations dmstr\console\controllers\MysqlController
$mysqlRetryTimeout int Timeout in seconds between operations dmstr\console\controllers\MysqlController
$noDataTables array List of tables with only structural (schema) commands in dumps dmstr\console\controllers\MysqlController
$truncateTables Bool [0|1] add truncate table command dmstr\console\controllers\MysqlController

Property Details

$dataOnly public property

Bool [0|1] dump only data

public $dataOnly 0
$excludeTables public property

List of tables to exclude in dumps

public array $excludeTables = []
$includeTables public property

List of tables to include in dumps

public array $includeTables = []
$mysqlRetryMaxCount public property

Number of retries for MySql create operations

public int $mysqlRetryMaxCount 20
$mysqlRetryTimeout public property

Timeout in seconds between operations

public int $mysqlRetryTimeout 2
$noDataTables public property

List of tables with only structural (schema) commands in dumps

public array $noDataTables = []
$truncateTables public property

Bool [0|1] add truncate table command

public $truncateTables 0

Method Details

actionCreate() public method

Create MySQL database

Note: Loads parameters from ENV vars, if empty.

Creates database and grants permissions to user

public void actionCreate ( $db null, $dsn null, $root null, $rootPassword null, $user null, $pass null )
$db null

Database name DATABASE_DSN_DB

$dsn null

Database base-DSN DATABASE_DSN_BASE

$root null

`DB_ENV_MYSQL_ROOT_USER

$rootPassword null

DB_ENV_MYSQL_ROOT_USER

$user null

DB_ENV_MYSQL_USER

$pass null

`DB_ENV_MYSQL_PASSWORD

throws \yii\base\ExitException
actionDump() public method

Dumps current database tables to runtime folder

public void actionDump ( )
throws \yii\console\Exception
actionIndex() public method

Displays tables in database

public void actionIndex ( )
throws \yii\console\Exception
actionXDump() public method

EXPERIMENTAL: Schema and/or Data dumps

public void actionXDump ( )
actionXDumpData() public method

EXPERIMENTAL: data only dump

public void actionXDumpData ( )
throws \yii\base\Exception
options() public method

public void options ( $actionId )
$actionId