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

fix: resolve issues with scoped classes in PHAR #88

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

weierophinney
Copy link
Contributor

This patch makes several changes to PHAR creation to resolve the following issues:

  • Generated local configuration files were receiving the autogenerated namespace as a prefix to the configuration.
    This is likely a bug in Box and/or PHP-Scoper, but it's possible to work around it (I chose implode() with a list of lines, as any nowdoc or heredoc triggered the injection for me).

  • Configuration files reference provider classes.
    This led to problems when scoping as those classes then could not be found.
    I have added php-scoper whitelist entries for the specified classes to ensure that configuration can be used and not lead to errors.

  • Once php-scoper configuration was introduced, I started seeing warnings thrown around polyfill classes we use.
    I have updated the php-scoper configuration to whitelist global classes.

In my local testing, all operations that previously did not work under the PHAR now work.

Fixes #81
Fixes #82

This patch makes several changes to PHAR creation to resolve the following issues:

- Generated local configuration files were receiving the autogenerated namespace as a prefix to the configuration.
  This is likely a bug in Box and/or PHP-Scoper, but it's possible to work around it (I chose `implode()` with a list of lines, as any nowdoc or heredoc triggered the injection for me).

- Configuration files reference provider classes.
  This led to problems when scoping as those classes then could not be found.
  I have added php-scoper whitelist entries for the specified classes to ensure that configuration can be used and not lead to errors.

- Once php-scoper configuration was introduced, I started seeing warnings thrown around polyfill classes we use.
  I have updated the php-scoper configuration to whitelist global classes.

In my local testing, all operations that previously did not work under the PHAR now work.

Fixes #81
Fixes #82

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney added the bug Something isn't working label Sep 14, 2020
@weierophinney weierophinney added this to the 2.9.1 milestone Sep 14, 2020
@weierophinney weierophinney merged commit f13e45c into 2.9.x Sep 14, 2020
weierophinney added a commit that referenced this pull request Sep 14, 2020
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney deleted the hotfix/phar-issues branch September 14, 2020 21:52
@rieschl
Copy link

rieschl commented Sep 15, 2020

I can also confirm; it works now locally with the PHAR from 2.9.x. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants