PHP Class eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand

Inheritance: extends Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
Afficher le fichier Open project: ezsystems/ezpublish-kernel

Protected Properties

Свойство Type Description
$actionSet
$bulkCount integer
$connection Doctrine\DBAL\Connection
$contentService eZ\Publish\API\Repository\ContentService
$nameSchemaResolver eZ\Publish\Core\Repository\Helper\NameSchemaService
$output Symfony\Component\Console\Output\OutputInterface
$urlAliasGateway eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway
$urlAliasHandler eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler

Méthodes protégées

Méthode Description
backupCustomLocationAliases ( ) Backups custom Location URL aliases the custom URL alias backup table.
backupGlobalAliases ( ) Backups global URL aliases the custom URL alias backup table.
checkStorage ( ) Checks that configured storage engine is Legacy Storage Engine.
combinePaths ( array $pathData ) : string[] Combines path data to an array of URL alias paths.
configure ( )
createCustomLocationUrlAliasBackupTable ( ) Creates database table for custom Location URL alias backup.
createGlobalUrlAliasBackupTable ( ) Creates database table for custom URL alias backup.
doBackupCustomLocationAliases ( ) Internal method for backing up custom Location URL aliases.
doBackupGlobalAliases ( ) Internal method for backing up global URL aliases.
doGenerateLocationAliases ( ) Internal method for generating URL aliases.
doRestoreCustomLocationAliases ( ) Restores custom Location URL aliases from the backup table.
doRestoreGlobalAliases ( ) Restores global URL aliases from the backup table.
execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
extractPathElements ( array $levelData ) : string[] Returns all path element strings found for the given path $levelData.
generateLocationAliases ( ) Generates URL aliases from the Location and Content data to the migration table.
getProgressBar ( integer $maxSteps ) : ProgressBar Returns configured progress bar helper.
getTotalBackupCount ( string $table ) : integer Return the number of rows in the given $table (on ID column).
getTotalLocationContentCount ( ) Returns total number of Content objects having a Location in the database.
getTotalLocationCount ( ) Returns total number of Locations in the database.
initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
isTableEmpty ( string $name ) : boolean Checks if database table $name is empty.
loadLocationData ( Doctrine\DBAL\Query\QueryBuilder $queryBuilder, integer $pass ) : array Loads Location data for the given $pass.
loadPassData ( Doctrine\DBAL\Query\QueryBuilder $queryBuilder, integer $pass ) : array Loads Location data for the given $pass.
publishAliases ( integer | string $locationId, integer | string $parentLocationId, integer | string $contentId ) : integer Publishes URL aliases in all languages for the given parameters.
restoreCustomLocationAliases ( ) Restores custom Location URL aliases from the backup table.
restoreGlobalAliases ( ) Restores global URL aliases from the backup table.
setDefaultTable ( ) Sets storage gateway to the default table.
setMigrationTable ( ) Sets storage gateway to the migration table.
storeCustomAliasPath ( integer $locationId, string $path, string $languageCode, boolean $alwaysAvailable, boolean $forwarding ) Stores custom URL alias data for $path to the backup table.
storeCustomAliases ( array $aliases ) : integer Stores given custom $aliases to the custom alias backup table.
storeGlobalAlias ( eZ\Publish\SPI\Persistence\Content\UrlAlias $alias ) : integer Stores given global URL $alias to the global URL alias backup table.
storeGlobalAliasPath ( string $resource, string $path, string $languageCode, boolean $alwaysAvailable, boolean $forwarding ) Stores global URL alias data for $path to the backup table.
tableExists ( string $name ) : boolean Checks if database table $name exists.

Method Details

backupCustomLocationAliases() protected méthode

Backups custom Location URL aliases the custom URL alias backup table.

backupGlobalAliases() protected méthode

Backups global URL aliases the custom URL alias backup table.
protected backupGlobalAliases ( )

checkStorage() protected méthode

Checks that configured storage engine is Legacy Storage Engine.
protected checkStorage ( )

combinePaths() protected méthode

Explanation: Custom Location and global URL aliases can generate NOP entries, which can be taken over by the autogenerated aliases. When multiple languages exists for the Location that took over, multiple entries with the same link will exist on the same level. In that case it will not be possible to reliably reconstruct what was the path for the original custom alias. For that reason we combine path data to get all possible path combinations. Note: it could happen that original NOP entry was historized after being taken over by the autogenerated alias. So to be complete this would have to take into account history entries as well, but at the moment we lack API to do that. Proper solution of this problem would be introducing separate database table to store custom/global URL alias data.
See also: https://jira.ez.no/browse/EZP-20777
protected combinePaths ( array $pathData ) : string[]
$pathData array
Résultat string[]

configure() protected méthode

protected configure ( )

createCustomLocationUrlAliasBackupTable() protected méthode

Creates database table for custom Location URL alias backup.

createGlobalUrlAliasBackupTable() protected méthode

Creates database table for custom URL alias backup.

doBackupCustomLocationAliases() protected méthode

Internal method for backing up custom Location URL aliases.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::backupCustomLocationAliases()

doBackupGlobalAliases() protected méthode

Internal method for backing up global URL aliases.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::backupGlobalAliases()
protected doBackupGlobalAliases ( )

doGenerateLocationAliases() protected méthode

Internal method for generating URL aliases.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::generateLocationAliases()

