commit | author | age
|
8bd4d9
|
1 |
<?php |
JK |
2 |
function test($name, $expr) { |
|
3 |
echo '<tr> <td>'.$name.'</td> <td>'; |
|
4 |
if($expr) { |
|
5 |
echo '<strong style="color:darkgreen">OK</strong><br />'; |
|
6 |
} |
|
7 |
else |
|
8 |
{ |
|
9 |
echo '<strong style="color:red">FAIL</strong><br />'; |
|
10 |
} |
|
11 |
echo '</td> </tr>'."\n"; |
|
12 |
} |
|
13 |
|
|
14 |
function testdir($dir) { |
|
15 |
test($dir, is_writable($dir)); |
|
16 |
} |
|
17 |
|
|
18 |
echo '<table> |
|
19 |
<tr> <th class="head" colspan="2">Interpreter PHP</th> </tr> |
|
20 |
'; |
|
21 |
test('Wersja PHP >= 5.2', version_compare(PHP_VERSION, '5.2.0', '>=')); |
|
22 |
test('magic_quotes_gpc = Off', (get_magic_quotes_gpc() == 0)); |
|
23 |
test('allow_url_fopen = On', (ini_get('allow_url_fopen') == 1)); |
|
24 |
test('setlocale(pl_PL.UTF8)', setlocale(LC_CTYPE, 'pl_PL.UTF8', 'pl_PL', 'polish', 'plk')); |
a73464
|
25 |
test('proc_open(\'aspell\')', ($p=@proc_open('aspell', array(array('pipe', 'r'), array('pipe', 'w'), array('file', '/dev/null', 'w')), $pipe)) !== FALSE); |
JK |
26 |
@proc_close($p); |
8bd4d9
|
27 |
|
JK |
28 |
echo '<tr> <th class="head" colspan="2">Rozszerzenia PHP</th> </tr> |
|
29 |
'; |
|
30 |
test('cURL', function_exists('curl_init')); |
|
31 |
test('mbstring', function_exists('mb_strlen')); |
|
32 |
test('iconv', function_exists('iconv')); |
|
33 |
test('Ctype', function_exists('ctype_digit')); |
|
34 |
test('DOM', class_exists('DOMDocument')); |
|
35 |
test('SimpleXML', class_exists('SimpleXMLElement')); |
|
36 |
test('PDO', class_exists('PDO')); |
|
37 |
test('PDO SQLite', in_array('sqlite', PDO::getAvailableDrivers())); |
|
38 |
|
|
39 |
echo '<tr> <th class="head" colspan="2">Prawa do zapisu w katalogach</th> </tr> |
|
40 |
'; |
|
41 |
testdir('./cache'); |
|
42 |
testdir('./data'); |
|
43 |
testdir('./data/humor'); |
|
44 |
testdir('./data/humor/archiwum'); |
|
45 |
testdir('./data/kurs'); |
|
46 |
testdir('./data/kurs/archiwum'); |
|
47 |
testdir('./data/lotto'); |
|
48 |
testdir('./data/lotto/archiwum'); |
|
49 |
testdir('./data/pogoda'); |
|
50 |
testdir('./data/rss'); |
|
51 |
testdir('./data/tv'); |
|
52 |
testdir('./data/tv/cache'); |
4be773
|
53 |
if(is_dir('./db')) { |
1a5b21
|
54 |
testdir('./db'); |
d22cb4
|
55 |
} |
1a5b21
|
56 |
testdir('./database'); |
8bd4d9
|
57 |
|
JK |
58 |
echo '</table>'; |
|
59 |
?> |