Switchboard
  • Namespace
  • Class
  • Tree

Namespaces

  • Fluxsauce
    • Switchboard

Classes

  • EnvDb
  • Environment
  • Persistent
  • Project
  • Provider
  • ProviderAcquia
  • ProviderPantheon
  • Site
  • Sqlite

Class Provider

Generic class for hosting / PaaS Providers.

Direct known subclasses

Fluxsauce\Switchboard\ProviderAcquia, Fluxsauce\Switchboard\ProviderPantheon

Abstract
Namespace: Fluxsauce\Switchboard
Package: Fluxsauce\Switchboard
Located at library/fluxsauce/switchboard/src/Provider.php

Methods summary

public static mixed
# getInstance( string $provider_name )

Returns a singleton Provider.

Returns a singleton Provider.

Parameters

$provider_name
string
$provider_name The machine name of a Provider.

Returns

mixed
A Provider subclass.
protected
# __construct( )

Protected constructor; use getInstance.

Protected constructor; use getInstance.

public mixed
# __get( string $name )

Magic __get.

Magic __get.

Parameters

$name
string
$name The name of the property to get.

Returns

mixed
Value of set property.

Throws

Exception
abstract public
# apiGetSite( string $site_name )

Perform an API call to get site information from a Provider.

Perform an API call to get site information from a Provider.

Parameters

$site_name
string
$site_name The name of the site in question.
public
# siteDestroy( string $site_name )

Destroy a site associated with a Provider.

Destroy a site associated with a Provider.

Parameters

$site_name
string
$site_name The machine name of the Site to destroy.

Throws

Exception
public
# sitesDestroy( )

Delete all Sites associated with a Provider.

Delete all Sites associated with a Provider.

public boolean
# siteExists( string $site_name )

Determine if a Site exists within a Provider.

Determine if a Site exists within a Provider.

Parameters

$site_name
string
$site_name The machine name of the Site to check.

Returns

boolean
TRUE if Site exists within a provider, FALSE if it does not.
abstract public string
# siteGetField( string $site_name, string $field )

A mapping function that calls the appropriate API to populate a field.

A mapping function that calls the appropriate API to populate a field.

Parameters

$site_name
string
$site_name Machine name of the site in question.
$field
string
$field Name of the field to populate.

Returns

string
The value of the field.

Throws

Exception
Unknown field name.
abstract public
# apiGetSites( )

Populate available Sites from a Provider.

Populate available Sites from a Provider.

abstract public
# apiGetSiteEnvironments( string $site_name )

Populate available Site Environments from a Provider.

Populate available Site Environments from a Provider.

Parameters

$site_name
string
$site_name The machine name of the site in question.
abstract public
# apiGetSiteEnvDbs( string $site_name, string $env_name )

Get and populate list of Databases for a particular Environment.

Get and populate list of Databases for a particular Environment.

Parameters

$site_name
string
$site_name The machine name of the Site.
$env_name
string
$env_name The machine name of the Site Environment.
abstract public array
# requestsOptionsCustom( )

Provider specific options for Requests.

Provider specific options for Requests.

Returns

array
Options for the request; see Requests::request for details.
abstract public boolean
# authLogin( string $email, string $password )

Log in to target Provider.

Log in to target Provider.

Parameters

$email
string
$email The email address of the user.
$password
string
$password The password of the user.

Returns

boolean
Indicates success.
abstract public array
# apiGetSiteEnvDbBackups( string $site_name, string $env_name )

Get a list of database backups for a particular Site Environment.

Get a list of database backups for a particular Site Environment.

Parameters

$site_name
string
$site_name The machine name of the Site.
$env_name
string
$env_name The machine name of the Site Environment.

Returns

array
An array of Backup arrays keyed by the timestamp. Each Backup array has the following keys: - 'filename' - 'url' - 'timestamp'
abstract public string
# apiDownloadBackup( array $backup, string $destination )

Download a backup.

Download a backup.

Parameters

$backup
array
$backup An array from apiGetSiteEnvDbBackups().
$destination
string
$destination The path to the destination.

Returns

string
The full path to the downloaded backup.
public array
# getSiteEnvDbBackupLatest( string $site_name, string $env_name )

Helper function to get the latest database backup.

Helper function to get the latest database backup.

Parameters

$site_name
string
$site_name The machine name of the Site in question.
$env_name
string
$env_name The machine name of the Site Environment in question.

Returns

array
A backup array as defined in apiGetSiteEnvDbBackups().
public string
# drushCacheBinAuthName( )

Get the name of the Drush cache bin for a particular Provider.

Get the name of the Drush cache bin for a particular Provider.

Returns

string
The name of the drush cache bin.
public
# authLogout( )

Log out of target provider.

Log out of target provider.

abstract public boolean
# authIsLoggedIn( )

Determine whether a user is logged-in to a Provider.

Determine whether a user is logged-in to a Provider.

Returns

boolean
TRUE if they are.
abstract public string
# getFilesPath( string $site_name, string $env_name )

Get the remote path to files for a particular Site Environment.

Get the remote path to files for a particular Site Environment.

Parameters

$site_name
string
$site_name The machine name of the Site in question.
$env_name
string
$env_name The machine name of the Site Environment in question.

Returns

string
The full path of the files directory.
public array
# requestsOptions( array $options = array() )

Get all Provider specific and custom options for the Requests library.

Get all Provider specific and custom options for the Requests library.

Parameters

$options
array
$options Optional overriding options.

Returns

array
Options for the request; see Requests::request for details.

Magic methods summary

Properties summary

protected string $name
#

Machine name of the Provider.

Machine name of the Provider.

protected string $label
#

Human readable label for the Provider.

Human readable label for the Provider.

protected string $homepage
#

Homepage URL for the provider.

Homepage URL for the provider.

protected string $endpoint
#

Endpoint URL for the provider.

Endpoint URL for the provider.

protected array $sites
#

Contains instances of Fluxsauce\Switchboard\Site

Contains instances of Fluxsauce\Switchboard\Site

Switchboard API documentation generated by ApiGen 2.8.0