Rev 1097 | Rev 1130 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1097 | Rev 1116 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | // Do not include anything (except the supplements) yet. |
21 | // Do not include anything (except the supplements) yet. |
22 | // Keep this file clean from fancy syntax sugar, otherwise old PHP versions |
22 | // Keep this file clean from fancy syntax sugar, otherwise old PHP versions |
23 | // will get a compilation error and then they won't see our friendly error message. |
23 | // will get a compilation error and then they won't see our friendly error message. |
24 | // More information about the required PHP version: doc/developer_notes/php7_compat.txt |
24 | // More information about the required PHP version: doc/developer_notes/php7_compat.txt |
25 | 25 | ||
26 | define('INSIDE_OIDPLUS', true); |
26 | const INSIDE_OIDPLUS = true; |
27 | 27 | ||
28 | if (version_compare(PHP_VERSION, $oidplus_min_version='7.0.0') < 0) { |
28 | if (version_compare(PHP_VERSION, $oidplus_min_version='7.0.0') < 0) { |
29 | // Note: These strings are not translated, because in case of an incompatible |
29 | // Note: These strings are not translated, because in case of an incompatible |
30 | // PHP version, we are not able to load language plugins at all. |
30 | // PHP version, we are not able to load language plugins at all. |
31 | $message = '<p>'.sprintf('OIDplus requires at least PHP version %s!<br>You are currently using version %s',$oidplus_min_version,PHP_VERSION).'</p>'; |
31 | $message = '<p>'.sprintf('OIDplus requires at least PHP version %s!<br>You are currently using version %s',$oidplus_min_version,PHP_VERSION).'</p>'; |
Line 50... | Line 50... | ||
50 | require_once __DIR__ . '/oidplus_dependency.inc.php'; |
50 | require_once __DIR__ . '/oidplus_dependency.inc.php'; |
51 | $missing_dependencies = oidplus_get_missing_dependencies(); |
51 | $missing_dependencies = oidplus_get_missing_dependencies(); |
52 | if (count($missing_dependencies) >= 1) { |
52 | if (count($missing_dependencies) >= 1) { |
53 | // Note that there are no translations _L() because if we get an error at this |
53 | // Note that there are no translations _L() because if we get an error at this |
54 | // stage, then we have no language plugins anyways. |
54 | // stage, then we have no language plugins anyways. |
55 | $message = '<p>'.sprintf('The following PHP extensions need to be installed in order to run OIDplus:').'</p>'; |
55 | $message = '<p>The following PHP extensions need to be installed in order to run OIDplus:</p>'; |
56 | $message .= '<p><ul>'; |
56 | $message .= '<p><ul>'; |
57 | foreach ($missing_dependencies as $dependency) { |
57 | foreach ($missing_dependencies as $dependency) { |
58 | $message .= '<li>'.$dependency.'<br><br></li>'; |
58 | $message .= '<li>'.$dependency.'<br><br></li>'; |
59 | } |
59 | } |
60 | $message .= '</ul></p>'; |
60 | $message .= '</ul></p>'; |
Line 83... | Line 83... | ||
83 | require_once __DIR__ . '/oidplus_autoloader.inc.php'; |
83 | require_once __DIR__ . '/oidplus_autoloader.inc.php'; |
84 | 84 | ||
85 | // Functions |
85 | // Functions |
86 | 86 | ||
87 | function oidplus_dependency_panic($message)/*: never*/ { |
87 | function oidplus_dependency_panic($message)/*: never*/ { |
88 | $title = sprintf('OIDplus startup error'); |
88 | $title = 'OIDplus startup error'; |
89 | if (PHP_SAPI === 'cli') { |
89 | if (PHP_SAPI === 'cli') { |
90 | $message = str_replace('<li>', "- ", $message); |
90 | $message = str_replace('<li>', "- ", $message); |
91 | $message = str_replace('<br>', "\n", $message); |
91 | $message = str_replace('<br>', "\n", $message); |
92 | $message = str_replace('</p>', "\n\n", $message); |
92 | $message = str_replace('</p>', "\n\n", $message); |
93 | $message = trim(strip_tags($message)); |
93 | $message = trim(strip_tags($message)); |