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

Undefined variable when using GZ compression on Windows #261

Closed
lookyman opened this issue Jun 15, 2018 · 3 comments
Closed

Undefined variable when using GZ compression on Windows #261

lookyman opened this issue Jun 15, 2018 · 3 comments

Comments

@lookyman
Copy link
Contributor

Bug report

Question Answer
Box version 3.0.0-beta.3@37699fe
PHP version 7.2.2
Platform with version Win 10
Github Repo -

The problem seems to be here. If the if statement above evaluates to false, the variables $softLimit and $hardLimit are never defined and cannot be used in the anonymous function's use.

box.json.dist
{
 "banner": false,
 "base-path": "../tmp/build",
 "check-requirements": false,
 "compactors": [
   "KevinGH\\Box\\Compactor\\Php",
   "KevinGH\\Box\\Compactor\\PhpScoper"
 ],
 "compression": "GZ",
 "directories": [
   "conf",
   "src",
   "vendor"
 ],
 "output": "../phpstan.phar",
 "php-scoper": "../../build/scoper.inc.php"
}
Output
$ php box.phar compile
> Box version 3.0.0-beta.3@37699fe 2018-06-14 10:50:22


// Loading the configuration file "C:\server\www\phpstan\phpstan-compiler\build\box.json".

Building the PHAR "C:/server/www/phpstan/phpstan-compiler/tmp/phpstan.phar"
? Registering compactors
 + KevinGH\Box\Compactor\Php
 + KevinGH\Box\Compactor\PhpScoper
? Adding main file: C:/server/www/phpstan/phpstan-compiler/tmp/build/bin/phpstan
? Skip requirements checker
? Adding binary files
   > No file found
? Adding files
   > 821 file(s)
? Generating new stub
 - Using shebang line: #!/usr/bin/env php
? Dumping the Composer autoloader
? Removing the Composer dump artefacts
? Compressing with the algorithm "GZ"

In Compile.php line 330:

 Undefined variable: softLimit
@theofidry
Copy link
Member

Indeed that doesn't look right. Thanks for the report! Could you give a try to #262?

@lookyman
Copy link
Contributor Author

Yep, it works. Thanks!

@theofidry
Copy link
Member

Cool.

There is probably more Windows related issues, c.f. #193.

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

No branches or pull requests

2 participants