-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Introduce composer plugin #35
Conversation
613176e
to
881d28d
Compare
#!/usr/bin/env php | ||
<?php | ||
|
||
declare(strict_types=1); |
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.
I've kept this file for a few reasons:
- Composer adds a binary proxy wrapper. It somehow expects this to be a PHP file.
- In windows, the executable will be suffixed with .exe. I'm not sure if it runs without that suffix.
- This gives us some control about the availability of the executable. For example when composer runs with
no-scripts
02adf92
to
4f510be
Compare
$executable_extension = ''; | ||
|
||
switch ($os) { | ||
case 'windows': |
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.
php_uname('s')
will return Windows NT
on windows so you should check for this string instead, though you should still make sure that the osname used in the filename is still windows
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.
Can you verify if I understood your comment correctly.
Thanks for reviewing!
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.
Yes this looks fine to me 👍 I'll test again on windows tonight
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.
@Zuruuh is this good to go?
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.
Yeah I tried it and can confirm it works now 😄
This PR will make it possible to install the mago binaries from within composer.
It contains:
composer mago:install-binary
that can be used to install the binary for currently required mago version for current platform..platform
file that contains a relative link to the mago executable for current platform.This package requires activation of the plugin:
Once the assets are in place, that is where the composer plugin stops.
Next up is a mago PHP binary that will be symlinked in
vendor/bin/mago
.This script will:
.platform file
This setup allows to run mago on multiple platforms (docker, virtualbox, host, ...) just as one would expect from regular PHP tools.