summaryrefslogtreecommitdiffstats
path: root/public/index.php
blob: e0a1a7ee480d96c6b0a15a432c5922567d1a0882 (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
<?php
// 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' => '3600'));
else 
	Zend_Session::setOptions(array('cookie_lifetime' => '36000'));

// Run bootstrap
$application->bootstrap()
->run();