[PATCH 14/16] Debianize with respect to php.ini location;

Johannes Graumann johannes_graumann at web.de
Tue Oct 2 14:28:15 CEST 2012


---
 pykolab/setup/setup_php.py |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/pykolab/setup/setup_php.py b/pykolab/setup/setup_php.py
index 1d06b74..9baa679 100644
--- a/pykolab/setup/setup_php.py
+++ b/pykolab/setup/setup_php.py
@@ -68,14 +68,18 @@ def execute(*args, **kw):
             )
 
     myaugeas = Augeas()
-
-    setting_base = '/files/etc/php.ini/'
-
+    
+    if os.path.isfile('/etc/php.ini/'):
+	setting_base = '/files/etc/php.ini/'
+    elif os.path.isfile('/etc/php5/apache2/php.ini/'):
+	setting_base = '/files/etc/php5/apache2/php.ini/'
+    else:
+        log.error(_("No usable 'php.ini' found."))
     setting = os.path.join(setting_base, 'Date', 'date.timezone')
     current_value = myaugeas.get(setting)
 
     if current_value == None:
-        insert_paths = myaugeas.match('/files/etc/php.ini/Date/*')
+        insert_paths = myaugeas.match(setting_base + 'Date/*')
         insert_path = insert_paths[(len(insert_paths)-1)]
         myaugeas.insert(insert_path, 'date.timezone', False)
 
-- 
1.7.10.4




More information about the devel mailing list