-
Notifications
You must be signed in to change notification settings - Fork 28
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
Make plugin compatible with hirak/prestissimo #21
Make plugin compatible with hirak/prestissimo #21
Conversation
8b809c9
to
70c2da2
Compare
Thanks @mcaskill looks good to me! |
I cheered too soon so it seems...
Locally everything works? |
Hi @Twansparant, That is puzzling. I admit my testing was limited to my computer only. Having spent quite some time these past two weeks reading and playing with this Composer plugin, I'm pretty certain the double slash is not coming from it. There's no manipulation of the
|
Hi @Twansparant I using Composer's verbose output while working on another pull request and I noticed the double slash (without using Prestissimo). On my end, Composer still manages to properly unzip the file. I looked around to see where this might be coming from and I believe it's coming from Composer's protected function getFileName(PackageInterface $package, $path)
{
return $path.'/'.pathinfo(parse_url($package->getDistUrl(), PHP_URL_PATH), PATHINFO_BASENAME);
} In combination with protected $locations = array(
'plugin' => 'wp-content/plugins/{$name}/',
'theme' => 'wp-content/themes/{$name}/',
'muplugin' => 'wp-content/mu-plugins/{$name}/',
'dropin' => 'wp-content/{$name}/',
); I recommend you create an issue on composer/composer or composer/installers. |
Hi @mcaskill, No worries, I'm just really keen on getting this to work in our Trellis setups!
"junaidbhura/composer-wp-pro-plugins": "^1.0.9"
"composer/installers": "^1.8"
"vlucas/phpdotenv": "^4.1.0"
"oscarotero/env": "^2.1" For hirak/prestissimo I don't know to be honest, it doesn't show up on
Local: Composer version 1.10.10
Local: Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0-91-generic x86_64)
For example for GravityForms itself:
When I list the composer cache on the production server:
it has one file:
with a creation date of the last deploy
is empty. |
I override these wordpress installer-paths in my composer.json. If I remove the trailing slash for the plugins path:
And deploy again, it has the same error, but without the double trailing slashes in the path:
So it's probably not the extra slash causing this? |
Hey @Twansparant can you try removing |
Hi @junaidbhura, I just merged this PR, and set the composer_no_scripts to false:
and deployed again, and the errors are gone! |
This seems to be working now without errors! {
"type": "package",
"package": {
"name": "junaidbhura/gravityforms",
"version": "2.4.20.5",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "https://www.gravityforms.com"
},
"require": {
"junaidbhura/composer-wp-pro-plugins": "*"
}
}
}, And on the deploy it installed version: 2.4.17.14?
|
Hey @Twansparant great to hear that it works now! There's a known issue that Gravity Forms will always download the latest version: https://github.com/junaidbhura/composer-wp-pro-plugins#composer-installer-for-pro-wordpress-plugins |
I wish it did download the latest version! I defined the latest version, but I get a version from months ago? |
@Twansparant did you do a |
Yes, before deploying I always make sure my |
And do you get the same version locally? |
No, locally the correct 2.4.20.5 version is installed? |
Ok, I updated |
Awesome! |
In the lock file, the entry for Gravity Forms should look like this for 2.4.20.5: {
"name": "junaidbhura/gravityforms",
"version": "2.4.20.5",
"dist": {
"type": "zip",
"url": "https://www.gravityforms.com/#a42d513142b5f342c5237ac16a2a8279ed5270bb"
},
"require": {
"junaidbhura/composer-wp-pro-plugins": "*"
},
"type": "wordpress-plugin"
} I've noticed the issue when updating to composer-wp-pro-plugins v1.0.10 in #7:
|
Checklist:
Description
When using this Composer plugin in conjunction with hirak/prestissimo, the download of premium plugins fails because the custom
RemoteFileSystem
is overwritten by the latter.How has this been tested?
I've tested this on a client project that uses Advanced Custom Fields Pro, Gravity Forms, and Polylang Pro.
Types of changes
As both are running with the default priority (
0
), setting this one to-1
resolves the issue (this plugin's event handler would be executed after Prestissimo, effectively replacing their customCurlRemoteFileSystem
).Similar:
Resolves #1, #14
Alternatively, we could change the priority for this package to execute after Prestissimo and take advantage of the parallel downloads but we would have to perform some kind of trickery where we supply the real download URL to Prestissimo (via
$event->getProcessedUrl()
) but ensure that the package'sdist.url
does not use that URL.