1
1
<?php
2
2
3
- if (!defined ('MCRYPT_RIJNDAEL_256 ' ))
4
- {
5
- define ('MCRYPT_RIJNDAEL_256 ' ,0 );
3
+ if (!defined ('MCRYPT_RIJNDAEL_256 ' )) {
4
+ define ('MCRYPT_RIJNDAEL_256 ' , 0 );
6
5
}
7
6
8
- if (!defined ('MCRYPT_MODE_CBC ' ))
9
- {
10
- define ('MCRYPT_MODE_CBC ' ,0 );
7
+ if (!defined ('MCRYPT_MODE_CBC ' )) {
8
+ define ('MCRYPT_MODE_CBC ' , 0 );
11
9
}
12
10
13
- define ("GENERATE_NEW_TOKEN " , 2675 );
11
+ define ("GENERATE_NEW_TOKEN " , 2675 );
14
12
15
- define ("DEFAULT_ALLOWED_REQUEST_METHOD " , "GET " );
13
+ define ("DEFAULT_ALLOWED_REQUEST_METHOD " , "GET " );
16
14
17
- define ("UNDEFINED " , null );
15
+ define ("UNDEFINED " , null );
18
16
19
17
class Config
20
18
{
21
19
private static $ app = array
22
- (
20
+ (
23
21
'templates.path ' => './app/view ' ,
24
22
'mode ' => 'development ' ,
25
23
'debug ' => false ,
@@ -35,16 +33,16 @@ class Config
35
33
'http.version ' => '1.1 ' ,
36
34
'language ' => 'persian ' ,
37
35
'IpLocationApiAddress ' => 'http://ip-api.com/json/ ' ,
38
- 'encryptKeySize ' => 32 ,
39
- 'encryptSecretKey ' => 'bc5b9275bd794ac47581114b66d14d81076 ' ,
36
+ 'cipher ' => ' aes-128-cbc ' ,
37
+ 'encryptSecretKey ' => 'f080dd2e74286c45953d934380ebecbaf7708a9dd5580c1b70837106c5380915 ' ,
40
38
'api_key_regenerate_time ' => 60000 ,
41
39
//CROSS DOMAIN REQUEST CONFIGURATION;
42
40
'Cross-Domain-Request ' => false ,
43
- 'Access-Control-Allow-Origin ' => 'http://localhost:9000 ' ,
44
- 'Access-Control-Allow-Methods ' => 'GET, POST, PUT, DELETE, OPTIONS ' ,
45
- 'Access-Control-Allow-Headers ' => 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Token ' ,
46
- 'Access-Control-Allow-Credentials ' => 'true ' ,
47
- 'JSON-Content-Type ' => 'application/json; charset=utf-8 ' ,
41
+ 'Access-Control-Allow-Origin ' => 'http://localhost:2000 ' ,
42
+ 'Access-Control-Allow-Methods ' => 'GET, POST, PUT, DELETE, OPTIONS ' ,
43
+ 'Access-Control-Allow-Headers ' => 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Token ' ,
44
+ 'Access-Control-Allow-Credentials ' => 'true ' ,
45
+ 'JSON-Content-Type ' => 'application/json; charset=utf-8 ' ,
48
46
);
49
47
50
48
private static $ database = [
@@ -53,32 +51,30 @@ class Config
53
51
'database ' => '' ,
54
52
'username ' => '' ,
55
53
'password ' => '' ,
56
- 'prefix ' => '' ,
57
- 'charset ' => "utf8 " ,
58
- 'collation ' => "utf8_unicode_ci "
54
+ 'prefix ' => '' ,
55
+ 'charset ' => "utf8 " ,
56
+ 'collation ' => "utf8_unicode_ci " ,
59
57
];
60
58
61
59
public static function app ($ key = null )
62
60
{
63
61
self ::$ app ['view ' ] = new \JsonView ();
64
- self ::$ app ['webDirectory ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../../web/ ' ;
65
- self ::$ app ['rootDirectory ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../../ ' ;
66
- self ::$ app ['uploadStorage ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../../web/uploads/ ' ;
67
- self ::$ app ['languageDirectory ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../languages/ ' ;
68
- self ::$ app ['rulesDirectory ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../rules/ ' ;
69
- self ::$ app ['seedsDirectory ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../seeds/ ' ;
70
- self ::$ app ['fakerAutoloader ' ] = __DIR__ .DIRECTORY_SEPARATOR .'../../vendor/fzaninotto/faker/src/autoload.php ' ;
71
- if (!is_null ($ key ))
72
- {
62
+ self ::$ app ['webDirectory ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../../web/ ' ;
63
+ self ::$ app ['rootDirectory ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../../ ' ;
64
+ self ::$ app ['uploadStorage ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../../web/uploads/ ' ;
65
+ self ::$ app ['languageDirectory ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../languages/ ' ;
66
+ self ::$ app ['rulesDirectory ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../rules/ ' ;
67
+ self ::$ app ['seedsDirectory ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../seeds/ ' ;
68
+ self ::$ app ['fakerAutoloader ' ] = __DIR__ . DIRECTORY_SEPARATOR . '../../vendor/fzaninotto/faker/src/autoload.php ' ;
69
+ if (!is_null ($ key )) {
73
70
return self ::$ app [$ key ];
74
71
}
75
72
return self ::$ app ;
76
73
}
77
74
public static function database ($ key = null )
78
75
{
79
- self ::$ database = require __DIR__ .DIRECTORY_SEPARATOR ."Database.php " ;
80
- if (!is_null ($ key ))
81
- {
76
+ self ::$ database = require __DIR__ . DIRECTORY_SEPARATOR . "Database.php " ;
77
+ if (!is_null ($ key )) {
82
78
return self ::$ database [$ key ];
83
79
}
84
80
return self ::$ database ;
0 commit comments