PHP 클래스 Neos\Flow\Command\DatabaseCommandController

상속: extends Neos\Flow\Cli\CommandController
파일 보기 프로젝트 열기: neos/flow-development-collection

보호된 프로퍼티들

프로퍼티 타입 설명
$connection Doctrine\DBAL\Connection
$persistenceSettings array

공개 메소드들

메소드 설명
setCharsetCommand ( string $characterSet = 'utf8', string $collation = 'utf8_unicode_ci', string $output = null, boolean $verbose = false ) Convert the database schema to use the given character set and collation (defaults to utf8 and utf8_unicode_ci).

보호된 메소드들

메소드 설명
convertToCharacterSetAndCollation ( string $characterSet = 'utf8', string $collation = 'utf8_unicode_ci', string $outputPathAndFilename = null, boolean $verbose = false ) Convert the tables in the current database to use given character set and collation.
initializeConnection ( ) : void Create a Doctrine DBAL Connection with the configured settings.

메소드 상세

convertToCharacterSetAndCollation() 보호된 메소드

Convert the tables in the current database to use given character set and collation.
protected convertToCharacterSetAndCollation ( string $characterSet = 'utf8', string $collation = 'utf8_unicode_ci', string $outputPathAndFilename = null, boolean $verbose = false )
$characterSet string Character set to convert to
$collation string Collation to set, must be compatible with the character set
$outputPathAndFilename string
$verbose boolean

initializeConnection() 보호된 메소드

Create a Doctrine DBAL Connection with the configured settings.
protected initializeConnection ( ) : void
리턴 void

setCharsetCommand() 공개 메소드

This command can be used to convert the database configured in the Flow settings to the utf8 character set and the utf8_unicode_ci collation (by default, a custom collation can be given). It will only work when using the pdo_mysql driver. Make a backup before using it, to be on the safe side. If you want to inspect the statements used for conversion, you can use the $output parameter to write them into a file. This file can be used to do the conversion manually. For background information on this, see: - http://stackoverflow.com/questions/766809/ - http://dev.mysql.com/doc/refman/5.5/en/alter-table.html The main purpose of this is to fix setups that were created with Flow 2.3.x or earlier and whose database server did not have a default collation of utf8_unicode_ci. In those cases, the tables will have a collation that does not match the default collation of later Flow versions, potentially leading to problems when creating foreign key constraints (among others, potentially). If you have special needs regarding the charset and collation, you can override the defaults with different ones. One thing this might be useful for is when switching to the utf8mb4 character set, see: - https://mathiasbynens.be/notes/mysql-utf8mb4 - https://florian.ec/articles/mysql-doctrine-utf8/ Note: This command is not a general purpose conversion tool. It will specifically not fix cases of actual utf8 stored in latin1 columns. For this a conversion to BLOB followed by a conversion to the proper type, charset and collation is needed instead.
public setCharsetCommand ( string $characterSet = 'utf8', string $collation = 'utf8_unicode_ci', string $output = null, boolean $verbose = false )
$characterSet string Character set, defaults to utf8
$collation string Collation to use, defaults to utf8_unicode_ci
$output string A file to write SQL to, instead of executing it
$verbose boolean If set, the statements will be shown as they are executed

프로퍼티 상세

$connection 보호되어 있는 프로퍼티

protected Connection,Doctrine\DBAL $connection
리턴 Doctrine\DBAL\Connection

$persistenceSettings 보호되어 있는 프로퍼티

protected array $persistenceSettings
리턴 array