PHP Класс VersionPress\Initialization\Initializer

Tip: to quickly test "undo" initialization for rapid testing, use wp vp-automate start-over command, see VpAutomateCommand.
См. также: VpAutomateCommand::startOver
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$onProgressChanged callable[] Array of functions to call when the progress changes. Implements part of the Observer pattern.

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

Метод Описание
__construct ( $database, DbSchemaInfo $dbSchema, StorageFactory $storageFactory, SynchronizerFactory $synchronizerFactory, GitRepository $repository, AbsoluteUrlReplacer $urlReplacer, VpidRepository $vpidRepository, ShortcodesReplacer $shortcodesReplacer, ChangeInfoFactory $changeInfoFactory, ActionsDefinitionRepository $actionsDefinitionRepository )
createVersionPressTables ( )
initializeVersionPress ( boolean $isUpdate = false ) Main entry point

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

Метод Описание
abortInitialization ( )
activateVersionPress ( )
adjustGitProcessTimeout ( )
checkTimeout ( )
commitDatabase ( ) Commits db changes if database has been locked
copyAccessRulesFiles ( ) Copies the .htaccess and web.config files into the vpdb directory.
createCommonConfig ( )
createGitRepository ( )
createVpidsForEntitiesOfType ( string $entityName ) If entity type identified by $entityName defines an ID column, creates a mapping between WordPress ID and VPID for all entities (db rows) of such type.
doInitializationCommit ( $isUpdate )
extendEntitiesWithVpids ( $entityName, $entities )
getEntitiesFromDatabase ( $entityName ) : mixed
installComposerScripts ( )
installGitignore ( ) Installs Gitignore to the repository root, or does nothing if the file already exists.
lockDatabase ( )
persistActionsDefinitions ( )
replaceForeignKeysWithReferencesInAllEntities ( $entityName, $entities )
replaceShortcodesInAllEntities ( $entityName, $entities )
reportProgressChange ( string $message ) Calls the registered onProgressChanged functions with the progress $message
rollbackDatabase ( ) Rolls back database if it was locked by lockDatabase() and an unexpected shutdown occurred.
saveDatabaseToStorages ( ) Saves all eligible entities into the file system storage (the 'db' folder)
saveEntitiesOfTypeToStorage ( string $entityName ) Saves entities of type identified by $entityName to their appropriate storage (chosen by factory).
saveMetaEntities ( Storage $storage, $entities, $parentReference )
saveMnReferences ( $referenceDetails )
saveStandardEntities ( Storage $storage, $entities )
timeoutIsClose ( )
tryToUseIdsFromDatabase ( )

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

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

public __construct ( $database, DbSchemaInfo $dbSchema, StorageFactory $storageFactory, SynchronizerFactory $synchronizerFactory, GitRepository $repository, AbsoluteUrlReplacer $urlReplacer, VpidRepository $vpidRepository, ShortcodesReplacer $shortcodesReplacer, ChangeInfoFactory $changeInfoFactory, ActionsDefinitionRepository $actionsDefinitionRepository )
$dbSchema VersionPress\Database\DbSchemaInfo
$storageFactory VersionPress\Storages\StorageFactory
$synchronizerFactory VersionPress\Synchronizers\SynchronizerFactory
$repository VersionPress\Git\GitRepository
$urlReplacer VersionPress\Utils\AbsoluteUrlReplacer
$vpidRepository VersionPress\Database\VpidRepository
$shortcodesReplacer VersionPress\Database\ShortcodesReplacer
$changeInfoFactory VersionPress\ChangeInfos\ChangeInfoFactory
$actionsDefinitionRepository VersionPress\Actions\ActionsDefinitionRepository

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

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

Main entry point
public initializeVersionPress ( boolean $isUpdate = false )
$isUpdate boolean Initializer creates `versionpress/update` action if is set to true

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

$onProgressChanged публичное свойство

Array of functions to call when the progress changes. Implements part of the Observer pattern.
public callable[] $onProgressChanged
Результат callable[]