PHP 클래스 VersionPress\Api\VersionPressApi

파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( GitRepository $gitRepository, Reverter $reverter, SynchronizationProcess $synchronizationProcess, CommitMessageParser $commitMessageParser )
canRevert ( ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
checkPermissions ( WP_REST_Request $request ) : WP_Erro\WP_Error | boolean
commit ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error Creates manual commit. Adds everything to stage.
discardChanges ( ) : WP_REST_Response Discards all changes in working directory.
displayWelcomePanel ( ) : WP_REST_Response
getAutocompleteConfig ( ) : WP_REST_Response Returns current WP configuration for autocomplete component.
getCommits ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
getDiff ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error Returns diff of given commit.
getError ( string $status ) : WP_Error
getGitStatus ( ) : WP_REST_Response Returns list of files with modification types.
hideWelcomePanel ( ) : WP_REST_Response
registerRoutes ( ) Register the VersionPress related routes
revertCommits ( string $reverterMethod, array $commits ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
rollbackToCommit ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
shouldUpdate ( WP_REST_Request $request )
undoCommits ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

비공개 메소드들

메소드 설명
convertChangeInfo ( $changeInfo )
convertChangeInfoList ( $getChangeInfoList )
getFileChanges ( Commit $commit, boolean $skipVpdbFiles ) : array
getInitialCommitHash ( ) : string
handleAsAdminSectionRoute ( string $routeHandler ) : Closure Adds WP_ADMIN constant before route handling function is called. Routes calls are than evaluated as called in admin section of WordPress even if the routes are called using AJAX (WordPress native function is_admin() evaluates call correctly.
handleErrorOutput ( callable | string $routeHandler ) : Closure Prevents unexpected output from displaying to output, adds it to the response json instead.
registerRestRoute ( $route, $args = [], $override = false )
updateDatabase ( $status )

메소드 상세

__construct() 공개 메소드

public __construct ( GitRepository $gitRepository, Reverter $reverter, SynchronizationProcess $synchronizationProcess, CommitMessageParser $commitMessageParser )
$gitRepository VersionPress\Git\GitRepository
$reverter VersionPress\Git\Reverter
$synchronizationProcess VersionPress\Synchronizers\SynchronizationProcess
$commitMessageParser VersionPress\ChangeInfos\CommitMessageParser

canRevert() 공개 메소드

public canRevert ( ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

checkPermissions() 공개 메소드

public checkPermissions ( WP_REST_Request $request ) : WP_Erro\WP_Error | boolean
$request WP_REST_Request
리턴 WP_Erro\WP_Error | boolean

commit() 공개 메소드

Creates manual commit. Adds everything to stage.
public commit ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
$request WP_REST_Request
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

discardChanges() 공개 메소드

Discards all changes in working directory.
public discardChanges ( ) : WP_REST_Response
리턴 WP_REST_Response

displayWelcomePanel() 공개 메소드

public displayWelcomePanel ( ) : WP_REST_Response
리턴 WP_REST_Response

getAutocompleteConfig() 공개 메소드

Returns current WP configuration for autocomplete component.
public getAutocompleteConfig ( ) : WP_REST_Response
리턴 WP_REST_Response

getCommits() 공개 메소드

public getCommits ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
$request WP_REST_Request
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

getDiff() 공개 메소드

If there's provided no commit hash, returns diff of working directory and HEAD.
public getDiff ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
$request WP_REST_Request
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

getError() 공개 메소드

public getError ( string $status ) : WP_Error
$status string
리턴 WP_Error

getGitStatus() 공개 메소드

Example: [ ["A", "some-file.txt"], ["M", "other-file.txt"] ] Modification types: ?? - untracked file A - added file M - modified file D - deleted file
public getGitStatus ( ) : WP_REST_Response
리턴 WP_REST_Response

hideWelcomePanel() 공개 메소드

public hideWelcomePanel ( ) : WP_REST_Response
리턴 WP_REST_Response

registerRoutes() 공개 메소드

Register the VersionPress related routes
public registerRoutes ( )

revertCommits() 공개 메소드

public revertCommits ( string $reverterMethod, array $commits ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
$reverterMethod string
$commits array
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

rollbackToCommit() 공개 메소드

public rollbackToCommit ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
$request WP_REST_Request
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error

shouldUpdate() 공개 메소드

public shouldUpdate ( WP_REST_Request $request )
$request WP_REST_Request

undoCommits() 공개 메소드

public undoCommits ( WP_REST_Request $request ) : WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error
$request WP_REST_Request
리턴 WP_REST_Respons\WP_REST_Response | WP_Erro\WP_Error