PHP Class Pantheon\Terminus\Models\Environment

Inheritance: extends TerminusModel, implements Robo\Contract\ConfigAwareInterface, implements League\Container\ContainerAwareInterface, use trait League\Container\ContainerAwareTrait, use trait Robo\Common\ConfigAwareTrait
Afficher le fichier Open project: pantheon-systems/terminus Class Usage Examples

Méthodes publiques

Свойство Type Description
$backups Pantheon\Terminus\Collections\Backups
$bindings Pantheon\Terminus\Collections\Bindings
$commits Pantheon\Terminus\Collections\Commits
$domains Pantheon\Terminus\Collections\Domains
$site Site
$workflows Pantheon\Terminus\Collections\Workflows

Protected Properties

Свойство Type Description
$lock Lock

Méthodes publiques

Méthode Description
__construct ( object $attributes, array $options = [] ) Object constructor
applyUpstreamUpdates ( boolean $updatedb = true, boolean $xoption = false ) : Workflow Apply upstream updates
cacheserverConnectionInfo ( ) : array Gives cacheserver connection info for this environment
changeConnectionMode ( string $value ) : Workflow | string Changes connection mode
clearCache ( ) : Workflow Clears an environment's cache
cloneDatabase ( string $from_env ) : Workflow Clones database from this environment to another
cloneFiles ( string $from_env ) : Workflow Clones files from this environment to another
commitChanges ( string $commit = null ) : array Commits changes to code
connectionInfo ( ) : array Gives connection info for this environment
convergeBindings ( ) : array Converges all bindings on a site
countDeployableCommits ( ) : integer Counts the number of deployable commits
dashboardUrl ( ) : string Provides Pantheon Dashboard URL for this environment
databaseConnectionInfo ( ) : array Gives database connection info for this environment
delete ( array $arg_options = [] ) : Workflow Delete a multidev environment
deploy ( array $params ) : Workflow Deploys the Test or Live environment
diffstat ( ) : array Gets diff from multidev environment
disableHttpsCertificate ( ) : array Remove a HTTPS certificate from the environment
domain ( ) : string Generate environment URL
getBackups ( ) : Backups
getBindings ( ) : Bindings
getCommits ( ) : Commits
getDomains ( ) : Domains
getDrushVersion ( ) : integer Gets the Drush version of this environment
getLock ( ) : Lock Returns the lock object associated with this environment
getName ( ) : string Returns the environment's name
getParentEnvironment ( ) : Environment Returns the parent environment
getSite ( ) : Site
getWorkflows ( ) : Workflows
gitConnectionInfo ( ) : array Gives Git connection info for this environment
hasDeployableCode ( ) : boolean Decides if the environment has changes to deploy
import ( string $url ) : Workflow Imports a site archive onto Pantheon
importDatabase ( string $url ) : Workflow Imports a database archive
importFiles ( string $url ) : Workflow Imports a file archive
initializeBindings ( ) : Workflow Initializes the test/live environments on a newly created site and clones content from previous environment (e.g. test clones dev content, live clones test content.)
isInitialized ( ) : boolean Have the environment's bindings have been initialized?
isMultidev ( ) : boolean Is this branch a multidev environment?
mergeFromDev ( array $options = [] ) : Workflow Merge code from the Dev Environment into this Multidev Environment
mergeToDev ( array $options = [] ) : Workflow Merge code from a multidev environment into the dev environment
sendCommandViaSsh ( string $command ) : string[] Sends a command to an environment via SSH.
serialize ( ) : array Formats environment object into an associative array for output
setHttpsCertificate ( array $certificate = [] ) Add/replace an HTTPS certificate on the environment
sftpConnectionInfo ( ) : array Gives SFTP connection info for this environment
wake ( ) : array "Wake" a site
wipe ( ) : Workflow Deletes all content (files and database) from the Environment

Méthodes protégées

Méthode Description
parseAttributes ( object $data ) : object Modify response data between fetch and assignment

