PHP 클래스 DNRoot

상속: extends Controller, implements PermissionProvider, implements TemplateGlobalProvider
파일 보기 프로젝트 열기: silverstripe/deploynaut 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_project_cache array
$data DNData

공개 메소드들

메소드 설명
AmbientMenu ( ) : ArrayList Get items for the ambient menu that should be accessible from all pages.
CanViewArchives ( Member $member = null ) : boolean | null Helper method to allow templates to know whether they should show the 'Archive List' include or not.
CompleteDataArchives ( ) : PaginatedList Returns a list of all archive files that can be accessed by the currently logged-in {@link Member}
CreateEnvironmentList ( ) : PaginatedList Returns a list of attempted environment creations.
DNData ( ) : DNData Get the DNData object.
DNProjectList ( ) : SS_List Provide a list of all projects.
DataTransferLogs ( ) : PaginatedList
DeployHistory ( ) : null | PaginatedList
Link ( ) : string
NavLink ( ) : string Return a link to the navigation template used for AJAX requests.
Navigation ( integer $limit = 5 ) : ArrayList Returns top level navigation of projects.
PendingDataArchives ( ) : PaginatedList
RedisUnavailable ( ) : string Returns an error message if redis is unavailable
RedisWorkersCount ( ) : integer Returns the number of connected Redis workers
UploadLimit ( ) : string Return the upload limit for snapshot uploads
abortDeploy ( SS_HTTPRequest $request ) : string
branch ( SS_HTTPRequest $request ) : SS_HTTPResponse
canCreateProjects ( $member = null ) : boolean Checks whether the user can create a project.
createenv ( SS_HTTPRequest $request ) : string Shows the creation log.
createenvlog ( SS_HTTPRequest $request )
createsnapshot ( SS_HTTPRequest $request ) : string Action
deletesnapshot ( SS_HTTPRequest $request ) : HTMLText View a form to delete a specific {@link DataArchive}.
deploy ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
deploySummary ( SS_HTTPRequest $request ) : string
deploylog ( SS_HTTPRequest $request ) : string
doCreateEnvironment ( array $data, Form $form ) : boolean | HTMLText | SS_HTTPResponse
doDataTransfer ( array $data, Form $form ) : SS_HTTPResponse
doDelete ( array $data, Form $form ) : boolean | SS_HTTPResponse
doMove ( array $data, Form $form ) : boolean | SS_HTTPResponse
doPostSnapshot ( array $data, Form $form ) : SS_HTTPResponse
doUploadSnapshot ( array $data, Form $form ) : boolean | HTMLText | SS_HTTPResponse
environment ( SS_HTTPRequest $request ) : SS_HTTPResponse
getCreateEnvironmentForm ( SS_HTTPRequest $request = null ) : Form
getCurrentActionType ( ) : string This will return a const that indicates the class of action currently being performed
getCurrentEnvironment ( DNProject $project = null ) : DNEnvironment | null
getCurrentProject ( ) : DNProject | null
getDataTransferForm ( SS_HTTPRequest $request = null ) : Form
getDataTransferRestoreForm ( SS_HTTPRequest $request, DNDataArchive $dataArchive = null ) : Form Note: Submits to the same action as {@link getDataTransferForm()}, but with a Direction=push and an archive reference.
getDeleteForm ( SS_HTTPRequest $request, DNDataArchive $dataArchive = null ) : Form
getDeployForm ( $request = null ) : Form Construct the deployment form
getMoveForm ( SS_HTTPRequest $request, DNDataArchive $dataArchive = null ) : Form | SS_HTTPResponse Build snapshot move form.
getPlatformSpecificStrings ( ) : ArrayList
getPostSnapshotForm ( SS_HTTPRequest $request ) : Form
getStarredProjects ( ) : SS_List Provide a list of all starred projects for the currently logged in member
getUploadSnapshotForm ( SS_HTTPRequest $request ) : Form Construct the upload form.
get_support_links ( ) : ArrayList
get_template_global_variables ( ) : array
gitRevisions ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
include_requirements ( ) Include requirements that deploynaut needs, such as javascript.
index ( SS_HTTPRequest $request ) : SS_HTTPResponse Actions
init ( )
movesnapshot ( SS_HTTPRequest $request ) : HTMLText View a form to move a specific {@link DataArchive}.
nav ( SS_HTTPRequest $request ) : HTMLText
postsnapshotsuccess ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
project ( SS_HTTPRequest $request ) : SS_HTTPResponse
projects ( SS_HTTPRequest $request ) : string Action
providePermissions ( ) : array
restoresnapshot ( SS_HTTPRequest $request ) : HTMLText View a form to restore a specific {@link DataArchive}.
sendResponse ( string $status, string $content ) : string
setCurrentActionType ( string $actionType ) Sets the current action type
snapshots ( SS_HTTPRequest $request ) : SS_HTTPResponse Action
snapshotslog ( SS_HTTPRequest $request ) : SS_HTTPResponse Action
startDeploy ( SS_HTTPRequest $request ) : SS_HTTPResponse Deployment form submission handler.
toggleprojectstar ( SS_HTTPRequest $request ) : SS_HTTPResponse This action will star / unstar a project for the current member
transfer ( SS_HTTPRequest $request ) : SS_HTTPResponse | string View into the log for a {@link DNDataTransfer}.
transferlog ( SS_HTTPRequest $request ) : string Action - Get the latest deploy log
uploadsnapshot ( SS_HTTPRequest $request ) : string Action

