Commit 71ec853d authored by Jon Pugh's avatar Jon Pugh

Issue #2851478: Move the symlinking of service config from the...

Issue #2851478: Move the symlinking of service config from the Provision_Config class to a method on the Provision_Service class.
parent f4718d37
......@@ -16,23 +16,6 @@ class Provision_Config_Http_Server extends Provision_Config_Http {
function write() {
parent::write();
if (isset($this->data['application_name'])) {
$file = $this->data['application_name'] . '.conf';
// We link the app_name.conf file on the remote server to the right version.
$cmd = sprintf('ln -sf %s %s',
escapeshellarg($this->data['server']->config_path . '/' . $file),
escapeshellarg($this->data['server']->aegir_root . '/config/' . $file)
);
if ($this->data['server']->shell_exec($cmd)) {
drush_log(dt("Created symlink for %file on %server", array(
'%file' => $file,
'%server' => $this->data['server']->remote_host,
)));
};
}
}
function filename() {
......
......@@ -57,9 +57,29 @@ class Provision_Service_http_public extends Provision_Service_http {
$this->server->http_vhostd_path = "{$app_dir}/vhost.d";
$this->server->http_subdird_path = "{$app_dir}/subdir.d";
$this->server->http_platforms_path = "{$this->server->aegir_root}/platforms";
$this->symlink_service();
}
}
/**
* Save symlink for this server from /var/aegir/config/APPLICATION_NAME.conf -> /var/aegir/config/SERVER/APPLICATION_NAME.conf
*/
function symlink_service() {
$file = $this->application_name . '.conf';
// We link the app_name.conf file on the remote server to the right version.
$cmd = sprintf('ln -sf %s %s',
escapeshellarg($this->server->config_path . '/' . $file),
escapeshellarg($this->server->aegir_root . '/config/' . $file)
);
if ($this->server->shell_exec($cmd)) {
drush_log(dt("Created symlink for %file on %server", array(
'%file' => $file,
'%server' => $this->server->remote_host,
)));
};
}
static function option_documentation() {
return array(
......
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