PHP Класс Neos\Flow\Command\DatabaseCommandController

Наследование: extends Neos\Flow\Cli\CommandController
Показать файл Открыть проект

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

Свойство Тип Описание
$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