-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
47 lines (40 loc) · 1.58 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
<?php
/**
* This is the main file of Spitfire, it is in charge of loading
* system settings (for custom operation) and also of summoning
* spitfire and loading the adequate controller for every single
* request. It also makes sure that error logging is sent to
* terminal / log file instead of to the user.
*
* @package Spitfire
* @author C�sar de la Cal <[email protected]>
* @copyright 2012 Magic3W - All rights reserved
*/
/* Define bootstrap settings. Environments are a better way to handle
* config but we need to create them first.
*/
define ('BASEDIR', rtrim(dirname(__FILE__),'\/'));
define ('APP_DIRECTORY', 'bin/apps/');
define ('CONFIG_DIRECTORY', 'bin/settings/');
define ('CONTROLLERS_DIRECTORY', 'bin/controllers/');
define ('ASSET_DIRECTORY', 'assets/');
define ('TEMPLATES_DIRECTORY', 'bin/templates/');
define ('SESSION_SAVE_PATH', 'bin/usr/sessions/');
/* Set error handling directives. AS we do not want Apache / PHP
* to send the data to the user but to our terminal we will tell
* it to output the errors. Thanks to this linux command:
* # tail -f *logfile*
* We can watch errors happening live. Grepping them can also help
* filtering.
*/
ini_set("log_errors" , 1);
ini_set("error_log" , "logs/error_log.log");
ini_set("display_errors" , 0);
/* Include Spitfire core.
*/
include __DIR__ . '/vendor/autoload.php';
include __DIR__ . '/spitfire/bootstrap.php';
include __DIR__ . '/bin/settings/services.php';
ini_set('memory_limit', '128M');/**/
/* Call the selected controller with the selected method. */
spitfire()->fire();