From 10546333101c2092898ec5a443ff446078892418 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 28 Aug 2017 20:12:33 +0200 Subject: [PATCH] Add dirty trick to be able to install php5 apps --- src/yunohost/app.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index a4ab8db7b..d6ce3747c 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -743,6 +743,9 @@ def app_install(auth, app, label=None, args=None, no_remove_on_failure=False): app_settings['install_time'] = status['installed_at'] _set_app_settings(app_instance_name, app_settings) + # Apply dirty patch to make php5 apps compatible with php7 + _patch_php5(extracted_app_folder) + os.system('chown -R admin: ' + extracted_app_folder) # Execute App install script @@ -2181,3 +2184,14 @@ def unstable_apps(): return output + +def _patch_php5(app_folder): + + files_to_patch = [] + files_to_patch.extend(glob.glob("%s/conf/*" % app_folder)) + files_to_patch.extend(glob.glob("%s/scripts/*" % app_folder)) + files_to_patch.append("%s/manifest.json" % app_folder) + + for filename in files_to_patch: + c = "sed -i -e 's@/etc/php5@/etc/php/7.0@g' -e 's@php5@php7.0@g' %s" % filename + os.system(c)