Commit b441a70e authored by ergonlogic's avatar ergonlogic Committed by llamech

Generate service.yml file to set cookie domains, and thus fix link construction on subdir sites.

parent 648753f0
<?php
/**
* @file
* Provides the Provision_Config_Drupal_Services class.
*/
class Provision_Config_Drupal_Services extends Provision_Config {
public $template = 'aegir.services.tpl.php';
public $description = 'Drupal aegir.services.yml file';
protected $mode = 0440;
function filename() {
return $this->site_path . '/aegir.services.yml';
}
function process() {
$this->version = provision_version();
$this->cookie_domain = $this->getCookieDomain();
$this->group = $this->platform->server->web_group;
}
/**
* Extract our cookie domain from the URI.
*/
protected function getCookieDomain() {
$uri = explode('.', $this->uri);
# Leave base domain; only strip out subdomains.
if (count($uri) > 2) {
$uri[0] = '';
}
return implode('.', $uri);
}
}
---
# This file was automatically generated by Aegir <?php print $this->version; ?>
# on <?php print date('r'); ?>.
parameters:
session.storage.options:
cookie_domain: '<?php print $this->cookie_domain; ?>'
......@@ -163,6 +163,7 @@ if (isset($_SERVER['db_name'])) {
/**
* Load services definition file.
*/
$settings['container_yamls'][] = __DIR__ . '/aegir.services.yml';
$settings['container_yamls'][] = __DIR__ . '/services.yml';
/**
......
......@@ -168,8 +168,12 @@ function provision_drupal_fetch_site($alias = NULL) {
* Generate a settings file for the site.
*/
function _provision_drupal_create_settings_file() {
$config = new Provision_Config_Drupal_Settings(d()->name, drush_get_context('site'));
$config->write();
$name = d()->name;
$context = drush_get_context('site');
$settings = new Provision_Config_Drupal_Settings($name, $context);
$settings->write();
$services = new Provision_Config_Drupal_Services($name, $context);
$services->write();
}
/**
......
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