Skip to content

Commit 09e301d

Browse files
committed
make project_dir configurable
- add project_dir to configurable options in composer extra.runtime
1 parent 647dba0 commit 09e301d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Runtime/Internal/ComposerPlugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function updateAutoloadFile(): void
7474
}
7575
}
7676

77-
$projectDir = $fs->makePathRelative($projectDir, $vendorDir);
77+
$projectDir = $fs->makePathRelative(realpath($projectDir.($extra['project_dir'] ?? '')), $vendorDir);
7878
$nestingLevel = 0;
7979

8080
while (str_starts_with($projectDir, '../')) {
@@ -90,7 +90,7 @@ public function updateAutoloadFile(): void
9090

9191
$runtimeClass = $extra['class'] ?? SymfonyRuntime::class;
9292

93-
unset($extra['class'], $extra['autoload_template']);
93+
unset($extra['class'], $extra['autoload_template'], $extra['project_dir']);
9494

9595
$code = strtr(file_get_contents($autoloadTemplate), [
9696
'%project_dir%' => $projectDir,

0 commit comments

Comments
 (0)