Skip to content

Conversation

@wickedOne
Copy link
Contributor

@wickedOne wickedOne commented Mar 14, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #59954
License MIT

this would allow a composer.json file at /alternative/location/composer.json be configured with

  "extra": {
    "runtime": {
      "project_dir": "/../../"
    }
  }

while using

COMPOSER=/alternative/location/composer.json composer update

generate a autoload_runtime.php with the following project_dir

$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? $_ENV['APP_RUNTIME_OPTIONS'] ?? []) + [
  'project_dir' => dirname(__DIR__, 1),
]);

i did not meddle with the autoload template discovery as that's currently already configurable and would introduce a bc break. also it makes sense in a way that every config value is relative to the composer.json file itself

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be tested?
Note that this should target 7.3 as it's an improvement, not a butfix

@wickedOne
Copy link
Contributor Author

wickedOne commented Apr 16, 2025

Can this be tested?

i'm not entirely sure as the plugin uses a lot of built in functions with regards to directory / file locations and a static method to retrieve a composer config.... would you guys even be open to have a dev depdency like vfsStream?

Note that this should target 7.3 as it's an improvement, not a bugfix

check

@fabpot fabpot modified the milestones: 7.3, 7.4 May 26, 2025
@symfony symfony deleted a comment from carsonbot Aug 26, 2025
@wickedOne wickedOne force-pushed the configurable-project-dir branch from 09e301d to 949db49 Compare October 26, 2025 08:59
@wickedOne wickedOne changed the base branch from 6.4 to 7.3 October 26, 2025 08:59
- add project_dir to configurable options in composer extra.runtime
@nicolas-grekas nicolas-grekas changed the base branch from 7.3 to 7.4 October 26, 2025 09:06
@nicolas-grekas nicolas-grekas force-pushed the configurable-project-dir branch from 949db49 to 1d085aa Compare October 26, 2025 09:06
@nicolas-grekas
Copy link
Member

Thank you @wickedOne.

@nicolas-grekas nicolas-grekas merged commit 929e82e into symfony:7.4 Oct 26, 2025
2 of 3 checks passed
@wickedOne wickedOne deleted the configurable-project-dir branch October 26, 2025 11:04
This was referenced Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Runtime] project_dir option in composer.json always overwritten in autoload_runtime.php

4 participants