Commit cc22e9bd authored by drumm's avatar drumm Committed by Neil Drumm

Make comma-separated options API.

parent b861b19f
......@@ -165,9 +165,14 @@ class provisionEnvironment {
/**
* Check the $options property for a field, saving to the properties array.
*/
function setProperty($field, $default = null) {
function setProperty($field, $default = NULL, $array = FALSE) {
if (isset($this->options[$field])) {
$this->$field = $this->options[$field];
if ($array && !is_array($this->options[$field])) {
$this->$field = explode(',', $this->options[$field]);
}
else {
$this->$field = $this->options[$field];
}
}
else {
$this->$field = $default;
......@@ -410,23 +415,14 @@ class provisionSite extends provisionEnvironment {
$this->setProperty('uri');
$this->setProperty('language', 'en');
$this->setProperty('aliases', array());
$this->setProperty('site_port', 80);
$this->setProperty('client_email');
$this->setProperty('aliases', array(), TRUE);
$this->setProperty('db_server');
$this->is_oid('db_server');
$this->service_subscribe('db', $this->db_server->name);
// todo - turn into a re-usable mechanism for comma separated values
if ($this->options['aliases'] && !is_array($site_data['aliases'])) {
$this->aliases = explode(",", $site_data['aliases']);
}
else {
$this->aliases = array();
}
// this can potentially be handled by a Drupal sub class
$this->setProperty('profile', 'default');
}
......
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