[% USE Uapi; USE JSON; USE EasyApache; SET CPANEL.CPVAR.dprefix = "../"; SET styleSheets = [ "multiphp_ini_editor/index.css" ]; SET locale_is_rtl = 0; # Add RTL stylesheet if necessary. IF locale.get_html_dir_attr() == 'rtl'; SET locale_is_rtl = 1; styleSheets.push("libraries/bootstrap-rtl/optimized/dist/css/bootstrap-rtl.min.css"); END; SET ea_version = EasyApache.get_ea_version(); SET ea_conf = EasyApache.get_ea_conf(); SET oldest_supported_version = ea_conf.oldest_supported_version; SET default_php_package = ea_conf.default_php_package; SET suppress_php_eol_status = EasyApache.should_suppress_eol_status(); %] [% WRAPPER '_assets/master.html.tt' app_key = 'multiphp_ini_editor' include_legacy_stylesheets = 0 include_legacy_scripts = 0 include_cjt = 0 use_master_bootstrap = 0 page_stylesheets = styleSheets -%] [% IF ea_version >= 4 -%] [% SET ini_paths_data = Uapi.exec('LangPHP', 'php_ini_get_user_paths', {}) -%] [%# Use the actual system default PHP version from the API response instead of ea4-metainfo.json, which may reference an uninstalled version. -%] [% SET found_home = 0 -%] [% FOREACH path IN ini_paths_data.data.paths -%] [% IF path.type == 'home' -%] [% SET default_php_package = path.version -%] [% SET found_home = 1 -%] [% END -%] [% END -%] [% IF !found_home -%] [% SET sys_default = Uapi.exec('LangPHP', 'php_get_system_default_version', {}) -%] [% IF sys_default.data.version -%] [% SET default_php_package = sys_default.data.version -%] [% END -%] [% END -%]