Rev 1069 | Rev 1130 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1069 | Rev 1116 | ||
---|---|---|---|
Line 67... | Line 67... | ||
67 | // Note that vendor/danielmarschall/php_utils/gmp_supplement.inc.php will implement the GMP functions if BCMath is present. |
67 | // Note that vendor/danielmarschall/php_utils/gmp_supplement.inc.php will implement the GMP functions if BCMath is present. |
68 | // This is the reason why we use function_exists('gmp_init') instead of extension_loaded('gmp') |
68 | // This is the reason why we use function_exists('gmp_init') instead of extension_loaded('gmp') |
69 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
69 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
70 | $install_hint1 = sprintf('On Windows, install it by enabling the line %s in your PHP.ini', |
70 | $install_hint1 = sprintf('On Windows, install it by enabling the line %s in your PHP.ini', |
71 | 'extension=php_gmp.dll'); |
71 | 'extension=php_gmp.dll'); |
72 | $install_hint2 = sprintf('On Windows, it should be installed by default'); |
72 | $install_hint2 = 'On Windows, it should be installed by default'; |
73 | } else { |
73 | } else { |
74 | $install_hint1 = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
74 | $install_hint1 = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
75 | '<code>sudo apt-get update && sudo apt-get install php-gmp</code>', |
75 | '<code>sudo apt-get update && sudo apt-get install php-gmp</code>', |
76 | '<code>sudo service apache2 restart</code>'); |
76 | '<code>sudo service apache2 restart</code>'); |
77 | $install_hint2 = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
77 | $install_hint2 = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
78 | '<code>sudo apt-get update && sudo apt-get install php-bcmath</code>', |
78 | '<code>sudo apt-get update && sudo apt-get install php-bcmath</code>', |
79 | '<code>sudo service apache2 restart</code>'); |
79 | '<code>sudo service apache2 restart</code>'); |
80 | } |
80 | } |
81 | $missing_dependencies[] = 'GMP ('.$install_hint1.')'. |
81 | $missing_dependencies[] = 'GMP ('.$install_hint1.')'. |
82 | '<br>'.sprintf('or alternatively').'<br>' . |
82 | '<br>or alternatively<br>' . |
83 | 'BCMath ('.$install_hint2.')'; |
83 | 'BCMath ('.$install_hint2.')'; |
84 | } |
84 | } |
85 | 85 | ||
86 | if (!extension_loaded('mbstring') && !extension_loaded('iconv')) { |
86 | if (!extension_loaded('mbstring') && !extension_loaded('iconv')) { |
87 | // Required for includes/classes/OIDplusSessionHandler.class.php |
87 | // Required for includes/classes/OIDplusSessionHandler.class.php |
Line 92... | Line 92... | ||
92 | // Note that vendor/symfony/polyfill-mbstring/ will always implement the MBString functions, but they only work if iconv is present. |
92 | // Note that vendor/symfony/polyfill-mbstring/ will always implement the MBString functions, but they only work if iconv is present. |
93 | // This is the reason why we use extension_loaded('mbstring') instead of function_exists('mb_substr') |
93 | // This is the reason why we use extension_loaded('mbstring') instead of function_exists('mb_substr') |
94 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
94 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
95 | $install_hint1 = sprintf('On Windows, install it by enabling the line %s in your PHP.ini', |
95 | $install_hint1 = sprintf('On Windows, install it by enabling the line %s in your PHP.ini', |
96 | 'extension=php_mbstring.dll'); |
96 | 'extension=php_mbstring.dll'); |
97 | $install_hint2 = sprintf('On Windows, it should be installed by default'); |
97 | $install_hint2 = 'On Windows, it should be installed by default'; |
98 | } else { |
98 | } else { |
99 | $install_hint1 = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
99 | $install_hint1 = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
100 | '<code>sudo apt-get update && sudo apt-get install php-mbstring</code>', |
100 | '<code>sudo apt-get update && sudo apt-get install php-mbstring</code>', |
101 | '<code>sudo service apache2 restart</code>'); |
101 | '<code>sudo service apache2 restart</code>'); |
102 | $install_hint2 = sprintf('On Linux, it should be installed by default'); // Alpine Linux: apk add php-iconv |
102 | $install_hint2 = 'On Linux, it should be installed by default'; // Alpine Linux: apk add php-iconv |
103 | } |
103 | } |
104 | $missing_dependencies[] = 'MBString ('.$install_hint1.')'. |
104 | $missing_dependencies[] = 'MBString ('.$install_hint1.')'. |
105 | '<br>'.sprintf('or alternatively').'<br>' . |
105 | '<br>or alternatively<br>' . |
106 | 'iconv ('.$install_hint2.')'; |
106 | 'iconv ('.$install_hint2.')'; |
107 | } |
107 | } |
108 | 108 | ||
109 | if (!function_exists('simplexml_load_file')) { |
109 | if (!function_exists('simplexml_load_file')) { |
110 | // Required for includes/classes/OIDplusPluginManifest.class.php (Plugins) |
110 | // Required for includes/classes/OIDplusPluginManifest.class.php (Plugins) |
111 | // includes/classes/OIDplus.class.php (Translation) |
111 | // includes/classes/OIDplus.class.php (Translation) |
112 | // plugins/viathinksoft/adminPages/400_oidinfo_export/OIDplusPageAdminOIDInfoExport.class.php (Import OID from oid-info.com) |
112 | // plugins/viathinksoft/adminPages/400_oidinfo_export/OIDplusPageAdminOIDInfoExport.class.php (Import OID from oid-info.com) |
113 | // dev/translation/*.phps (only for developers) |
113 | // dev/translation/*.phps (only for developers) |
114 | // Note: This should not happen because of vendor/danielmarschall/php_utils/simplexml_supplement.inc.php |
114 | // Note: This should not happen because of vendor/danielmarschall/php_utils/simplexml_supplement.inc.php |
115 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
115 | if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { |
116 | $install_hint = sprintf('On Windows, it should be installed by default'); |
116 | $install_hint = 'On Windows, it should be installed by default'; |
117 | } else { |
117 | } else { |
118 | $install_hint = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
118 | $install_hint = sprintf('On Linux, install it by running e.g. %s, and then restart your webserver service, e.g. by running %s', |
119 | '<code>sudo apt-get update && sudo apt-get install php-xml</code>', |
119 | '<code>sudo apt-get update && sudo apt-get install php-xml</code>', |
120 | '<code>sudo service apache2 restart</code>'); |
120 | '<code>sudo service apache2 restart</code>'); |
121 | } |
121 | } |