From a1c32c4a1a3963149d63f04fb94b4cf3e9ea7fc0 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Wed, 15 Sep 2010 19:54:21 +0000
Subject: [PATCH] Adding the ability to set the default temp dir for new UNL
 profile sites via an ini file.

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x@167 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 profiles/unl_profile/unl_profile.ini.sample |  2 ++
 profiles/unl_profile/unl_profile.install    | 11 +++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 profiles/unl_profile/unl_profile.ini.sample

diff --git a/profiles/unl_profile/unl_profile.ini.sample b/profiles/unl_profile/unl_profile.ini.sample
new file mode 100644
index 00000000..41759582
--- /dev/null
+++ b/profiles/unl_profile/unl_profile.ini.sample
@@ -0,0 +1,2 @@
+[defaults]
+temp_dir = "/tmp/"
diff --git a/profiles/unl_profile/unl_profile.install b/profiles/unl_profile/unl_profile.install
index 24a8c4c0..7a975d41 100644
--- a/profiles/unl_profile/unl_profile.install
+++ b/profiles/unl_profile/unl_profile.install
@@ -10,6 +10,13 @@ function unl_profile_install()
     // Start out by calling the standard profile's setup.
     require_once dirname(__FILE__) . '/../standard/standard.install';
     standard_install();
+
+    // Load the ini file (if it exists)
+    $ini_file = dirname(__FILE__) . '/unl_profile.ini';
+    $ini_settings = array();
+    if (file_exists($ini_file)) {
+    	$ini_settings = parse_ini_file($ini_file);
+    }
     
     // Enable some standard blocks.
     $values = array(
@@ -44,6 +51,10 @@ function unl_profile_install()
     theme_enable(array('unl_wdn'));
     variable_set('theme_default', 'unl_wdn');
     
+    if (isset($ini_settings['temp_dir'])) {
+    	variable_set('file_temporary_path', $ini_settings['temp_dir']);
+    }
+    
     //TODO: IMCE setup (currently cannot be shared between sites)
     
     
-- 
GitLab