-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
executable file
·77 lines (77 loc) · 2.67 KB
/
index.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
$maintenance_mode = 0;
if (!$maintenance_mode && file_exists(dirname(__FILE__) . '/app/share/core/lib/index.php')) {
require 'app/share/core/lib/index.php';
} else {
// definition de quelques constantes de base
if (!defined('__BASE_URL__')) {
$tmp = substr(__FILE__, strlen(preg_replace('/\/$/', '', $_SERVER['DOCUMENT_ROOT'])));
$tmp = substr($tmp, 0, - strlen('/index.php'));
$uname = explode(' ', php_uname('s'));
define('__OS__', strtolower($uname[0]));
if (__OS__ == 'windows') {
$tmp = str_replace('\\', '/', $tmp);
}
define('__BASE_URL__', $tmp);
}
define('__FILES_ROOT__' , str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'] . __BASE_URL__));
$protocol = 'http://';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {
$protocol = 'https://';
}
$www_root = $_SERVER['SERVER_NAME'];
if (!empty($_SERVER['HTTP_HOST'])) {
$www_root = $_SERVER['HTTP_HOST'];
}
define('__WWW_ROOT__' , $protocol . $www_root . __BASE_URL__);
$maintenance_file = 'app/local/site/maintenance.php';
if (file_exists($maintenance_file)) {
require $maintenance_file;
} else {
?><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Installation de Clémentine</title>
<link rel="stylesheet" href="<?php echo __WWW_ROOT__; ?>/install/style.css" type="text/css" media="screen" charset="utf-8" />
</head>
<body>
<div id="wrapper">
<div id="main">
<h1>Merci d'avoir choisi Clémentine</h1>
<?php
if (!is_dir(__FILES_ROOT__ . '/install')) {
?>
<p>
Avant toute chose, vous devez <a href="http://clementine.quai13.com/modules/install.zip">récupérer l'installeur</a> et le décompresser à la racine du site.
</p>
<p>
Puis <a href="" target="">rafraîchissez cette page</a>.
</p>
<?php
} else {
?>
<p>
<fieldset id="Astuce">
<legend>Astuce</legend>
Le fichier <em><?php echo $maintenance_file; ?></em> s'affichera à la place de cette page s'il existe.
</fieldset>
</p>
<div class="boutons">
<a class="next" href="<?php echo __WWW_ROOT__; ?>/install/">Lancer l'installation</a>
</div>
<?php
}
?>
</div>
</div>
</body>
</html><?php
}
}
$php_self = strtolower(preg_replace('/-.*/', '',
preg_replace('/.*\//', '', $_SERVER['PHP_SELF'])));
if ($php_self == 'phpunit') {
// prevent error "Class 'index' could not be found in '.../index.php'."
die();
}