PHP Class VersionPress\Git\Committer

Datei anzeigen Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
__construct ( Mirror $mirror, GitRepository $repository, StorageFactory $storageFactory )
commit ( ) Checks if there is any change in the $mirror and commits it. If there was a forced change set, it takes precedence.
disableCommit ( ) All commit() calls are ignored after calling this method.
discardPostponedCommit ( string $key ) Unsets previously postponed commit.
forceChangeInfo ( TrackedChangeInfo $changeInfo ) Forces change info to be committed in the next call to commit(), overwriting whatever might have been captured by the VersionPress\Storages\Mirror.
postponeCommit ( string $key ) The commit() method will not affect the repository after calling this method.
usePostponedChangeInfos ( string $key ) Prepends previously postponedChangeInfos ChangeInfo objects to the current one.

Private Methods

Method Description
existsMaintenanceFile ( )
flushChangeLists ( )
loadPostponedChangeInfos ( ) : TrackedChangeInfo[key][]
postponeChangeInfo ( VersionPress\ChangeInfos\ChangeInfo[] $changeInfoList )
preprocessChangeInfoList ( TrackedChangeInfo[] $changeInfoList ) : TrackedChangeInfo[][] Removes some ChangeInfo objects and replaces them with another. For example, it replaces post/draft and post/publish actions with single post/create action.
savePostponedChangeInfos ( $postponedChangeInfos )
shouldCommit ( ) : boolean Returns false in the mid-step of WP update.
stageRelatedFiles ( TrackedChangeInfo | ChangeInfoEnvelope $changeInfo ) Calls Git add -A on files that are related to the given $changeInfo.

Method Details

__construct() public method

public __construct ( Mirror $mirror, GitRepository $repository, StorageFactory $storageFactory )
$mirror VersionPress\Storages\Mirror
$repository GitRepository
$storageFactory VersionPress\Storages\StorageFactory

commit() public method

Checks if there is any change in the $mirror and commits it. If there was a forced change set, it takes precedence.
public commit ( )

disableCommit() public method

All commit() calls are ignored after calling this method.
public disableCommit ( )

discardPostponedCommit() public method

Unsets previously postponed commit.
public discardPostponedCommit ( string $key )
$key string Key for postponedChangeInfos commit

forceChangeInfo() public method

There can be more forced changed infos and they behave the same as more ChangeInfos returned by the VersionPress\Storages\Mirror, i.e. are wrapped in a VersionPress\ChangeInfos\ChangeInfoEnvelope and sorted by priorities.
public forceChangeInfo ( TrackedChangeInfo $changeInfo )
$changeInfo VersionPress\ChangeInfos\TrackedChangeInfo

postponeCommit() public method

Instead it will save ChangeInfo objects for commit on the next request.
public postponeCommit ( string $key )
$key string Key for postponedChangeInfos commit

usePostponedChangeInfos() public method

Prepends previously postponedChangeInfos ChangeInfo objects to the current one.
public usePostponedChangeInfos ( string $key )
$key string Key for postponedChangeInfos commit