-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathindex.php
More file actions
64 lines (41 loc) · 1.96 KB
/
index.php
File metadata and controls
64 lines (41 loc) · 1.96 KB
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
<?php
/**
* Index file of the hebrew's php-communty website
* @link http://phpguide.co.il
* @author Alex Raskin (Alex@phpguide.co.il)
* Based on YiiFramework {@link http://yiiframework.com}
* @license BSD Licence as stated in Readme.md
*/
/************************************************************************/
/****** ANY CHANGES SHOULD BE APPLIED IN CONFIG/LOCAL_CONFIG.PHP ********/
/************************************************************************/
if (preg_match('/\.(?:png|jpg|jpeg|gif|css|js|less|coffee|sass)$/', $_SERVER["REQUEST_URI"])) {
return false;
}
// determine whether this is production environment
$localIPs = ['::ffff:127.0.0.1', '::1', '127.0.0.1', '33.33.33.1'];
$production = !in_array( $_SERVER['REMOTE_ADDR'] , $localIPs);
// Config path
$config = require __DIR__.'/protected/config/config.php';
// add composer packages
require __DIR__.'/protected/vendors/composerPackages/autoload.php';
$diEnvironmentConf = 'production';
// fix ip behind incapsula
(new \Intval\IncapsulaIpFixer($_SERVER))->FixRemoteAddrInServerArray();
if( !$production )
{
// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
// EVERY CHANGE you'd like to make to the config file which should affect
// *local application ONLY* - make inside this file.
// has a function to adjust config for local env
require __DIR__.'/protected/config/local_config.php';
// include local dependency injection configuration
$diEnvironmentConf='local';
}
// use light version in production
require_once($config['params']['PATH_TO_YII'].'/yii'.($production ? 'lite' : '').'.php');
require_once(__DIR__.'/protected/sources/global_functions.php');
Yii::createWebApplication($config)->run();