PHP Класс Platformsh\Cli\Api

Показать файл Открыть проект Примеры использования класса

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

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