2
2
3
3
namespace PHPPM \Bootstraps ;
4
4
5
- use PHPPM \ProcessSlave ;
6
5
use PHPPM \Symfony \StrongerNativeSessionStorage ;
7
6
use PHPPM \Utils ;
8
7
use Symfony \Component \HttpFoundation \Request ;
8
+ use Symfony \Component \Config \Resource \FileResource ;
9
9
use function PHPPM \register_file ;
10
10
11
11
/**
@@ -88,28 +88,29 @@ public function getApplication()
88
88
$ app ->booted = true ;
89
89
}, $ app );
90
90
91
- Utils::bindAndCall (function () use ($ app ) {
92
- $ container = $ app ->container ;
91
+ if ($ this ->debug ) {
92
+ Utils::bindAndCall (function () use ($ app ) {
93
+ $ container = $ app ->container ;
93
94
94
- $ containerClassName = substr (strrchr (get_class ($ app ->container ), "\\" ), 1 );
95
- $ metaName = $ containerClassName . '.php.meta ' ;
95
+ $ containerClassName = substr (strrchr (get_class ($ app ->container ), "\\" ), 1 );
96
+ $ metaName = $ containerClassName . '.php.meta ' ;
96
97
97
- Utils::bindAndCall (function () use ($ container ) {
98
- $ container ->publicContainerDir = $ container ->containerDir ;
99
- }, $ container );
98
+ Utils::bindAndCall (function () use ($ container ) {
99
+ $ container ->publicContainerDir = $ container ->containerDir ;
100
+ }, $ container );
100
101
101
- $ metaContent = file_get_contents ($ app ->container ->publicContainerDir . '/../ ' . $ metaName );
102
+ $ metaContent = file_get_contents ($ app ->container ->publicContainerDir . '/../ ' . $ metaName );
102
103
103
- $ containerMetadata = unserialize ($ metaContent );
104
+ $ containerMetadata = unserialize ($ metaContent );
104
105
105
- $ files = [];
106
- foreach ( $ containerMetadata as $ entry ) {
107
- $ fileResourceClass = ' Symfony\Component\Config\Resource\ FileResource' ;
108
- if ( $ entry instanceof $ fileResourceClass ) {
109
- ProcessSlave:: $ slave -> registerFile ( $ entry -> __toString ());
106
+ foreach ( $ containerMetadata as $ entry ) {
107
+ $ fileResourceClass = ' Symfony\Component\Config\Resource\FileResource ' ;
108
+ if ( $ entry instanceof FileResource) {
109
+ register_file ( $ entry -> __toString ());
110
+ }
110
111
}
111
- }
112
- }, $ app );
112
+ }, $ app );
113
+ }
113
114
114
115
if ($ trustedProxies = getenv ('TRUSTED_PROXIES ' )) {
115
116
Request::setTrustedProxies (explode (', ' , $ trustedProxies ), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST );
@@ -121,7 +122,7 @@ public function getApplication()
121
122
122
123
return $ app ;
123
124
}
124
-
125
+
125
126
/**
126
127
* Returns the vendor directory containing autoload.php
127
128
*
0 commit comments