보호된 메소드들

메소드 설명
applyRedeploy ( SS_HTTPRequest $request, &$data )
environment404Response ( ) : SS_HTTPResponse
getCustomisedViewSection ( string $sectionName, string $title = '', $data = [] ) : SS_HTTPResponse
project404Response ( ) : SS_HTTPResponse
validateSnapshotMode ( string $mode ) Validate the snapshot mode

메소드 상세

AmbientMenu() 공개 메소드

Get items for the ambient menu that should be accessible from all pages.
public AmbientMenu ( ) : ArrayList
리턴 ArrayList

CanViewArchives() 공개 메소드

The actual permissions are set on a per-environment level, so we need to find out if this $member can upload to or download from *any* {@link DNEnvironment} that (s)he has access to. TODO To be replaced with a method that just returns the list of archives this {@link Member} has access to.
public CanViewArchives ( Member $member = null ) : boolean | null
$member Member The {@link Member} to check (or null to check the currently logged in Member)
리턴 boolean | null true if $member has access to upload or download to at least one {@link DNEnvironment}.

CompleteDataArchives() 공개 메소드

Returns a list of all archive files that can be accessed by the currently logged-in {@link Member}
public CompleteDataArchives ( ) : PaginatedList
리턴 PaginatedList

CreateEnvironmentList() 공개 메소드

Returns a list of attempted environment creations.
public CreateEnvironmentList ( ) : PaginatedList
리턴 PaginatedList

DNData() 공개 메소드

Get the DNData object.
public DNData ( ) : DNData
리턴 DNData

DNProjectList() 공개 메소드

Provide a list of all projects.
public DNProjectList ( ) : SS_List
리턴 SS_List

DataTransferLogs() 공개 메소드

public DataTransferLogs ( ) : PaginatedList
리턴 PaginatedList

DeployHistory() 공개 메소드

사용 중단: 2.0.0 - moved to DeployDispatcher
public DeployHistory ( ) : null | PaginatedList
리턴 null | PaginatedList

Navigation() 공개 메소드

Returns top level navigation of projects.
public Navigation ( integer $limit = 5 ) : ArrayList
$limit integer
리턴 ArrayList

PendingDataArchives() 공개 메소드

public PendingDataArchives ( ) : PaginatedList
리턴 PaginatedList The list of "pending" data archives which are waiting for a file to be delivered offline by post, and manually uploaded into the system.

RedisUnavailable() 공개 정적인 메소드

Returns an error message if redis is unavailable
public static RedisUnavailable ( ) : string
리턴 string

RedisWorkersCount() 공개 정적인 메소드

Returns the number of connected Redis workers
public static RedisWorkersCount ( ) : integer
리턴 integer

UploadLimit() 공개 메소드

Return the upload limit for snapshot uploads
public UploadLimit ( ) : string
리턴 string

abortDeploy() 공개 메소드

사용 중단: 2.0.0 - moved to DeployDispatcher
public abortDeploy ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string

applyRedeploy() 보호된 메소드

protected applyRedeploy ( SS_HTTPRequest $request, &$data )
$request SS_HTTPRequest

branch() 공개 메소드

public branch ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse

canCreateProjects() 공개 메소드

Checks whether the user can create a project.
public canCreateProjects ( $member = null ) : boolean
리턴 boolean

createenv() 공개 메소드

Shows the creation log.
public createenv ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string

createenvlog() 공개 메소드

