-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Pre-load all of our sources on initial load #82
Conversation
… more recent version of one of our classes e.g. after a 'composer update' operation.
Upgrades from 2.4.0 (with this PR backported) work:
Unfortunately, there is no way that we can actually insert this code into the older releases; everyone will need to get to 2.5.x via |
Looks could, i did some testing with the following commands and it no longer breaks. # Install 2.4.0
composer require --no-plugins --no-scripts drupal-composer/drupal-scaffold:2.4.0 -vvv
# Upgrade to branch manual-not-auto-loader
composer require drupal-composer/drupal-scaffold:dev-manual-not-auto-loader -vvv We could release 2.4.1 with this fix, people with trouble good upgrade to 2.4.1 first and then to 2.5.1 later. |
]; | ||
|
||
foreach ($classes as $src) { | ||
if (!class_exists('\\DrupalComposer\\DrupalScaffold\\' . $src)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the a particular reason for the double backslash notation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double backslash is necessary at the end; otherwise you get \'
, which escapes the last single-quote. I made the rest doubled up for consistency. This could be changed if you prefer it the other way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense. Thanks!
Regarding your test above, note that Releasing a 2.4.1 wouldn't really make things any easier for folks. They could upgrade via It is still very helpful to have this PR, though, as it will prevent this from happening again if the internal scaffold APIs should change again, which is likely. |
]; | ||
|
||
foreach ($classes as $src) { | ||
if (!class_exists('\\DrupalComposer\\DrupalScaffold\\' . $src)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense. Thanks!
This ensures that we will not get a more recent version of one of our classes e.g. after a 'composer update' operation.
Still not sure if this is the best way, or if we should be more robust and
exec
every handler as considered in #79 (comment).This is easier, and perhaps sufficient, so we'll start here. Still need to test the upgrade path.