PHP Class VersionPress\Initialization\Initializer

Tip: to quickly test "undo" initialization for rapid testing, use wp vp-automate start-over command, see VpAutomateCommand.
See also: VpAutomateCommand::startOver
Datei anzeigen Open project: versionpress/versionpress

Public Properties

Property Type Description
$onProgressChanged callable[] Array of functions to call when the progress changes. Implements part of the Observer pattern.

Public Methods

Method Description
__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

Private Methods

Method Description
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 ( )

Method Details

__construct() public method

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() public method

initializeVersionPress() public method

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

Property Details

$onProgressChanged public_oe property

Array of functions to call when the progress changes. Implements part of the Observer pattern.
public callable[] $onProgressChanged
return callable[]