aboutsummaryrefslogtreecommitdiffstats
path: root/test/lang.php
blob: 33fc2e0938d92e3a99fe09426eb1151f47cc635b (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
70
71
72
73
74
75
76
77
78
79
80
81
<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/map/index.php';
$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);
} 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_file($test_dir)) {
    echo "The $test_dir is a file\n";
} else {
    echo "The $test_dir is not a file.\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/map/index.php';
$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);
} 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_file($test_dir)) {
    echo "The $test_dir is a file\n";
} else {
    echo "The $test_dir is not a file.\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);