Overview
Comment:Ne pas refaire le process à chaque fois
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 162f2e316fc0cfa4463e0fd8f0519006471e3ec4
User & Date: bohwaz on 2012-09-22 01:21:53
Other Links: manifest | tags
Context
2012-09-25
01:48
Simplification du code saisie compta check-in: 9aef9aa65f user: bohwaz tags: trunk
2012-09-22
01:21
Ne pas refaire le process à chaque fois check-in: 162f2e316f user: bohwaz tags: trunk
01:18
Ne pas sécuriser www/ justement ! check-in: d52b32f592 user: bohwaz tags: trunk
Changes

Modified index.php from [96efc78982] to [8e8c4cdd9a].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

if (!version_compare(phpversion(), '5.3.0', '>='))
{
	die('PHP 5.3.0 ou supérieur est nécessaire au fonctionnement de Garradin.');
}

define('GARRADIN_INSTALL_PROCESS', true);
require __DIR__ . '/include/init.php';

if (!defined('PHP_SAPI'))
{
	header('Location: '.WWW_URL);
	exit;
}

if (preg_match('/^apache/', PHP_SAPI))
{










|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

if (!version_compare(phpversion(), '5.3.0', '>='))
{
	die('PHP 5.3.0 ou supérieur est nécessaire au fonctionnement de Garradin.');
}

define('GARRADIN_INSTALL_PROCESS', true);
require __DIR__ . '/include/init.php';

if (!defined('PHP_SAPI') || file_exists(GARRADIN_ROOT . '/.garradinRootProcessed'))
{
	header('Location: '.WWW_URL);
	exit;
}

if (preg_match('/^apache/', PHP_SAPI))
{
44
45
46
47
48
49
50

51
52
53
54
55
56

57
58
59
60
61
62
63

		if (!preg_match('!^HTTP/[0-9.]+ 302!', $headers[0]))
		{
			unlink(__DIR__ . '/.htaccess');
		}
		else
		{

			header('Location: '.WWW_URL);
			exit;
		}
	}
	else
	{

		file_put_contents(GARRADIN_ROOT . '/config.local.php', '<?php define(\'WWW_URI\', \''.$uri.'\'); ?>');
		header('Location: '.$url);
		exit;
	}
}

// Si serveur non Apache, ou ni RewriteRule ni RedirectMatch ne fonctionnent,







>






>







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

		if (!preg_match('!^HTTP/[0-9.]+ 302!', $headers[0]))
		{
			unlink(__DIR__ . '/.htaccess');
		}
		else
		{
			touch(GARRADIN_ROOT . '/.garradinRootProcessed');
			header('Location: '.WWW_URL);
			exit;
		}
	}
	else
	{
		touch(GARRADIN_ROOT . '/.garradinRootProcessed');
		file_put_contents(GARRADIN_ROOT . '/config.local.php', '<?php define(\'WWW_URI\', \''.$uri.'\'); ?>');
		header('Location: '.$url);
		exit;
	}
}

// Si serveur non Apache, ou ni RewriteRule ni RedirectMatch ne fonctionnent,
81
82
83
84
85
86
87

88
89
90
		'<html><head><title>404 Not Found</title></head><body>' .
		'<h1>Not Found</h1><p>The requested URL was not found on this server.</p>' .
		'</body></html>');
}

$dir->close();


header('Location: '.WWW_URL);

?>







>



83
84
85
86
87
88
89
90
91
92
93
		'<html><head><title>404 Not Found</title></head><body>' .
		'<h1>Not Found</h1><p>The requested URL was not found on this server.</p>' .
		'</body></html>');
}

$dir->close();

touch(GARRADIN_ROOT . '/.garradinRootProcessed');
header('Location: '.WWW_URL);

?>