PHP Класс VersionPress\Git\Committer

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__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.

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

Метод Описание
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.

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

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

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

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

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() публичный Метод

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

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

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

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

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() публичный Метод

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

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

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