PHP 클래스 N98\Util\Console\Helper\DatabaseHelper

상속: extends Symfony\Component\Console\Helper\Helper
파일 보기 프로젝트 열기: netz98/n98-magerun 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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() 공개 메소드

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