public createenvlog ( SS_HTTPRequest $request )
$request SS_HTTPRequest

createsnapshot() 공개 메소드

Action
public createsnapshot ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string - HTML

deletesnapshot() 공개 메소드

Permission checks are handled in {@link DataArchives()}. Submissions are handled through {@link doDelete()}.
public deletesnapshot ( SS_HTTPRequest $request ) : HTMLText
$request SS_HTTPRequest
리턴 HTMLText

deploy() 공개 메소드

사용 중단: 2.0.0 - moved to DeployDispatcher Action - Do the actual deploy
public deploy ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
$request SS_HTTPRequest
리턴 SS_HTTPResponse | string

deploySummary() 공개 메소드

사용 중단: 2.0.0 - moved to DeployDispatcher
public deploySummary ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string

deploylog() 공개 메소드

사용 중단: 2.0.0 - moved to DeployDispatcher Action - Get the latest deploy log
public deploylog ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string

doCreateEnvironment() 공개 메소드

public doCreateEnvironment ( array $data, Form $form ) : boolean | HTMLText | SS_HTTPResponse
$data array
$form Form
리턴 boolean | HTMLText | SS_HTTPResponse

doDataTransfer() 공개 메소드

public doDataTransfer ( array $data, Form $form ) : SS_HTTPResponse
$data array
$form Form
리턴 SS_HTTPResponse

doDelete() 공개 메소드

public doDelete ( array $data, Form $form ) : boolean | SS_HTTPResponse
$data array
$form Form
리턴 boolean | SS_HTTPResponse

doMove() 공개 메소드

public doMove ( array $data, Form $form ) : boolean | SS_HTTPResponse
$data array
$form Form
리턴 boolean | SS_HTTPResponse

doPostSnapshot() 공개 메소드

public doPostSnapshot ( array $data, Form $form ) : SS_HTTPResponse
$data array
$form Form
리턴 SS_HTTPResponse

doUploadSnapshot() 공개 메소드

public doUploadSnapshot ( array $data, Form $form ) : boolean | HTMLText | SS_HTTPResponse
$data array
$form Form
리턴 boolean | HTMLText | SS_HTTPResponse

environment() 공개 메소드

public environment ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse

environment404Response() 보호된 메소드

protected environment404Response ( ) : SS_HTTPResponse
리턴 SS_HTTPResponse

getCreateEnvironmentForm() 공개 메소드

public getCreateEnvironmentForm ( SS_HTTPRequest $request = null ) : Form
$request SS_HTTPRequest
리턴 Form

getCurrentActionType() 공개 메소드

Until DNRoot is de-godded, it does a bunch of different actions all in the same class. So we just have each action handler calll setCurrentActionType to define what sort of action it is.
public getCurrentActionType ( ) : string
리턴 string - one of the consts from self::$action_types

getCurrentEnvironment() 공개 메소드

public getCurrentEnvironment ( DNProject $project = null ) : DNEnvironment | null
$project DNProject
리턴 DNEnvironment | null

getCurrentProject() 공개 메소드

public getCurrentProject ( ) : DNProject | null
리턴 DNProject | null

getCustomisedViewSection() 보호된 메소드

protected getCustomisedViewSection ( string $sectionName, string $title = '', $data = [] ) : SS_HTTPResponse
$sectionName string
$title string
리턴 SS_HTTPResponse

getDataTransferForm() 공개 메소드

public getDataTransferForm ( SS_HTTPRequest $request = null ) : Form
$request SS_HTTPRequest
리턴 Form

getDataTransferRestoreForm() 공개 메소드

Note: Submits to the same action as {@link getDataTransferForm()}, but with a Direction=push and an archive reference.
public getDataTransferRestoreForm ( SS_HTTPRequest $request, DNDataArchive $dataArchive = null ) : Form
$request SS_HTTPRequest
$dataArchive DNDataArchive Only set when method is called manually in {@link restore()}, otherwise the state is inferred from the request data.
리턴 Form

getDeleteForm() 공개 메소드

public getDeleteForm ( SS_HTTPRequest $request, DNDataArchive $dataArchive = null ) : Form
$request SS_HTTPRequest
$dataArchive DNDataArchive Only set when method is called manually, otherwise the state is inferred from the request data.
리턴 Form

getDeployForm() 공개 메소드

Construct the deployment form
사용 중단: 2.0.0 - moved to DeployDispatcher
public getDeployForm ( $request = null ) : Form
리턴 Form

