Commit c9265bc8 authored by Adrian Rossouw's avatar Adrian Rossouw

Now that we are actually storing context objects in $this->context,...

Now that we are actually storing context objects in $this->context, standardize on $context everywhere. (ie: config classes when from $this->owner to $this->context.)
parent 33920a23
...@@ -82,7 +82,7 @@ class provisionConfig_http_platform extends provisionConfig_http { ...@@ -82,7 +82,7 @@ class provisionConfig_http_platform extends provisionConfig_http {
public $description = 'platform configuration file'; public $description = 'platform configuration file';
function filename() { function filename() {
return $this->data['http_platformd_path'] . '/' . ltrim($this->owner->name, '@') . '.conf'; return $this->data['http_platformd_path'] . '/' . ltrim($this->context->name, '@') . '.conf';
} }
} }
......
...@@ -134,7 +134,7 @@ class provisionConfig_drupal_settings extends provisionConfig { ...@@ -134,7 +134,7 @@ class provisionConfig_drupal_settings extends provisionConfig {
if (drush_drupal_major_version() >= 7) { if (drush_drupal_major_version() >= 7) {
$this->data['db_type'] = ($this->data['db_type'] == 'mysqli') ? 'mysql' : $this->data['db_type']; $this->data['db_type'] = ($this->data['db_type'] == 'mysqli') ? 'mysql' : $this->data['db_type'];
} }
$cloaked = $this->owner->service('http')->cloaked_db_creds(); $cloaked = $this->context->service('http')->cloaked_db_creds();
foreach (array('db_type', 'db_user', 'db_passwd', 'db_host', 'db_name') as $key) { foreach (array('db_type', 'db_user', 'db_passwd', 'db_host', 'db_name') as $key) {
$this->creds[$key] = ($cloaked) ? "\$_SERVER[{$key}]" : urldecode($this->data[$key]); $this->creds[$key] = ($cloaked) ? "\$_SERVER[{$key}]" : urldecode($this->data[$key]);
......
...@@ -23,7 +23,7 @@ class provisionConfig { ...@@ -23,7 +23,7 @@ class provisionConfig {
* *
* @var provisionContext * @var provisionContext
*/ */
public $owner = null; public $context = null;
/** /**
* If set, replaces file name in log messages. * If set, replaces file name in log messages.
...@@ -41,26 +41,26 @@ class provisionConfig { ...@@ -41,26 +41,26 @@ class provisionConfig {
protected $group = NULL; protected $group = NULL;
/** /**
* Forward $this->... to $this->owner->... * Forward $this->... to $this->context->...
* object. * object.
*/ */
function __get($name) { function __get($name) {
if (isset($this->owner)) { if (isset($this->context)) {
return $this->owner->$name; return $this->context->$name;
} }
} }
/** /**
* Constructor, overriding not recommended. * Constructor, overriding not recommended.
* *
* @param $owner * @param $context
* An alias name for d(), the provisionContext that this configuration * An alias name for d(), the provisionContext that this configuration
* is relevant to. * is relevant to.
* @param $data * @param $data
* An associative array to potentiall manipulate in process() and make * An associative array to potentiall manipulate in process() and make
* available as variables to the template. * available as variables to the template.
*/ */
function __construct($owner, $data = array()) { function __construct($context, $data = array()) {
if (is_null($this->template)) { if (is_null($this->template)) {
throw(exception); throw(exception);
} }
...@@ -70,8 +70,8 @@ class provisionConfig { ...@@ -70,8 +70,8 @@ class provisionConfig {
$this->data = array_merge($this->data, $data); $this->data = array_merge($this->data, $data);
} }
// Accept both a reference and an alias name for the owner. // Accept both a reference and an alias name for the context.
$this->owner = is_object($owner) ? $owner : d($owner); $this->context = is_object($context) ? $context : d($context);
} }
/** /**
...@@ -176,8 +176,8 @@ class provisionConfig { ...@@ -176,8 +176,8 @@ class provisionConfig {
} }
if (!is_null($this->group)) { if (!is_null($this->group)) {
provision_file()->chgrp($filename, $this->group) provision_file()->chgrp($filename, $this->group)
->succeed('Change group ownership of @path to @gid') ->succeed('Change group contextship of @path to @gid')
->fail('Could not change group ownership of @path to @gid'); ->fail('Could not change group contextship of @path to @gid');
} }
} }
} }
...@@ -207,8 +207,8 @@ class provisionConfig_drushrc extends provisionConfig { ...@@ -207,8 +207,8 @@ class provisionConfig_drushrc extends provisionConfig {
return _drush_config_file($this->context_name); return _drush_config_file($this->context_name);
} }
function __construct($owner, $data = array()) { function __construct($context, $data = array()) {
parent::__construct($owner, $data); parent::__construct($context, $data);
$this->load_data(); $this->load_data();
} }
...@@ -236,10 +236,10 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc { ...@@ -236,10 +236,10 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc {
* @param $options * @param $options
* Array of string option names to save. * Array of string option names to save.
*/ */
function __construct($owner, $data = array()) { function __construct($context, $data = array()) {
parent::__construct($owner, $data); parent::__construct($context, $data);
$this->data = array( $this->data = array(
'aliasname' => ltrim($owner, '@'), 'aliasname' => ltrim($context, '@'),
'options' => $data, 'options' => $data,
); );
} }
......
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