summaryrefslogtreecommitdiffstats
path: root/public/index.php
blob: 79348520e7ef2b0b8065daa13ee8d032f20fdbf3 (plain) (blame)
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
<?php
/*
 * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
 * This program is free software distributed under the GPL version 2.
 * See http://gpl.openslx.org/
 *
 * If you have any feedback please consult http://feedback.openslx.org/ and
 * send your suggestions, praise, or complaints to feedback@openslx.org
 *
 * General information about OpenSLX can be found at http://openslx.org/
 */
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
                           realpath(APPLICATION_PATH . '/../library'),
                           get_include_path(),
                         )));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application
$application = new Zend_Application(
  APPLICATION_ENV,
  APPLICATION_PATH . '/configs/application.ini'
);

// Set Session lifetime
if(stristr($_SERVER['HTTP_USER_AGENT'], 'prebootGUI'))
  { Zend_Session::setOptions(array('cookie_lifetime' => null)); }
else {
  Zend_Session::setOptions(array('cookie_lifetime' => null));
  Zend_Session::setOptions(array('gc_maxlifetime' => '1800'));
}
// Run bootstrap
$application->bootstrap()
->run();