Skip to content

Conversation

theofidry
Copy link
Contributor

@theofidry theofidry commented Sep 30, 2017

  • Installed PHP-Scoper as a global dependency (there is no auto-phar on release neither installers yet)
  • Modified the PHAR build script to:
    • reduce the number of files to scope (e.g. avoid to scope files from dev deps) & ship (e.g. dev deps)
    • scope the content before building the PHAR
    • optimize the autoloader before building the PHAR
  • Added an end to end test for the isolated PHAR: a simple schema.yml is provided with the expected files
  • Commited the composer.lock: if used as a library this does not matter and the tests don't rely on it (a composer update is ran). However for shipping the PHAR, specific versions are expected. This is also required by PHP-Scoper as some patches are required and they are by nature extremely brittle. A way to avoid that would be to patch PHP-CS-Fixer directly but that's another story.

Right now the build is failing due to an error in the PHAR. However as it works with the isolated deps (e.g. if I take build/bin/schema instead of schema.phar) it works so it seems that the error is not coming from those changes.

@theofidry theofidry changed the title [WIP] Isolate the PHAR with PHP-Scoper Isolate the PHAR with PHP-Scoper Sep 30, 2017
@theofidry theofidry requested a review from dunglas September 30, 2017 12:01
@theofidry theofidry mentioned this pull request Oct 12, 2017
@theofidry theofidry force-pushed the feature/isolate-phar branch from 9618231 to 469fc00 Compare October 13, 2017 08:27
@theofidry
Copy link
Contributor Author

Rebased. Note that the config is very brittle. Unfortunately there is not much which can be done here or at PhpScoper level. The real fix is patching PHP-CS-Fixer to avoid those dynamic piece of codes that could be scoped more easily without patchers

@theofidry
Copy link
Contributor Author

@dunglas R4R

@theofidry theofidry merged commit 74293c6 into api-platform:master Oct 18, 2017
@theofidry theofidry deleted the feature/isolate-phar branch October 18, 2017 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants