Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Runtime] Make project_dir configurable#59974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
wickedOne wants to merge1 commit intosymfony:6.4
base:6.4
Choose a base branch
Loading
fromwickedOne:configurable-project-dir

Conversation

wickedOne
Copy link
Contributor

@wickedOnewickedOne commentedMar 14, 2025
edited by nicolas-grekas
Loading

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#59954
LicenseMIT

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

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

while using

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

generate aautoload_runtime.php with the followingproject_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

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.3" but it seems your PR description refers to branch "6.4".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@wickedOnewickedOne changed the base branch from7.3 to6.4March 14, 2025 10:37
- add project_dir to configurable options in composer extra.runtime
Copy link
Member

@nicolas-grekasnicolas-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

@@ -74,7 +74,7 @@ public function updateAutoloadFile(): void
}
}

$projectDir = $fs->makePathRelative($projectDir, $vendorDir);
$projectDir = $fs->makePathRelative(realpath($projectDir.($extra['project_dir'] ?? '')), $vendorDir);

Choose a reason for hiding this comment

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

doesn't this miss a/?

Suggested change
$projectDir =$fs->makePathRelative(realpath($projectDir.($extra['project_dir'] ??'')),$vendorDir);
$projectDir =$fs->makePathRelative(realpath($projectDir.'/'.($extra['project_dir'] ??'')),$vendorDir);

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

yes, that makes sense

@wickedOne
Copy link
ContributorAuthor

wickedOne commentedApr 16, 2025
edited
Loading

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

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

Assignees
No one assigned
Projects
None yet
Milestone
7.4
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
@wickedOne@carsonbot@nicolas-grekas@fabpot

[8]ページ先頭

©2009-2025 Movatter.jp