2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * This test script checks all the language files to ensure there is no errors
5 * inside and nothing is displayed on screen (eg no extra no blank line).
8 * @package phpMyAdmin-test
18 $languageDirectory = dir('../lang');
19 while ($name = $languageDirectory->read()) {
20 if (strpos($name, '.inc.php')) {
21 // 1.1 Checks parse errors and extra blank line
22 include '../lang/' . $name;
23 header('X-Ping: pong');
25 $content = fread(fopen('../lang/' . $name, 'r'), filesize('../lang/' . $name));
26 if ($pos = strpos(' ' . $content, "\015")) {
33 $languageDirectory->close();
35 // 2. Checking results
37 $failed_cnt = count($failed);
39 $passed_cnt = count($passed);
41 echo ($failed_cnt +
$passed_cnt) . ' language files were checked.<br /><br />' . "\n";
43 echo ' 1. ' . $failed_cnt . ' contain(s) some "^M":<br />' . "\n";
44 for ($i = 0; $i < $failed_cnt; $i++
) {
45 echo ' - ' . $failed[$i] . '<br />' . "\n";
49 echo ' 2. ' . $passed_cnt . ' seems right:<br />' . "\n";
50 $start = ' ';
55 echo 'They all passed checkings:<br />' . "\n";
57 for ($i = 0; $i < $passed_cnt; $i++
) {
58 echo $start . ' - ' . $passed[$i] . '<br />' . "\n";