-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
66 lines (54 loc) · 1.92 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
<?php
/*=========================================================================
MIDAS Server
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
69328 Lyon, FRANCE.
See Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
if(function_exists('apache_get_modules'))
{
$modules = apache_get_modules();
$mod_rewrite = in_array('mod_rewrite', $modules);
}
else
{
$mod_rewrite = getenv('HTTP_MOD_REWRITE') == 'On' ? true : false;
}
if(!$mod_rewrite)
{
echo "Please install/enable the module rewrite";
exit;
}
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'on');
set_include_path('.'
. PATH_SEPARATOR . './library'
. PATH_SEPARATOR . './core/dao/'
. PATH_SEPARATOR . get_include_path());
define('BASE_PATH', realpath(dirname(__FILE__)));
if(!is_writable(BASE_PATH."/core/configs") || !is_writable(BASE_PATH."/log") || !is_writable(BASE_PATH."/data") || !is_writable(BASE_PATH."/tmp"))
{
echo "To use Midas, the following repertories have to be writable by apache:
<ul>
<li>".BASE_PATH."/core/configs</li>
<li>".BASE_PATH."/log</li>
<li>".BASE_PATH."/data</li>
<li>".BASE_PATH."/tmp</li>
</ul>";
exit();
}
// remember me cookie lifetime
//ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 15); //15 days
define('START_TIME', microtime(true));
require_once 'Zend/Loader/Autoloader.php';
require_once 'Zend/Application.php';
$loader = Zend_Loader_Autoloader::getInstance();
$loader->registerNamespace('App_');
require_once(BASE_PATH . "/core/include.php");
// Create application, bootstrap, and run
$application = new Zend_Application('global', CORE_CONFIG);
$application->bootstrap()
->run();