aboutsummaryrefslogtreecommitdiffstats
path: root/test/lang.php
blob: f41c50955df655da3b790077829adf4a20609b94 (plain)
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
<pre><?php
/**
*/

include_once '../localeDetection.class.php';
include_once '../langs.inc.php';

echo 'Accept-Language: ', $_SERVER['HTTP_ACCEPT_LANGUAGE'], "\n\n";
echo "Relocate `community` with `en` as a default: ", relocate($langs, 'community', 'en', null, false), "\n";

echo "\nTests:\n";

$test_dir = '../sv/';
$lstat = '';

if (file_exists($test_dir)) {
    echo "The file $test_dir exists\n";
    $lstat = lstat($test_dir);
//     $linkinfo = linkinfo($test_dir);
    $readlink = readlink($test_dir . 'map');
} else {
    echo "The file $test_dir does not exist\n";
}

if (is_dir($test_dir)) {
    echo "The $test_dir is a dir\n";
} else {
    echo "The $test_dir is not a dir.\n";
}

if (is_readable($test_dir)) {
    echo "The file $test_dir is readable\n";
} else {
    echo "The file $test_dir is not readable\n";
}

var_dump($lstat);
var_dump($readlink);


$test_dir = '../sl/';
$lstat2 = '';

if (file_exists($test_dir)) {
    echo "The file $test_dir exists\n";
    $lstat2 = lstat($test_dir);
//     $linkinfo = linkinfo($test_dir);
    $readlink = readlink($test_dir . 'map');
} else {
    echo "The file $test_dir does not exist\n";
}

if (is_dir($test_dir)) {
    echo "The $test_dir is a dir\n";
} else {
    echo "The $test_dir is not a dir.\n";
}

if (is_readable($test_dir)) {
    echo "The file $test_dir is readable\n";
} else {
    echo "The file $test_dir is not readable\n";
}

var_dump($lstat2);
var_dump($readlink);

$diff = array_diff($lstat, $lstat2);
var_dump($diff);