Private Methods

Méthode Description
settings ( string $setting = null ) : mixed Retrieves the value of an environmental setting

Method Details

__construct() public méthode

Object constructor
public __construct ( object $attributes, array $options = [] )
$attributes object Attributes of this model
$options array Options with which to configure this model

applyUpstreamUpdates() public méthode

Apply upstream updates
public applyUpstreamUpdates ( boolean $updatedb = true, boolean $xoption = false ) : Workflow
$updatedb boolean True to run update.php
$xoption boolean True to automatically resolve merge conflicts
Résultat Workflow

cacheserverConnectionInfo() public méthode

Gives cacheserver connection info for this environment
public cacheserverConnectionInfo ( ) : array
Résultat array

changeConnectionMode() public méthode

Changes connection mode
public changeConnectionMode ( string $value ) : Workflow | string
$value string Connection mode, "git" or "sftp"
Résultat Workflow | string

clearCache() public méthode

Clears an environment's cache
public clearCache ( ) : Workflow
Résultat Workflow

cloneDatabase() public méthode

Clones database from this environment to another
public cloneDatabase ( string $from_env ) : Workflow
$from_env string Name of the environment to clone
Résultat Workflow

cloneFiles() public méthode

Clones files from this environment to another
public cloneFiles ( string $from_env ) : Workflow
$from_env string Name of the environment to clone
Résultat Workflow

commitChanges() public méthode

Commits changes to code
public commitChanges ( string $commit = null ) : array
$commit string Should be the commit message to use if committing on server changes
Résultat array Response data

connectionInfo() public méthode

Gives connection info for this environment
public connectionInfo ( ) : array
Résultat array

convergeBindings() public méthode

Converges all bindings on a site
public convergeBindings ( ) : array
Résultat array

countDeployableCommits() public méthode

Counts the number of deployable commits
public countDeployableCommits ( ) : integer
Résultat integer

dashboardUrl() public méthode

Provides Pantheon Dashboard URL for this environment
public dashboardUrl ( ) : string
Résultat string

databaseConnectionInfo() public méthode

Gives database connection info for this environment
public databaseConnectionInfo ( ) : array
Résultat array

delete() public méthode

Delete a multidev environment
public delete ( array $arg_options = [] ) : Workflow
$arg_options array Elements as follow: bool delete_branch True to delete branch
Résultat Workflow

deploy() public méthode

Deploys the Test or Live environment
public deploy ( array $params ) : Workflow
$params array Parameters for the deploy workflow
Résultat Workflow

diffstat() public méthode

Gets diff from multidev environment
public diffstat ( ) : array
Résultat array

disableHttpsCertificate() public méthode

Remove a HTTPS certificate from the environment
public disableHttpsCertificate ( ) : array
Résultat array $workflow

domain() public méthode

Generate environment URL
public domain ( ) : string
Résultat string

getBackups() public méthode

public getBackups ( ) : Backups
Résultat Pantheon\Terminus\Collections\Backups

getBindings() public méthode

public getBindings ( ) : Bindings
Résultat Pantheon\Terminus\Collections\Bindings

getCommits() public méthode

public getCommits ( ) : Commits
Résultat Pantheon\Terminus\Collections\Commits

getDomains() public méthode

public getDomains ( ) : Domains
Résultat Pantheon\Terminus\Collections\Domains

getDrushVersion() public méthode

Gets the Drush version of this environment
public getDrushVersion ( ) : integer
Résultat integer

getLock() public méthode

Returns the lock object associated with this environment
public getLock ( ) : Lock
Résultat Lock

getName() public méthode

Returns the environment's name
public getName ( ) : string
Résultat string

getParentEnvironment() public méthode

Returns the parent environment
public getParentEnvironment ( ) : Environment
Résultat Environment

getSite() public méthode

public getSite ( ) : Site
Résultat Site

getWorkflows() public méthode

