@@ -301,8 +301,8 @@ public function stream_open(string $path, string $mode, int $options, ?string &$
301301 {
302302 $ isInclude = ($ options & self ::STREAM_OPEN_FOR_INCLUDE ) !== 0 ;
303303
304- if (! $ isInclude || ( $ mode !== ' r ' && $ mode !== ' rb ' && $ mode !== ' rt ' ) || ! str_ends_with ( strtolower ( $ path) , '.php ' ) || ! Config:: isEnabled ( )) {
305- return $ this -> openDirectHandle ( $ path , $ mode , $ options );
304+ if (str_contains ( $ path , ' ConstKeyContainer ' ) || str_contains ( $ path , 'OffsetAccessContainer ' )) {
305+ fwrite ( STDERR , " [STREAM_OPEN] path: $ path, isInclude: " . ( $ isInclude ? ' yes ' : ' no ' ) . " , isEnabled: " . (Config:: isEnabled () ? ' yes ' : ' no ' ) . "\n" );
306306 }
307307
308308 $ normalizedRaw = str_replace ('\\' , '/ ' , $ path );
@@ -316,14 +316,14 @@ public function stream_open(string $path, string $mode, int $options, ?string &$
316316
317317 self ::unregister ();
318318
319- $ exists = (bool ) self ::silent (static fn () => file_exists ($ path ));
320- $ resolvedPath = $ exists ? self ::silent (static fn () => realpath ($ path )) : false ;
319+ $ exists = (bool ) self ::silent (static fn () => file_exists ($ path ));
320+ $ resolvedPath = $ exists ? self ::silent (static fn () => realpath ($ path )) : false ;
321321
322322 if (! $ exists || $ resolvedPath === false || ! self ::isApplicationFile ($ path , $ resolvedPath )) {
323323 $ target = ($ resolvedPath !== false ) ? $ resolvedPath : $ path ;
324324 /** @var resource|false $handle */
325325 $ handle = self ::silent (
326- fn () => ($ this ->context !== null )
326+ fn () => ($ this ->context !== null )
327327 ? fopen ($ target , $ mode , false , $ this ->context )
328328 : fopen ($ target , $ mode )
329329 );
@@ -367,7 +367,7 @@ private function openDirectHandle(string $targetFile, string $mode, int $options
367367 self ::unregister ();
368368 /** @var resource|false $handle */
369369 $ handle = self ::silent (
370- fn () => ($ this ->context !== null )
370+ fn () => ($ this ->context !== null )
371371 ? fopen ($ targetFile , $ mode , $ useIncludePath , $ this ->context )
372372 : fopen ($ targetFile , $ mode , $ useIncludePath )
373373 );
@@ -522,7 +522,7 @@ public function url_stat(string $path, int $flags): array|false
522522
523523 self ::unregister ();
524524 /** @var array<int|string, int>|false $result */
525- $ result = self ::silent (static fn () => $ isLink ? @lstat ($ path ) : @stat ($ path ));
525+ $ result = self ::silent (static fn () => $ isLink ? @lstat ($ path ) : @stat ($ path ));
526526 self ::register ();
527527
528528 if ($ result !== false ) {
@@ -559,11 +559,11 @@ public function stream_metadata(string $path, int $option, mixed $value): bool
559559 $ valueArray = \is_array ($ value ) ? $ value : [];
560560 $ time = $ valueArray [0 ] ?? time ();
561561 $ atime = $ valueArray [1 ] ?? $ time ;
562- $ result = (bool ) self ::silent (fn () => @touch ($ path , (int ) $ time , (int ) $ atime ));
562+ $ result = (bool ) self ::silent (fn () => @touch ($ path , (int ) $ time , (int ) $ atime ));
563563 } elseif ($ option === STREAM_META_ACCESS ) {
564564 /** @var int $mode */
565565 $ mode = \is_int ($ value ) ? $ value : 0777 ;
566- $ result = (bool ) self ::silent (fn () => @chmod ($ path , $ mode ));
566+ $ result = (bool ) self ::silent (fn () => @chmod ($ path , $ mode ));
567567 }
568568 self ::register ();
569569
@@ -575,7 +575,7 @@ public function dir_opendir(string $path, int $options): bool
575575 self ::unregister ();
576576 /** @var resource|false $dh */
577577 $ dh = self ::silent (
578- fn () => ($ this ->context !== null )
578+ fn () => ($ this ->context !== null )
579579 ? @opendir ($ path , $ this ->context )
580580 : @opendir ($ path )
581581 );
@@ -702,7 +702,7 @@ public function rename(string $pathFrom, string $pathTo): bool
702702 */
703703 private static function silent (callable $ callback ): mixed
704704 {
705- set_error_handler (static fn () => true );
705+ set_error_handler (static fn () => true );
706706
707707 try {
708708 return $ callback ();
@@ -754,6 +754,10 @@ private static function isApplicationFile(string $path, string|false $resolvedPa
754754 */
755755 private function openMemoryStream (string $ resolvedPath ): bool
756756 {
757+ if (str_contains ($ resolvedPath , 'ConstKeyContainer ' ) || str_contains ($ resolvedPath , 'OffsetAccessContainer ' )) {
758+ fwrite (STDERR , "[TRANSFORM] Transforming $ resolvedPath \n" );
759+ }
760+
757761 $ source = file_get_contents ($ resolvedPath );
758762 if ($ source === false ) {
759763 return false ;
@@ -776,6 +780,10 @@ private function openMemoryStream(string $resolvedPath): bool
776780 */
777781 private function openCachedStream (string $ resolvedPath , string $ mode ): bool
778782 {
783+ if (str_contains ($ resolvedPath , 'ConstKeyContainer ' ) || str_contains ($ resolvedPath , 'OffsetAccessContainer ' )) {
784+ fwrite (STDERR , "[TRANSFORM] Transforming $ resolvedPath \n" );
785+ }
786+
779787 $ cachedFile = CacheManager::getCachedFilePath ($ resolvedPath );
780788
781789 if (! CacheManager::ensureSecureCacheDir ()) {
0 commit comments