PHP 클래스 Platformsh\Cli\Api

파일 보기 프로젝트 열기: commerceguys/platform-cli 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$apiToken string | null
$apiTokenType string
$cache Doctrine\Common\Cache\CacheProvider
$client Platformsh\Client\PlatformClient
$config CliConfig
$dispatcher null | Symfony\Component\EventDispatcher\EventDispatcherInterface
$sessionId string

공개 메소드들

메소드 설명
__construct ( CliConfig $config = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null ) Constructor.
clearCache ( ) Clear the cache.
clearEnvironmentsCache ( string $projectId ) Clear the environments cache for a project.
clearProjectsCache ( ) Clear the projects cache.
getAccount ( Platformsh\Client\Model\ProjectAccess $user, boolean $reset = false ) : array Get a user's account info.
getCache ( ) : CacheProvider
getClient ( boolean $autoLogin = true ) : Platformsh\Client\PlatformClient Get the API client object.
getEnvironment ( string $id, Platformsh\Client\Model\Project $project, boolean | null $refresh = null, boolean $tryMachineName = false ) : Platformsh\Client\Model\Environment | false Get a single environment.
getEnvironments ( Platformsh\Client\Model\Project $project, boolean | null $refresh = null, boolean $events = true ) : Platformsh\Client\Model\Environment[] Return the user's environments.
getMyAccount ( boolean $reset = false ) : array Get the current user's account info.
getNestedProperty ( Platformsh\Client\Model\Resource $resource, string $propertyPath, boolean $lazyLoad = true ) : mixed Get a nested property of a resource, via a dot-separated string path.
getProject ( string $id, string | null $host = null, boolean | null $refresh = null ) : Platformsh\Client\Model\Project | false Return the user's project with the given ID.
getProjectLabel ( Platformsh\Client\Model\Project $project, string | false $tag = 'info' ) : string Returns a project label.
getProjects ( boolean | null $refresh = null ) : Platformsh\Client\Model\Project[] Return the user's projects.
hasApiToken ( ) : boolean Returns whether the CLI is authenticating using an API token.
isLoggedIn ( ) : boolean
loadProjectAccessByEmail ( Platformsh\Client\Model\Project $project, string $email ) : Platformsh\Client\Model\ProjectAccess | false Load a project user ("project access" record) by email address.
sortResources ( array &$resources, string $propertyPath ) : Platformsh\Client\Model\Resource[] Sort resources.

보호된 메소드들

메소드 설명
getUserAgent ( ) : string Get an HTTP User Agent string representing this application.
loadTokenFromFile ( string $filename ) : string Load an API token from a file.
setUpCache ( )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( CliConfig $config = null, Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher = null )
$config CliConfig
$dispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface

clearCache() 공개 메소드

Clear the cache.
public clearCache ( )

clearEnvironmentsCache() 공개 메소드

Use this after creating/deleting/updating environment(s).
public clearEnvironmentsCache ( string $projectId )
$projectId string

clearProjectsCache() 공개 메소드

Clear the projects cache.
public clearProjectsCache ( )

getAccount() 공개 메소드

Get a user's account info.
public getAccount ( Platformsh\Client\Model\ProjectAccess $user, boolean $reset = false ) : array
$user Platformsh\Client\Model\ProjectAccess
$reset boolean
리턴 array An array containing 'email' and 'display_name'.

getCache() 공개 메소드

public getCache ( ) : CacheProvider
리턴 Doctrine\Common\Cache\CacheProvider

getClient() 공개 메소드

Get the API client object.
public getClient ( boolean $autoLogin = true ) : Platformsh\Client\PlatformClient
$autoLogin boolean Whether to log in, if the client is not already authenticated (default: true).
리턴 Platformsh\Client\PlatformClient

getEnvironment() 공개 메소드

Get a single environment.
public getEnvironment ( string $id, Platformsh\Client\Model\Project $project, boolean | null $refresh = null, boolean $tryMachineName = false ) : Platformsh\Client\Model\Environment | false
$id string The environment ID to load.
$project Platformsh\Client\Model\Project The project.
$refresh boolean | null Whether to refresh the list of environments.
$tryMachineName boolean Whether to retry, treating the ID as a machine name.
리턴 Platformsh\Client\Model\Environment | false The environment, or false if not found.

getEnvironments() 공개 메소드

Return the user's environments.
public getEnvironments ( Platformsh\Client\Model\Project $project, boolean | null $refresh = null, boolean $events = true ) : Platformsh\Client\Model\Environment[]
$project Platformsh\Client\Model\Project The project.
$refresh boolean | null Whether to refresh the list.
$events boolean Whether to update Drush aliases if the list changes.
리턴 Platformsh\Client\Model\Environment[] The user's environments.

getMyAccount() 공개 메소드

Get the current user's account info.
public getMyAccount ( boolean $reset = false ) : array
$reset boolean
리턴 array An array containing at least 'uuid', 'mail', and 'display_name'.

getNestedProperty() 공개 정적인 메소드

Get a nested property of a resource, via a dot-separated string path.
public static getNestedProperty ( Platformsh\Client\Model\Resource $resource, string $propertyPath, boolean $lazyLoad = true ) : mixed
$resource Platformsh\Client\Model\Resource
$propertyPath string
$lazyLoad boolean
리턴 mixed

getProject() 공개 메소드

Return the user's project with the given ID.
public getProject ( string $id, string | null $host = null, boolean | null $refresh = null ) : Platformsh\Client\Model\Project | false
$id string The project ID.
$host string | null The project's hostname.
$refresh boolean | null Whether to bypass the cache.
리턴 Platformsh\Client\Model\Project | false

getProjectLabel() 공개 메소드

Returns a project label.
public getProjectLabel ( Platformsh\Client\Model\Project $project, string | false $tag = 'info' ) : string
$project Platformsh\Client\Model\Project
$tag string | false
리턴 string

getProjects() 공개 메소드

Return the user's projects.
public getProjects ( boolean | null $refresh = null ) : Platformsh\Client\Model\Project[]
$refresh boolean | null Whether to refresh the list of projects.
리턴 Platformsh\Client\Model\Project[] The user's projects, keyed by project ID.

getUserAgent() 보호된 메소드

Get an HTTP User Agent string representing this application.
protected getUserAgent ( ) : string
리턴 string

hasApiToken() 공개 메소드

Returns whether the CLI is authenticating using an API token.
public hasApiToken ( ) : boolean
리턴 boolean

isLoggedIn() 공개 메소드

public isLoggedIn ( ) : boolean
리턴 boolean

loadProjectAccessByEmail() 공개 메소드

Load a project user ("project access" record) by email address.
public loadProjectAccessByEmail ( Platformsh\Client\Model\Project $project, string $email ) : Platformsh\Client\Model\ProjectAccess | false
$project Platformsh\Client\Model\Project
$email string
리턴 Platformsh\Client\Model\ProjectAccess | false

loadTokenFromFile() 보호된 메소드

Load an API token from a file.
protected loadTokenFromFile ( string $filename ) : string
$filename string A filename, either relative to the user config directory, or absolute.
리턴 string

setUpCache() 보호된 메소드

protected setUpCache ( )

sortResources() 공개 정적인 메소드

Sort resources.
public static sortResources ( array &$resources, string $propertyPath ) : Platformsh\Client\Model\Resource[]
$resources array
$propertyPath string
리턴 Platformsh\Client\Model\Resource[]

프로퍼티 상세

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

protected static string|null $apiToken
리턴 string | null

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

protected static string $apiTokenType
리턴 string

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

protected static CacheProvider,Doctrine\Common\Cache $cache
리턴 Doctrine\Common\Cache\CacheProvider

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

protected static PlatformClient,Platformsh\Client $client
리턴 Platformsh\Client\PlatformClient

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

protected CliConfig,Platformsh\Cli $config
리턴 CliConfig

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

protected null|EventDispatcherInterface,Symfony\Component\EventDispatcher $dispatcher
리턴 null | Symfony\Component\EventDispatcher\EventDispatcherInterface

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

protected static string $sessionId
리턴 string