forked from phanbook/phanbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
67 lines (56 loc) · 1.57 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
66
67
<?php
/**
* Phanbook : Delightfully simple forum software
*
* Licensed under The GNU License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @link http://phanbook.com Phanbook Project
* @since 1.0.0
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/
use Phalcon\Http\Response;
use Phalcon\Mvc\Application;
error_reporting(E_ALL);
ini_set('memory_limit', '-1');
// Global constants
define('DS', DIRECTORY_SEPARATOR);
define('ROOT_DIR', dirname(__FILE__) . DS);
define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'local'));
require ROOT_DIR . 'core/config/loader.php';
require ROOT_DIR . 'vendor/autoload.php';
try {
/**
* Include services
*/
require ROOT_DIR . 'core/config/services.php';
/**
* Handle the request
*/
$application = new Application();
/**
* Assign the DI
*/
$application->setDI($di);
/**
* Include modules
*/
$application->registerModules(require ROOT_DIR . 'core/config/modules.php');
/**
* Sets the event manager
*/
$application->setEventsManager($eventsManager);
echo $application->handle()->getContent();
} catch (Exception $e) {
echo $e->getMessage();
echo $e->getTraceAsString();
/**
* Show an static error page
*/
if (!$di->get('config')->application->debug) {
$response = new Response();
$response->redirect('errors/503');
$response->send();
}
}