doRestoreCustomLocationAliases() protected méthode

Restores custom Location URL aliases from the backup table.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::restoreCustomLocationAliases()

doRestoreGlobalAliases() protected méthode

Restores global URL aliases from the backup table.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::restoreGlobalAliases()
protected doRestoreGlobalAliases ( )

execute() protected méthode

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

extractPathElements() protected méthode

Returns all path element strings found for the given path $levelData.
protected extractPathElements ( array $levelData ) : string[]
$levelData array
Résultat string[]

generateLocationAliases() protected méthode

Generates URL aliases from the Location and Content data to the migration table.
protected generateLocationAliases ( )

getProgressBar() protected méthode

Returns configured progress bar helper.
protected getProgressBar ( integer $maxSteps ) : ProgressBar
$maxSteps integer
Résultat Symfony\Component\Console\Helper\ProgressBar

getTotalBackupCount() protected méthode

Return the number of rows in the given $table (on ID column).
protected getTotalBackupCount ( string $table ) : integer
$table string
Résultat integer

getTotalLocationContentCount() protected méthode

The number excludes absolute root Location, which does not have an URL alias.

getTotalLocationCount() protected méthode

The number excludes absolute root Location, which does not have an URL alias.
protected getTotalLocationCount ( )

initialize() protected méthode

protected initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

isTableEmpty() protected méthode

Checks if database table $name is empty.
protected isTableEmpty ( string $name ) : boolean
$name string
Résultat boolean

loadLocationData() protected méthode

Loads Location data for the given $pass.
protected loadLocationData ( Doctrine\DBAL\Query\QueryBuilder $queryBuilder, integer $pass ) : array
$queryBuilder Doctrine\DBAL\Query\QueryBuilder
$pass integer
Résultat array

loadPassData() protected méthode

Loads Location data for the given $pass.
protected loadPassData ( Doctrine\DBAL\Query\QueryBuilder $queryBuilder, integer $pass ) : array
$queryBuilder Doctrine\DBAL\Query\QueryBuilder
$pass integer
Résultat array

publishAliases() protected méthode

Publishes URL aliases in all languages for the given parameters.
protected publishAliases ( integer | string $locationId, integer | string $parentLocationId, integer | string $contentId ) : integer
$locationId integer | string
$parentLocationId integer | string
$contentId integer | string
Résultat integer

restoreCustomLocationAliases() protected méthode

Restores custom Location URL aliases from the backup table.

restoreGlobalAliases() protected méthode

Restores global URL aliases from the backup table.
protected restoreGlobalAliases ( )

setDefaultTable() protected méthode

Sets storage gateway to the default table.
See also: eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway::TABLE
protected setDefaultTable ( )

setMigrationTable() protected méthode

Sets storage gateway to the migration table.
See also: eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\RegenerateUrlAliasesCommand::MIGRATION_TABLE
protected setMigrationTable ( )

storeCustomAliasPath() protected méthode

Stores custom URL alias data for $path to the backup table.
protected storeCustomAliasPath ( integer $locationId, string $path, string $languageCode, boolean $alwaysAvailable, boolean $forwarding )
$locationId integer
$path string
$languageCode string
$alwaysAvailable boolean
$forwarding boolean

storeCustomAliases() protected méthode

Stores given custom $aliases to the custom alias backup table.
protected storeCustomAliases ( array $aliases ) : integer
$aliases array
Résultat integer

storeGlobalAlias() protected méthode

Stores given global URL $alias to the global URL alias backup table.
protected storeGlobalAlias ( eZ\Publish\SPI\Persistence\Content\UrlAlias $alias ) : integer
$alias eZ\Publish\SPI\Persistence\Content\UrlAlias
Résultat integer

storeGlobalAliasPath() protected méthode

Stores global URL alias data for $path to the backup table.
protected storeGlobalAliasPath ( string $resource, string $path, string $languageCode, boolean $alwaysAvailable, boolean $forwarding )
$resource string
$path string
$languageCode string
$alwaysAvailable boolean
$forwarding boolean

tableExists() protected méthode

Checks if database table $name exists.
protected tableExists ( string $name ) : boolean
$name string
Résultat boolean

Property Details

$actionSet protected_oe property

protected $actionSet

$bulkCount protected_oe property

protected int $bulkCount
Résultat integer

$connection protected_oe property

protected Connection,Doctrine\DBAL $connection
Résultat Doctrine\DBAL\Connection

$contentService protected_oe property

protected ContentService,eZ\Publish\API\Repository $contentService
Résultat eZ\Publish\API\Repository\ContentService

$nameSchemaResolver protected_oe property

protected NameSchemaService,eZ\Publish\Core\Repository\Helper $nameSchemaResolver
Résultat eZ\Publish\Core\Repository\Helper\NameSchemaService

$output protected_oe property

protected OutputInterface,Symfony\Component\Console\Output $output
Résultat Symfony\Component\Console\Output\OutputInterface

$urlAliasGateway protected_oe property

protected Gateway,eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias $urlAliasGateway
Résultat eZ\Publish\Core\Persistence\Legacy\Content\UrlAlias\Gateway

$urlAliasHandler protected_oe property

protected Handler,eZ\Publish\SPI\Persistence\Content\UrlAlias $urlAliasHandler
Résultat eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler