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

Set lowest allowed PHP before generating PHAR #705

Merged
merged 1 commit into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ cache:
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- travis_retry composer self-update
- travis_retry composer config --unset platform.php

install:
- rm composer.lock
Expand Down
6 changes: 6 additions & 0 deletions build-phar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

./download-box.sh

# lock PHP to minimum allowed version
composer config platform.php 7.1.0
composer update
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe use --no-dev here? cc @theofidry

Copy link
Member

Choose a reason for hiding this comment

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

it is my understanding that box already does --no-dev automatically when building the phar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, ok then. 👌

Copy link
Contributor

Choose a reason for hiding this comment

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

To be more exact it simply discards the dev dependency directly done by reading composer.lock, it doesn't do a update or install behind the scenes. So there might still some minor optimization gains by doing install --no-dev, but for a compressed PHAR I don't think the extra faff is worth it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. I guess --no-dev -oa (optimized authoritative autoloader) may have some real (little) impact. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

The autoloader is dumped with classmap authoritative by default so the real optimisation you can squeeze from install --no-dev is by removing a few more test files eventually (I'm actually not sure you would get a diff at all)


php box.phar compile -vv

composer config --unset platform
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,5 @@
},
"bin": [
"bin/doctrine-migrations"
],
"platform": {
"php": "7.1.x"
}
]
}