PHP Класс N98\Util\Console\Helper\DatabaseHelper

Наследование: extends Symfony\Component\Console\Helper\Helper
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_connection PDO
$_tables array
$dbSettings array | N98\Magento\DbSettings
$isSocketConnect boolean

Открытые методы

Метод Описание
createDatabase ( Symfony\Component\Console\Output\OutputInterface $output )
detectDbSettings ( Symfony\Component\Console\Output\OutputInterface $output )
dropDatabase ( Symfony\Component\Console\Output\OutputInterface $output )
dropTables ( Symfony\Component\Console\Output\OutputInterface $output )
dsn ( ) : string Creates a PDO DSN for the adapter from $this->_config settings.
getConnection ( Symfony\Component\Console\Output\OutputInterface $output = null ) : PDO Connects to the database without initializing magento
getDbSettings ( Symfony\Component\Console\Output\OutputInterface $output = null ) : array | DbSettings
getGlobalStatus ( string | null $variable = null ) : array
getGlobalVariables ( string | null $variable = null ) : array
getIsSocketConnect ( ) : boolean
getMysqlClientToolConnectionString ( ) : string
getMysqlVariable ( string $name, string $type = null ) : string obtain mysql variable value from the database connection.
getMysqlVariableValue ( string $variable ) : boolean | array Get mysql variable value
getName ( ) : string Returns the canonical name of this helper.
getTableDefinitions ( array $commandConfig ) : array
getTables ( boolean $withoutPrefix = null ) : array Get list of database tables
getTablesStatus ( boolean $withoutPrefix = false ) : array Get list of db tables status
mysqlUserHasPrivilege ( string $privilege ) : boolean Check whether current mysql user has $privilege privilege
resolveTables ( array $list, array $definitions = [], array $resolved = [] ) : array

Приватные методы

Метод Описание
fallbackOutput ( Symfony\Component\Console\Output\OutputInterface $output = null ) : Symfony\Component\Console\Output\OutputInterface small helper method to obtain an object of type OutputInterface
getApplication ( ) : Application | Application
quoteLike ( string $string, string $escape = '=' ) : string quote a string so that it is safe to use in a LIKE
runShowCommand ( string $command, string | null $variable = null ) : array
throwRuntimeException ( PDOStatement $statement, string $message = "" ) throw a runtime exception and provide error info for the statement if available

Описание методов

createDatabase() публичный Метод

public createDatabase ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

detectDbSettings() публичный Метод

public detectDbSettings ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

dropDatabase() публичный Метод

public dropDatabase ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

dropTables() публичный Метод

public dropTables ( Symfony\Component\Console\Output\OutputInterface $output )
$output Symfony\Component\Console\Output\OutputInterface

dsn() публичный Метод

Creates a PDO DSN for the adapter from $this->_config settings.
См. также: Zend_Db_Adapter_Pdo_Abstract
public dsn ( ) : string
Результат string

getConnection() публичный Метод

Connects to the database without initializing magento
public getConnection ( Symfony\Component\Console\Output\OutputInterface $output = null ) : PDO
$output Symfony\Component\Console\Output\OutputInterface = null
Результат PDO

getDbSettings() публичный Метод

public getDbSettings ( Symfony\Component\Console\Output\OutputInterface $output = null ) : array | DbSettings
$output Symfony\Component\Console\Output\OutputInterface [optional]
Результат array | N98\Magento\DbSettings

getGlobalStatus() публичный Метод

public getGlobalStatus ( string | null $variable = null ) : array
$variable string | null [optional]
Результат array

getGlobalVariables() публичный Метод

public getGlobalVariables ( string | null $variable = null ) : array
$variable string | null [optional]
Результат array

getIsSocketConnect() публичный Метод

public getIsSocketConnect ( ) : boolean
Результат boolean

getMysqlClientToolConnectionString() публичный Метод

public getMysqlClientToolConnectionString ( ) : string
Результат string

getMysqlVariable() публичный Метод

in difference to @see getMysqlVariableValue(), this method allows to specify the type of the variable as well as to use any variable identifier even such that need quoting.
public getMysqlVariable ( string $name, string $type = null ) : string
$name string mysql variable name
$type string [optional] variable type, can be a system variable ("@@", default) or a session variable ("@").
Результат string variable value, null if variable was not defined

getMysqlVariableValue() публичный Метод

Get mysql variable value
public getMysqlVariableValue ( string $variable ) : boolean | array
$variable string
Результат boolean | array returns array on success, false on failure

getName() публичный Метод

Returns the canonical name of this helper.
public getName ( ) : string
Результат string The canonical name

getTableDefinitions() публичный Метод

public getTableDefinitions ( array $commandConfig ) : array
$commandConfig array
Результат array

getTables() публичный Метод

Get list of database tables
public getTables ( boolean $withoutPrefix = null ) : array
$withoutPrefix boolean [optional] remove prefix from the returned table names. prefix is obtained from magento database configuration. defaults to false.
Результат array

getTablesStatus() публичный Метод

Get list of db tables status
public getTablesStatus ( boolean $withoutPrefix = false ) : array
$withoutPrefix boolean
Результат array

mysqlUserHasPrivilege() публичный Метод

Check whether current mysql user has $privilege privilege
public mysqlUserHasPrivilege ( string $privilege ) : boolean
$privilege string
Результат boolean

resolveTables() публичный Метод

public resolveTables ( array $list, array $definitions = [], array $resolved = [] ) : array
$list array
$definitions array
$resolved array Which definitions where already resolved -> prevent endless loops
Результат array

Описание свойств

$_connection защищенное свойство

protected PDO $_connection
Результат PDO

$_tables защищенное свойство

protected array $_tables
Результат array

$dbSettings защищенное свойство

protected array|DbSettings,N98\Magento $dbSettings
Результат array | N98\Magento\DbSettings

$isSocketConnect защищенное свойство

Устаревший: since 1.97.9, use $dbSettings->isSocketConnect()
protected bool $isSocketConnect
Результат boolean