-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
35 lines (31 loc) · 867 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
<?php
/**
* Created by PhpStorm.
* User: cren
* Date: 16/7/9
* Time: 上午1:07
*/
define('ENVIRONMENT', 'development');
switch (ENVIRONMENT)
{
case 'development':
case 'testing':
ini_set("display_errors","on");
error_reporting(E_ALL ^ E_DEPRECATED);
break;
case 'production':
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(mb_encoding_aliases(encoding) & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}