forked from OXID-eSales/paypal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_system_requirements.php
105 lines (97 loc) · 3.36 KB
/
check_system_requirements.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
* This file is part of OXID eSales PayPal module.
*
* OXID eSales PayPal module is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OXID eSales PayPal module is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OXID eSales PayPal module. If not, see <http://www.gnu.org/licenses/>.
*
* @link http://www.oxid-esales.com
* @copyright (C) OXID eSales AG 2003-2014
*/
//error boolean. Set to true if error appears
$blError = false;
/**
* Prints error message
*
* @param string $sError Error message to be printed
* @param string $sAction Suggestion for to be taken action
*/
function printError($sError, $sAction)
{
echo "<br>";
echo ' <b><font color="red">Fehler:</font></b> ' . $sError . '<br>';
echo ' <b>Maßnahme:</b> ' . $sAction . '<br><br>';
}
/**
* Prints warning message
*
* @param string $sError Error message to be printed
* @param string $sAction Suggestion for to be taken action
*
*/
function printWarning($sError, $sAction)
{
echo "<br>";
echo ' <b><font color="orange">Warnung:</font></b> ' . $sError . '<br>';
echo ' <b>Maßnahme:</b> ' . $sAction . '<br><br>';
}
/**
* Prints OK message
*
* @param string $sNote additional note
*
*/
function printOk($sNote = '')
{
if ($sNote) {
$sNote = ' ' . $sNote;
}
echo " <b><font color='green'>OK</font></b>$sNote<br><br>";
}
// check php version and zend decoder
echo 'Teste PHP-Version. ';
$sPhpVersion = '';
if (version_compare('5.4', phpversion()) < 0) {
$sPhpVersion = '5.4';
printOK();
} elseif (version_compare('5.3', phpversion()) < 0) {
$sPhpVersion = '5.3';
printOK();
} elseif (version_compare('5.2', phpversion()) < 0) {
$sPhpVersion = '5.2';
printOK();
} else {
printError("PHP 5.2 oder 5.3 oder 5.4 wird vorausgesetzt. Installiert ist jedoch: " . phpversion(), ". Bitte PHP 5.2.x oder größer verwenden.");
$blError = true;
}
//CURL installed?
echo 'Teste ob CURL installiert ist.';
if (extension_loaded('curl')) {
printOk();
} else {
printError('CURL nicht verfügbar.', 'Bitte Installieren Sie CURL für PHP. Weitere Hinweise in der <a href="http://de2.php.net/manual/en/book.curl.php" target="_blank">PHP Dokumentation</a>.');
$blError = true;
}
//OpenSSL installed?
echo 'Teste ob OpenSSL installiert ist.';
if (extension_loaded('openssl')) {
printOk();
} else {
printError('OpenSSL ist nicht verfügbar.', 'Bitte Installieren Sie OpenSSL für PHP. Weitere Hinweise in der <a href="http://de3.php.net/manual/de/book.openssl.php" target="_blank">PHP Dokumentation</a>.');
$blError = true;
}
if ($blError) {
echo '<b><font color="red">Die Systemvoraussetzungen sind nicht erfüllt.</font></b>';
} else {
echo '<b><font color="green">Glückwunsch. Die Systemvoraussetzungen sind erfüllt. Sie können das PayPal Modul installieren.</font></b>';
}