Add dirty trick to be able to install php5 apps

This commit is contained in:
Alexandre Aubin 2017-08-28 20:12:33 +02:00
parent 7d36869fe0
commit 1054633310

View file

@ -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)