getMoveForm() 공개 메소드

Build snapshot move form.
public getMoveForm ( SS_HTTPRequest $request, DNDataArchive $dataArchive = null ) : Form | SS_HTTPResponse
$request SS_HTTPRequest
$dataArchive DNDataArchive
리턴 Form | SS_HTTPResponse

getPlatformSpecificStrings() 공개 메소드

public getPlatformSpecificStrings ( ) : ArrayList
리턴 ArrayList

getPostSnapshotForm() 공개 메소드

public getPostSnapshotForm ( SS_HTTPRequest $request ) : Form
$request SS_HTTPRequest
리턴 Form

getStarredProjects() 공개 메소드

Provide a list of all starred projects for the currently logged in member
public getStarredProjects ( ) : SS_List
리턴 SS_List

getUploadSnapshotForm() 공개 메소드

Construct the upload form.
public getUploadSnapshotForm ( SS_HTTPRequest $request ) : Form
$request SS_HTTPRequest
리턴 Form

get_template_global_variables() 공개 정적인 메소드

public static get_template_global_variables ( ) : array
리턴 array

gitRevisions() 공개 메소드

사용 중단: 2.0.0 - moved to GitDispatcher
public gitRevisions ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
$request SS_HTTPRequest
리턴 SS_HTTPResponse | string

include_requirements() 공개 정적인 메소드

Include requirements that deploynaut needs, such as javascript.
public static include_requirements ( )

index() 공개 메소드

Actions
public index ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse

init() 공개 메소드

public init ( )

movesnapshot() 공개 메소드

View a form to move a specific {@link DataArchive}.
public movesnapshot ( SS_HTTPRequest $request ) : HTMLText
$request SS_HTTPRequest
리턴 HTMLText

nav() 공개 메소드

public nav ( SS_HTTPRequest $request ) : HTMLText
$request SS_HTTPRequest
리턴 HTMLText

postsnapshotsuccess() 공개 메소드

public postsnapshotsuccess ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
$request SS_HTTPRequest
리턴 SS_HTTPResponse | string

project() 공개 메소드

public project ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse

project404Response() 보호된 메소드

protected project404Response ( ) : SS_HTTPResponse
리턴 SS_HTTPResponse

projects() 공개 메소드

Action
public projects ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string - HTML

providePermissions() 공개 메소드

public providePermissions ( ) : array
리턴 array

restoresnapshot() 공개 메소드

Permission checks are handled in {@link DataArchives()}. Submissions are handled through {@link doDataTransfer()}, same as backup operations.
public restoresnapshot ( SS_HTTPRequest $request ) : HTMLText
$request SS_HTTPRequest
리턴 HTMLText

sendResponse() 공개 메소드

public sendResponse ( string $status, string $content ) : string
$status string
$content string
리턴 string

setCurrentActionType() 공개 메소드

Sets the current action type
public setCurrentActionType ( string $actionType )
$actionType string string - one of the consts from self::$action_types

snapshots() 공개 메소드

Action
public snapshots ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse - HTML

snapshotslog() 공개 메소드

Action
public snapshotslog ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse - HTML

startDeploy() 공개 메소드

Deployment form submission handler.
사용 중단: 2.0.0 - moved to DeployDispatcher Initiate a DNDeployment record and redirect to it for status polling
public startDeploy ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse

toggleprojectstar() 공개 메소드

This action will star / unstar a project for the current member
public toggleprojectstar ( SS_HTTPRequest $request ) : SS_HTTPResponse
$request SS_HTTPRequest
리턴 SS_HTTPResponse

transfer() 공개 메소드

View into the log for a {@link DNDataTransfer}.
public transfer ( SS_HTTPRequest $request ) : SS_HTTPResponse | string
$request SS_HTTPRequest
리턴 SS_HTTPResponse | string

transferlog() 공개 메소드

Action - Get the latest deploy log
public transferlog ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string

uploadsnapshot() 공개 메소드

Action
public uploadsnapshot ( SS_HTTPRequest $request ) : string
$request SS_HTTPRequest
리턴 string - HTML

validateSnapshotMode() 보호된 메소드

Validate the snapshot mode
protected validateSnapshotMode ( string $mode )
$mode string

프로퍼티 상세

$_project_cache 보호되어 있는 정적으로 프로퍼티

protected static array $_project_cache
리턴 array

$data 보호되어 있는 프로퍼티

protected DNData $data
리턴 DNData