Commit 4fdd1d38 authored by Adrian Rossouw's avatar Adrian Rossouw

standardize on the name 'context' instead of 'owner' inside config files.

parent 05ee9faa
...@@ -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 provisionEnvironment * @var provisionEnvironment
*/ */
public $owner = null; public $context = null;
/** /**
* If set, replaces file name in log messages. * If set, replaces file name in log messages.
...@@ -51,32 +51,32 @@ class provisionConfig { ...@@ -51,32 +51,32 @@ class provisionConfig {
public $store = NULL; public $store = 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 provisionEnvironment that this configuration * An alias name for d(), the provisionEnvironment 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);
} }
// 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);
if (sizeof($data)) { if (sizeof($data)) {
$this->data = $data; $this->data = $data;
...@@ -85,7 +85,7 @@ class provisionConfig { ...@@ -85,7 +85,7 @@ class provisionConfig {
if (!is_null($this->data_store_class) && class_exists($this->data_store_class)) { if (!is_null($this->data_store_class) && class_exists($this->data_store_class)) {
$class = $this->data_store_class; $class = $this->data_store_class;
$this->store = new $class($owner, $data); $this->store = new $class($context, $data);
} }
} }
...@@ -234,8 +234,8 @@ class provisionConfig_drushrc extends provisionConfig { ...@@ -234,8 +234,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();
} }
...@@ -263,10 +263,10 @@ class provisionConfig_drushrc_alias extends provisionConfig_drushrc { ...@@ -263,10 +263,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,
); );
} }
...@@ -333,8 +333,8 @@ class provisionConfig_data_store extends provisionConfig { ...@@ -333,8 +333,8 @@ class provisionConfig_data_store extends provisionConfig {
protected $mode = 0700; protected $mode = 0700;
function __construct($owner, $data = array()) { function __construct($context, $data = array()) {
parent::__construct($owner, $data); parent::__construct($context, $data);
$this->load_data(); $this->load_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