forked from justdeleteme/justdelete.me
-
Notifications
You must be signed in to change notification settings - Fork 0
/
static-gen.php
57 lines (50 loc) · 1.02 KB
/
static-gen.php
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
<?php
$langs = ['en', 'it', 'de', 'fr', 'ru', 'pt_br', 'cat', 'es'];
foreach ($langs as $language)
{
// start the output buffer
ob_start(); ?>
<?php
$lang = $language;
if ($lang == "en") {
$full_name = "English";
}
if ($lang == "it") {
$full_name = "Italiano";
}
if ($lang == "de") {
$full_name = "Deutsch";
}
if ($lang == "fr") {
$full_name = "Français";
}
if ($lang == "ru") {
$full_name = "Pусский";
}
if ($lang == "pt_br") {
$full_name = "Português";
}
if ($lang == "cat") {
$full_name = "Català";
}
if ($lang == "es") {
$full_name = "Español";
}
include ('dev.php');
if ($language == "en")
{
$cachefile = "index.html";
}
else {
$cachefile = $language.".html";
}
// open the cache file "cache/home.html" for writing
$fp = fopen($cachefile, 'w');
// save the contents of output buffer to the file
fwrite($fp, ob_get_contents());
// close the file
fclose($fp);
// Send the output to the browser
ob_end_flush();
}
?>