-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patherror.php
94 lines (86 loc) · 2.28 KB
/
error.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/**
* SeekQuarry/Yioop --
* Open Source Pure PHP Search Engine, Crawler, and Indexer
*
* Copyright (C) 2009 - 2012 Chris Pollett [email protected]
*
* LICENSE:
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* END LICENSE
*
* Web page used to display information about the crawler component of
* the SeekQuarry/Yioop Search engine
*
* @author Chris Pollett [email protected]
* @package seek_quarry
* @subpackage static
* @license http://www.gnu.org/licenses/ GPL3
* @link http://www.seekquarry.com/
* @copyright 2009 - 2012
* @filesource
*/
/** Calculate base directory of script
* @ignore
*/
$pathinfo = pathinfo($_SERVER['SCRIPT_FILENAME']);
if(!defined('BASE_DIR')) {
define("BASE_DIR", $pathinfo["dirname"].'/');
}
/**
* Load the configuration file
*/
require_once(BASE_DIR.'configs/config.php');
/**
* Used to set-up static error pages
*/
require_once(BASE_DIR."/controllers/static_controller.php");
/**
* Load global functions related to localization
*/
require_once BASE_DIR."/lib/locale_functions.php";
mb_internal_encoding("UTF-8");
mb_regex_encoding("UTF-8");
$locale_tag = guessLocale();
$locale = NULL;
setLocaleObject($locale_tag);
if(!isset($_REQUEST['p']) ||
!in_array($_REQUEST['p'], array("404", "409"))) {
$_REQUEST['p'] = "404";
}
switch($_REQUEST['p'])
{
case "404":
header("HTTP/1.0 404 Not Found");
break;
case "409":
header("HTTP/1.0 409 Conflict");
break;
}
$controller = new StaticController();
$controller->processRequest();
/**
* shorthand for echo
*
* @param string $text string to send to the current output
*/
if(!function_exists("e")) {
function e($text)
{
echo $text;
}
}
?>