File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
src/orange/cfhelper/configuration Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1010 }
1111 ],
1212 "require" : {
13- "arhframe/iocart" : " 1.0.1"
13+ "arhframe/iocart" : " 1.0.1" ,
14+ "filp/whoops" : " 1.1.1"
1415 },
1516 "autoload" : {
1617 "psr-0" : {
Original file line number Diff line number Diff line change @@ -17,10 +17,38 @@ class PhpIniConfigurator
1717 public static $ servicePhpIniName = 'php-ini ' ;
1818 private $ serviceManager ;
1919 private $ applicationInfo ;
20+ private $ config = array ();
2021
2122 function __construct ()
2223 {
24+ $ this ->loadConfigCfHelper ();
25+ }
26+
27+ public function loadConfigCfHelper ()
28+ {
29+ if (!is_file (__DIR__ . '/../../../../../../../composer.json ' )) {
30+ return ;
31+ }
32+ $ composerJson = json_decode (file_get_contents (__DIR__ . '/../../../../../../../composer.json ' ), true );
33+ if (empty ($ composerJson ['cfhelper ' ])) {
34+ return ;
35+ }
36+ $ this ->config = $ composerJson ['cfhelper ' ];
37+ $ this ->loadConfig ();
38+ }
2339
40+ public function loadConfig ()
41+ {
42+ if (!empty ($ this ->config ['type ' ]) && $ this ->config ['type ' ] == 'development ' ) {
43+ ini_set ("display_errors " , "On " );
44+ ini_set ("error_reporting " , -1 );
45+ $ whoops = new \Whoops \Run ;
46+ $ whoops ->pushHandler (new \Whoops \Handler \PrettyPageHandler );
47+ $ whoops ->register ();
48+ } else {
49+ ini_set ("display_errors " , "Off " );
50+ ini_set ("error_reporting " , E_ALL & ~E_DEPRECATED );
51+ }
2452 }
2553
2654 public function loadIniConfig ()
You can’t perform that action at this time.
0 commit comments