PHP Класс DNRoot

Наследование: extends Controller, implements PermissionProvider, implements TemplateGlobalProvider
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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