3 // vim: expandtab sw=4 ts=4 sts=4 foldmarker={,} fdm=marker:
7 * This test script checks all the language files to ensure there is no errors
8 * inside and nothing is displayed on screen (eg no extra no blank line).
14 $languageDirectory = dir('../lang');
15 while ($name = $languageDirectory->read()) {
16 if (strpos($name, '.inc.php3')) {
17 // 1.1 Checks parse errors and extra blank line
18 include('../lang/' . $name);
19 header('X-Ping: pong');
21 $content = fread(fopen('../lang/' . $name, 'r'), filesize('../lang/' . $name));
22 if ($pos = strpos(' ' . $content, "\015")) {
29 $languageDirectory->close();
31 // 2. Checking results
33 $failed_cnt = count($failed);
35 $passed_cnt = count($passed);
37 echo ($failed_cnt +
$passed_cnt) . ' language files were checked.<br /><br />' . "\n";
39 echo ' 1. ' . $failed_cnt . ' contain(s) some "^M":<br />' . "\n";
40 for ($i = 0; $i < $failed_cnt; $i++
) {
41 echo ' - ' . $failed[$i] . '<br />' . "\n";
45 echo ' 2. ' . $passed_cnt . ' seems right:<br />' . "\n";
46 $start = ' ';
51 echo 'They all passed checkings:<br />' . "\n";
53 for ($i = 0; $i < $passed_cnt; $i++
) {
54 echo $start . ' - ' . $passed[$i] . '<br />' . "\n";