-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Composer dump-autoload with repository path #5520
Comments
Your composer.json example is invalid. But I will assume you actually have a working valid composer.json on your local environment. As far as I know, changes in autoload definitions should be detected immediately. |
Thanks for your feedback!! My composer files were valid and validated. Feel free to clone
and observe that the psr4-autoloading file did not change. Hope that there is no problem with composer Repository within composer based project. Thanks you very much for helping me out here! Repository url: https://github.com/7elix/5520-composer |
Your example scenario is wrong for several reasons:
|
After fixing the various issues with your example scenario, I
and the result was as expected, the psr4 autoload file was updated. I think there is simply a mismatch between your expectations, and how the path repository actually works. Could you elaborate on what your expectations are? |
Thank you very much.
That version is tagged with comment-4 (https://github.com/7elix/5520-composer/releases/tag/comment-4) git tag. Alright, now to my expectation: SituationThat project with root composer json and local Repository with path definition is set up. ActionNow changes within package happen: e.g. " Commands:
At his point the composer package has been changed and new autoloading information is present that were not yet registered in the project / root composer. In order to transport these changes from the composer package into the root composer:
The line is not changed into Work-aroundBy removing the vendor directory and running THANKS for your time and support! 🌞 |
Also the composer info is not updates yet: ➜ ~/Sites/5520-composer (master)
to display |
You still have a few issues in your example repo:
If you remove the lock file and apply the following patch, everything works as expected. diff --git i/composer.json w/composer.json
index ca3bf7a..c018f87 100644
--- i/composer.json
+++ w/composer.json
@@ -15,6 +15,6 @@
}
],
"require": {
- "phorax/demo-package": "*"
+ "phorax/demo-package": "dev-master"
}
}
diff --git i/demo-change-folder.sh w/demo-change-folder.sh
index b4b12fe..2c14202 100755
--- i/demo-change-folder.sh
+++ w/demo-change-folder.sh
@@ -14,16 +14,10 @@ then
echo "Replacing autoload section in package composer.json"
sed -i.bak "s/Classes/src/g" "Repository/demo-package/composer.json"
- echo "Running composer dump-autoload (no-change)"
- composer dump-autoload
+ echo "Running composer update"
+ composer update
echo "PSR-4 autoload *after"
cat "vendor/composer/autoload_psr4.php"
- echo "Running composer upload (no-change)"
- composer dump-autoload
-
- echo "PSR-4 autoload *after"
- cat "vendor/composer/autoload_psr4.php"
-
-fi
\ No newline at end of file
+fi
|
Thanks! I have set the composer package requirement to " Summary
I updated the code in case anyone else stumbles upon this. -> Thank you very much! |
With the following composer.json:
With recent changes in local-folder/local-composer-package/composer.json concerning autoload section with classmap.
When I run this command:
composer update
or
composer dump-autoload
I assume new autoload configuration is read and put into vendor/composer/autoload_classmap.php
But the changes from local-folder/local-composer-package/composer.json are not re-read and put into project autoload configuration.
Only removal of target symlink and composer update brings new classmap autoload php file.
The text was updated successfully, but these errors were encountered: