-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathindex.php
43 lines (32 loc) · 995 Bytes
/
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
<?php
/**
* Part of the LiveCart front controller that is only used when URL rewriting is not available
*
* @author Integry Systems
* @package application
*/
define('NOREWRITE', false);
// Indicates that URL rewriting is disabled
$_GET['noRewrite'] = true;
// Apache: index.php/route
if (preg_match('/^Apache/', $_SERVER['SERVER_SOFTWARE']) && !NOREWRITE)
{
$_GET['route'] = isset($_SERVER['PATH_INFO']) ? substr($_SERVER['PATH_INFO'], 1) : '';
if (substr($_GET['route'], 0, 9) == 'index.php')
{
$_GET['route'] = substr($_GET['route'], 9);
}
if (substr($_GET['route'], 0, 1) == '/')
{
$_GET['route'] = substr($_GET['route'], 1);
}
$_SERVER['virtualBaseDir'] = $_SERVER['SCRIPT_NAME'] . '/';
}
// IIS, etc.: index.php?route=
else
{
$_SERVER['virtualBaseDir'] = $_SERVER['SCRIPT_NAME'] . '?route=';
}
$_SERVER['baseDir'] = dirname($_SERVER['SCRIPT_NAME']) . '/public/';
include dirname(__file__) . '/public/index.php';
?>