PHP Class VersionPress\ChangeInfos\TrackedChangeInfo

VP-Action: post/edit/VPID123 Specific subclasses optionally add their own tags.
See also: CommitMessage::getVersionPressTags()
See also: UntrackedChangeInfo Changes created outside of VersionPress.
Inheritance: implements VersionPress\ChangeInfos\ChangeInfo
Mostra file Open project: versionpress/versionpress Class Usage Examples

Public Methods

Method Description
__construct ( $scope, $actionsInfo, $action, $id, $customTags = [], $customFiles = [] )
getAction ( ) : string The action done on the object type, for instance "install" or "activate" if the object was a plugin.
getChangeDescription ( ) : string Text displayed in the main VersionPress table (see admin/index.php). Also used to construct commit message subject (first line) when the commit is first physically created.
getChangedFiles ( ) : array Reports changes in files that relate to this ChangeInfo. Used by {@see Committer::stageRelatedFiles()}.
getCommitMessage ( )
getCustomTags ( ) : array Used to construct a commit message body, subclasses provide an array of VP tags using this method. If they don't need custom tags, they return an empty array.
getId ( )
getPriority ( )
getScope ( ) : string Object type, the first part of the VP-Action tag value.

Protected Methods

Method Description
getActionTagValue ( ) : string Used to construct a commit message body, subclasses provide a string for the VP-Action tag value using this method.

Private Methods

Method Description
getCommitMessageBody ( ) : string Constructs commit message body, which is typically a couple of lines of VP tags.

Method Details

__construct() public method

public __construct ( $scope, $actionsInfo, $action, $id, $customTags = [], $customFiles = [] )

getAction() public method

Action is always part of VP-Action tag as the second segment.
public getAction ( ) : string
return string

getActionTagValue() protected method

Used to construct a commit message body, subclasses provide a string for the VP-Action tag value using this method.
See also: getCommitMessageBody()
protected getActionTagValue ( ) : string
return string

getChangeDescription() public method

Text displayed in the main VersionPress table (see admin/index.php). Also used to construct commit message subject (first line) when the commit is first physically created.
public getChangeDescription ( ) : string
return string

getChangedFiles() public method

Path specifications are either pointers to storage files based on entity name and VPID or a concrete path (optionally with wildcards). An example: [ ['type' => 'storage-file', 'entity' => 'post', 'id' => VPID, 'parent-id' => null], ['type' => 'storage-file', 'entity' => 'usermeta', 'id' => VPID, 'parent-id' => user-VPID], ['type' => 'all-storage-files', 'entity' => 'option'], ['type' => 'path', 'path' => '/var/www/wp/example.txt'], ['type' => 'path', 'path' => '/var/www/wp/folder/*'] ]
public getChangedFiles ( ) : array
return array

getCommitMessage() public method

public getCommitMessage ( )

getCustomTags() public method

Used to construct a commit message body, subclasses provide an array of VP tags using this method. If they don't need custom tags, they return an empty array.
See also: getCommitMessageBody()
public getCustomTags ( ) : array
return array

getId() public method

public getId ( )

getPriority() public method

public getPriority ( )

getScope() public method

For example, when objectType is "post", the VP-Action tag will be something like "post/edit/VPID123".
public getScope ( ) : string
return string