public getWorkflows ( ) : Workflows
Résultat Pantheon\Terminus\Collections\Workflows

gitConnectionInfo() public méthode

Gives Git connection info for this environment
public gitConnectionInfo ( ) : array
Résultat array

hasDeployableCode() public méthode

Decides if the environment has changes to deploy
public hasDeployableCode ( ) : boolean
Résultat boolean

import() public méthode

Imports a site archive onto Pantheon
public import ( string $url ) : Workflow
$url string URL of the archive to import
Résultat Workflow

importDatabase() public méthode

Imports a database archive
public importDatabase ( string $url ) : Workflow
$url string URL to import data from
Résultat Workflow

importFiles() public méthode

Imports a file archive
public importFiles ( string $url ) : Workflow
$url string URL to import data from
Résultat Workflow

initializeBindings() public méthode

Initializes the test/live environments on a newly created site and clones content from previous environment (e.g. test clones dev content, live clones test content.)
public initializeBindings ( ) : Workflow
Résultat Workflow In-progress workflow

isInitialized() public méthode

Have the environment's bindings have been initialized?
public isInitialized ( ) : boolean
Résultat boolean True if environment has been instantiated

isMultidev() public méthode

Is this branch a multidev environment?
public isMultidev ( ) : boolean
Résultat boolean True if ths environment is a multidev environment

mergeFromDev() public méthode

Merge code from the Dev Environment into this Multidev Environment
public mergeFromDev ( array $options = [] ) : Workflow
$options array Parameters to override defaults boolean updatedb True to update DB with merge
Résultat Workflow

mergeToDev() public méthode

Merge code from a multidev environment into the dev environment
public mergeToDev ( array $options = [] ) : Workflow
$options array Parameters to override defaults string from_environment Name of the multidev environment to merge boolean updatedb True to update DB with merge
Résultat Workflow

parseAttributes() protected méthode

Modify response data between fetch and assignment
protected parseAttributes ( object $data ) : object
$data object attributes received from API response
Résultat object $data

sendCommandViaSsh() public méthode

Sends a command to an environment via SSH.
public sendCommandViaSsh ( string $command ) : string[]
$command string The command to be run on the platform
Résultat string[] $response Elements as follow: string output The output from the command run string exit_code The status code returned by the command run

serialize() public méthode

Formats environment object into an associative array for output
public serialize ( ) : array
Résultat array Associative array of data for output

setHttpsCertificate() public méthode

Add/replace an HTTPS certificate on the environment
public setHttpsCertificate ( array $certificate = [] )
$certificate array Certificate data elements as follow string cert Certificate string key RSA private key string intermediary CA intermediate certificate(s)

sftpConnectionInfo() public méthode

Gives SFTP connection info for this environment
public sftpConnectionInfo ( ) : array
Résultat array

wake() public méthode

"Wake" a site
public wake ( ) : array
Résultat array

wipe() public méthode

Deletes all content (files and database) from the Environment
public wipe ( ) : Workflow
Résultat Workflow

Property Details

$backups public_oe property

public Backups,Pantheon\Terminus\Collections $backups
Résultat Pantheon\Terminus\Collections\Backups

$bindings public_oe property

public Bindings,Pantheon\Terminus\Collections $bindings
Résultat Pantheon\Terminus\Collections\Bindings

$commits public_oe property

public Commits,Pantheon\Terminus\Collections $commits
Résultat Pantheon\Terminus\Collections\Commits

$domains public_oe property

public Domains,Pantheon\Terminus\Collections $domains
Résultat Pantheon\Terminus\Collections\Domains

$lock protected_oe property

protected Lock,Pantheon\Terminus\Models $lock
Résultat Lock

$site public_oe property

public Site,Pantheon\Terminus\Models $site
Résultat Site

$workflows public_oe property

public Workflows,Pantheon\Terminus\Collections $workflows
Résultat Pantheon\Terminus\Collections\Workflows