summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2015-03-26 16:43:20 -0400
committerAntoine Beaupré2015-03-26 16:43:20 -0400
commit7d8bfc48f024246a41ec1c6fd7fe966f34719b7e (patch)
tree9be6a0de482661208405c6e4a7f0bbe910257c70
parentbdbe4618be72671ff64154ac842b93f58a8afb43 (diff)
allow writing config files to arbitrary locationsdev/2460443-write-arbitrary
-rw-r--r--Provision/Config.php6
-rw-r--r--platform/provision_drupal.drush.inc4
2 files changed, 6 insertions, 4 deletions
diff --git a/Provision/Config.php b/Provision/Config.php
index e7633a6..cb436b2 100644
--- a/Provision/Config.php
+++ b/Provision/Config.php
@@ -187,8 +187,10 @@ class Provision_Config {
* 5. Render template with $this and $data and write out to filename().
* 6. If $mode and/or $group are set, apply them for the new file.
*/
- function write() {
- $filename = $this->filename();
+ function write($filename = NULL) {
+ if (is_null($filename)) {
+ $filename = $this->filename();
+ }
// Make directory structure if it does not exist.
if ($filename && !provision_file()->exists(dirname($filename))->status()) {
provision_file()->mkdir(dirname($filename))
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index 0da3a9e..d883564 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -161,9 +161,9 @@ function provision_drupal_fetch_site($alias = NULL) {
/**
* Generate a settings file for the site.
*/
-function _provision_drupal_create_settings_file() {
+function _provision_drupal_create_settings_file($filename) {
$config = new Provision_Config_Drupal_Settings(d()->name, drush_get_context('site'));
- $config->write();
+ $config->write($filename);
}
/**