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; ...@@ -9,32 +9,34 @@ namespace Aegir\Provision;
/** /**
* Base context class. * Base context class.
*/ */
class Context { class Context
{
/**
* @var string /**
* Name for saving aliases and referencing. * @var string
*/ * Name for saving aliases and referencing.
public $name = NULL; */
public $name = null;
/**
* @var string /**
* 'server', 'platform', or 'site'. * @var string
*/ * 'server', 'platform', or 'site'.
public $type = NULL; */
public $type = null;
/**
* @var array /**
* Properties that will be persisted by provision-save. Access as object * @var array
* members, $evironment->property_name. __get() and __set handle this. In * Properties that will be persisted by provision-save. Access as object
* init(), set defaults with setProperty(). * members, $evironment->property_name. __get() and __set handle this. In
*/ * init(), set defaults with setProperty().
protected $properties = array(); */
protected $properties = [];
/**
* Constructor for the context. /**
*/ * Constructor for the context.
function __construct($name) { */
$this->name = $name; function __construct($name)
} {
$this->name = $name;
}
} }
...@@ -11,15 +11,19 @@ use Aegir\Provision\Context; ...@@ -11,15 +11,19 @@ use Aegir\Provision\Context;
* *
* @see \Provision_Context_platform * @see \Provision_Context_platform
*/ */
class PlatformContext extends Context { class PlatformContext extends Context
static function option_documentation() { {
$options = array(
'root' => 'platform: path to a Drupal installation', static function option_documentation()
'server' => 'platform: drush backend server; default @server_master', {
'web_server' => 'platform: web server hosting the platform; default @server_master', $options = [
'makefile' => 'platform: drush makefile to use for building the platform if it doesn\'t already exist', 'root' => 'platform: path to a Drupal installation',
'make_working_copy' => 'platform: Specifiy TRUE to build the platform with the Drush make --working-copy option.', 'server' => 'platform: drush backend server; default @server_master',
); 'web_server' => 'platform: web server hosting the platform; default @server_master',
return $options; '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; ...@@ -11,14 +11,18 @@ use Aegir\Provision\Context;
* *
* @see \Provision_Context_server * @see \Provision_Context_server
*/ */
class ServerContext extends Context { class ServerContext extends Context
static function option_documentation() { {
$options = array(
'remote_host' => 'server: host name; default localhost', static function option_documentation()
'script_user' => 'server: OS user name; default current user', {
'aegir_root' => 'server: Aegir root; default ' . getenv('HOME'), $options = [
'master_url' => 'server: Hostmaster URL', 'remote_host' => 'server: host name; default localhost',
); 'script_user' => 'server: OS user name; default current user',
return $options; 'aegir_root' => 'server: Aegir root; default '.getenv('HOME'),
} 'master_url' => 'server: Hostmaster URL',
];
return $options;
}
} }
...@@ -11,31 +11,34 @@ use Aegir\Provision\Context; ...@@ -11,31 +11,34 @@ use Aegir\Provision\Context;
* *
* @see \Provision_Context_site * @see \Provision_Context_site
*/ */
class SiteContext extends Context { 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.',
);
}
// /** static function option_documentation()
// * Write out this named context to an alias file. {
// */ return [
// function write_alias() { 'platform' => 'site: the platform the site is run on',
// $config = new Provision_Config_Drushrc_Alias($this->name, $this->properties); 'db_server' => 'site: the db server the site is run on',
// $config->write(); 'uri' => 'site: example.com URI, no http:// or trailing /',
// foreach ($this->drush_aliases as $drush_alias) { 'language' => 'site: site language; default en',
// $config = new Provision_Config_Drushrc_Alias($drush_alias, $this->properties); 'aliases' => 'site: comma-separated URIs',
// $config->write(); '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