-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.php
executable file
·42 lines (34 loc) · 1013 Bytes
/
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
<?php
/**
* Defined useful constant
*/
date_default_timezone_set('Asia/Bangkok');
ini_set('session.cookie_domain', '.newpj.site');
define('FLAG_DEBUG', true);
define('ROOT_PATH', realpath('..')); // not have end slash
define('DS', DIRECTORY_SEPARATOR);
/**
* Detect sub domain for routing
*/
$sudomaininfo = explode(".",$_SERVER['HTTP_HOST']);
define('SUBDOMAIN', array_shift($sudomaininfo));
/**
* Versions Required.
*/
define('PHALCONJUMPSTART_VERSION', '0.1');
define('PHALCON_VERSION_REQUIRED', '1.3');
define('PHP_VERSION_REQUIRED', '5.4');
/**
* Check phalcon framework installation.
*/
if (!extension_loaded('phalcon')) {
printf('Install Phalcon framework %s', PHALCON_VERSION_REQUIRED);
exit(1);
}
// Using require once because I want to get the specific
// bootloader class here. The loader will be initialized
// in my bootstrap class
require_once ROOT_PATH . '/libs/Fly/Bootstrap.php';
$di = new \Phalcon\DI\FactoryDefault();
$app = new \Fly\Bootstrap($di);
echo $app->run([]);