Commit 673cc412 authored by Jon Pugh's avatar Jon Pugh

Reformat code according to Symfony2 guidelines.

parent 1145fea2
......@@ -9,32 +9,34 @@ namespace Aegir\Provision;
/**
* Base context class.
*/
class Context {
/**
* @var string
* Name for saving aliases and referencing.
*/
public $name = NULL;
/**
* @var string
* 'server', 'platform', or 'site'.
*/
public $type = NULL;
/**
* @var array
* Properties that will be persisted by provision-save. Access as object
* members, $evironment->property_name. __get() and __set handle this. In
* init(), set defaults with setProperty().
*/
protected $properties = array();
/**
* Constructor for the context.
*/
function __construct($name) {
$this->name = $name;
}
class Context
{
/**
* @var string
* Name for saving aliases and referencing.
*/
public $name = null;
/**
* @var string
* 'server', 'platform', or 'site'.
*/
public $type = null;
/**
* @var array
* Properties that will be persisted by provision-save. Access as object
* members, $evironment->property_name. __get() and __set handle this. In
* init(), set defaults with setProperty().
*/
protected $properties = [];
/**
* Constructor for the context.
*/
function __construct($name)
{
$this->name = $name;
}
}
......@@ -11,15 +11,19 @@ use Aegir\Provision\Context;
*
* @see \Provision_Context_platform
*/
class PlatformContext extends Context {
static function option_documentation() {
$options = array(
'root' => 'platform: path to a Drupal installation',
'server' => 'platform: drush backend server; default @server_master',
'web_server' => 'platform: web server hosting the platform; default @server_master',
'makefile' => 'platform: drush makefile to use for building the platform if it doesn\'t already exist',
'make_working_copy' => 'platform: Specifiy TRUE to build the platform with the Drush make --working-copy option.',
);
return $options;
}
class PlatformContext extends Context
{
static function option_documentation()
{
$options = [
'root' => 'platform: path to a Drupal installation',
'server' => 'platform: drush backend server; default @server_master',
'web_server' => 'platform: web server hosting the platform; default @server_master',
'makefile' => 'platform: drush makefile to use for building the platform if it doesn\'t already exist',
'make_working_copy' => 'platform: Specifiy TRUE to build the platform with the Drush make --working-copy option.',
];
return $options;
}
}
......@@ -11,14 +11,18 @@ use Aegir\Provision\Context;
*
* @see \Provision_Context_server
*/
class ServerContext extends Context {
static function option_documentation() {
$options = array(
'remote_host' => 'server: host name; default localhost',
'script_user' => 'server: OS user name; default current user',
'aegir_root' => 'server: Aegir root; default ' . getenv('HOME'),
'master_url' => 'server: Hostmaster URL',
);
return $options;
}
class ServerContext extends Context
{
static function option_documentation()
{
$options = [
'remote_host' => 'server: host name; default localhost',
'script_user' => 'server: OS user name; default current user',
'aegir_root' => 'server: Aegir root; default '.getenv('HOME'),
'master_url' => 'server: Hostmaster URL',
];
return $options;
}
}
......@@ -11,31 +11,34 @@ use Aegir\Provision\Context;
*
* @see \Provision_Context_site
*/
class SiteContext extends Context {
static function option_documentation() {
return array(
'platform' => 'site: the platform the site is run on',
'db_server' => 'site: the db server the site is run on',
'uri' => 'site: example.com URI, no http:// or trailing /',
'language' => 'site: site language; default en',
'aliases' => 'site: comma-separated URIs',
'redirection' => 'site: boolean for whether --aliases should redirect; default false',
'client_name' => 'site: machine name of the client that owns this site',
'install_method' => 'site: How to install the site; default profile. When set to "profile" the install profile will be run automatically. Otherwise, an empty database will be created. Additional modules may provide additional install_methods.',
'profile' => 'site: Drupal profile to use; default standard',
'drush_aliases' => 'site: Comma-separated list of additional Drush aliases through which this site can be accessed.',
);
}
class SiteContext extends Context
{
// /**
// * Write out this named context to an alias file.
// */
// function write_alias() {
// $config = new Provision_Config_Drushrc_Alias($this->name, $this->properties);
// $config->write();
// foreach ($this->drush_aliases as $drush_alias) {
// $config = new Provision_Config_Drushrc_Alias($drush_alias, $this->properties);
// $config->write();
// }
// }
static function option_documentation()
{
return [
'platform' => 'site: the platform the site is run on',
'db_server' => 'site: the db server the site is run on',
'uri' => 'site: example.com URI, no http:// or trailing /',
'language' => 'site: site language; default en',
'aliases' => 'site: comma-separated URIs',
'redirection' => 'site: boolean for whether --aliases should redirect; default false',
'client_name' => 'site: machine name of the client that owns this site',
'install_method' => 'site: How to install the site; default profile. When set to "profile" the install profile will be run automatically. Otherwise, an empty database will be created. Additional modules may provide additional install_methods.',
'profile' => 'site: Drupal profile to use; default standard',
'drush_aliases' => 'site: Comma-separated list of additional Drush aliases through which this site can be accessed.',
];
}
// /**
// * Write out this named context to an alias file.
// */
// function write_alias() {
// $config = new Provision_Config_Drushrc_Alias($this->name, $this->properties);
// $config->write();
// foreach ($this->drush_aliases as $drush_alias) {
// $config = new Provision_Config_Drushrc_Alias($drush_alias, $this->properties);
// $config->write();
// }
// }
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment