@@ -191,7 +191,7 @@ public function dump(array $options = [])
191
191
$ regex = preg_quote (\DIRECTORY_SEPARATOR .$ dir [$ i ], '# ' ).$ regex ;
192
192
} while (0 < --$ i );
193
193
194
- $ this ->targetDirRegex = '# ' .preg_quote ($ dir [0 ], '# ' ).$ regex .'# ' ;
194
+ $ this ->targetDirRegex = '#(^|file://|[:;, \|\r\n]) ' .preg_quote ($ dir [0 ], '# ' ).$ regex .'# ' ;
195
195
}
196
196
}
197
197
@@ -1993,11 +1993,12 @@ private function isHotPath(Definition $definition)
1993
1993
private function export ($ value )
1994
1994
{
1995
1995
if (null !== $ this ->targetDirRegex && \is_string ($ value ) && preg_match ($ this ->targetDirRegex , $ value , $ matches , PREG_OFFSET_CAPTURE )) {
1996
- $ prefix = $ matches [0 ][1 ] ? $ this ->doExport (substr ($ value , 0 , $ matches [0 ][1 ]), true ).'. ' : '' ;
1997
1996
$ suffix = $ matches [0 ][1 ] + \strlen ($ matches [0 ][0 ]);
1997
+ $ matches [0 ][1 ] += \strlen ($ matches [1 ][0 ]);
1998
+ $ prefix = $ matches [0 ][1 ] ? $ this ->doExport (substr ($ value , 0 , $ matches [0 ][1 ]), true ).'. ' : '' ;
1998
1999
$ suffix = isset ($ value [$ suffix ]) ? '. ' .$ this ->doExport (substr ($ value , $ suffix ), true ) : '' ;
1999
2000
$ dirname = $ this ->asFiles ? '$this->containerDir ' : '__DIR__ ' ;
2000
- $ offset = 1 + $ this ->targetDirMaxMatches - \count ($ matches );
2001
+ $ offset = 2 + $ this ->targetDirMaxMatches - \count ($ matches );
2001
2002
2002
2003
if ($ this ->asFiles || 0 < $ offset ) {
2003
2004
$ dirname = sprintf ('$this->targetDirs[%d] ' , $ offset );
0 commit comments