Skip to content
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

Upgrade to Box 3 for phar generation. #691

Merged
merged 1 commit into from
May 18, 2018
Merged

Upgrade to Box 3 for phar generation. #691

merged 1 commit into from
May 18, 2018

Conversation

jwage
Copy link
Member

@jwage jwage commented May 18, 2018

Q A
Type improvement
BC Break no
Fixed issues #624

Summary

Upgrade to Box 3 for PHAR generation.

@jwage jwage added this to the 2.0 milestone May 18, 2018
@jwage jwage self-assigned this May 18, 2018
@jwage jwage force-pushed the upgrade-box branch 6 times, most recently from c248830 to 6d043b8 Compare May 18, 2018 20:43
Copy link
Contributor

@theofidry theofidry left a comment

Choose a reason for hiding this comment

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

There is only the platform.php config that may still be an issue and I'm not sure about committing the box.phar file either, otherwise looks good to me

box.json Outdated
@@ -1,23 +1,11 @@
{
"alias": "doctrine-migrations.phar",
"compactors": [
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's gonna make a big difference, but you can keep the compactors, I would replace Composer with Php though

build-phar.sh Outdated
@@ -8,10 +8,4 @@ fi

composer install --no-dev --optimize-autoloader
Copy link
Contributor

Choose a reason for hiding this comment

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

you shouldn't need that line: Box dump the optimized autoloader and already skips the dev deps

@jwage
Copy link
Member Author

jwage commented May 18, 2018

@theofidry I committed the box.phar since the tests rely on it. I guess the test could download it each time but I am not sure what is worse, relying on the internet for a test or checking in box.phar :)

@jwage jwage force-pushed the upgrade-box branch 2 times, most recently from b85b9af to bdc4f0d Compare May 18, 2018 20:57
@jwage jwage merged commit 5ff3e1b into master May 18, 2018
@jwage jwage deleted the upgrade-box branch May 18, 2018 21:04
]
],
"platform": {
"php": "7.1.x"
Copy link
Contributor

Choose a reason for hiding this comment

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

@jwage Why exactly was this added?
a) it's invalid here, it must be in "config" node (has no effect here)
b) using 7.1.x is invalid, it must be a specific version (i.e. 7.1.3)
c) having this here will likely cause issues with SF4 since Migrations require ^7.1 and platform override therefore should be 7.1.0

Copy link
Member Author

@jwage jwage May 30, 2018

Choose a reason for hiding this comment

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

It was suggested by @theofidry but i must have gotten it wrong. Can you record an issue and I will fix today?

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -5,7 +5,6 @@ reports/
dist/
tests/phpunit.xml
vendor/
box.phar
Copy link
Member

Choose a reason for hiding this comment

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

If you commit it in the repo, you should at least ignore it from the archive (using .gitattributes) so that users of the package don't get the box phar downloaded in their projects.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was already reverted, see #694 + #700.

{
$boxPharPath = realpath(__DIR__ . '/../../../../box.phar');

$compilePharCommand = sprintf('php %s compile -vvv', $boxPharPath);
Copy link
Member

Choose a reason for hiding this comment

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

this will break in case the path has spaces in them, as it misses proper escaping.

you should use new Process(array('php', $boxPharPath, 'compile', '-vvv')) to let the Process component escape each part properly.

self::assertTrue($process->isSuccessful());
self::assertTrue(file_exists($doctrinePharPath));

$runDoctrinePharCommand = sprintf('php %s', $doctrinePharPath);
Copy link
Member

Choose a reason for hiding this comment

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

same here about escaping


$process = new Process($runDoctrinePharCommand);

$process->start(function ($type, $buffer) use (&$output, &$successful) : void {
Copy link
Member

Choose a reason for hiding this comment

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

$output is unused in the closure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants