Allow version check in application entry file to work
As reported in #62, the "version check" for PHP < 5.3 in the application bootstrap did not work as the code in file would cause a parse error when run on PHP < 5.3.
By putting the class name, which contains PHP 5.3 namespace separator tokens, as a variable and then dynamically calling the class, the parse error on PHP < 5.3 is prevented and the version check at the top of the file can work as expected.
Fixes #62
Note: this is not something which can really be unit tested as this concerns the application bootstrap file. An integration test would be an option, but then, this integration test would need to be run against PHP 5.2 (or lower) in a workflow.
Adding a setup for this is outside the scope of this PR.
Make the version check more informative
Previously, the PHP version check run at the start of the script would display PHP Parallel Lint requires PHP 5.3.0 or newer. if the PHP version was too low.
The message has been updated to include the currently detected PHP version and the path to the PHP binary.
Note: both constants used are available in PHP cross-version
Testing the PR
On PHP 5.2, with develop or master: try to run the parallel-lint command and see it fail with a parse error.
Switch to this branch.
Try running the parallel-lint command again and see it fail with an informative error message saying that "PHP Parallel Lint requires PHP 5.3.o or newer"
Allow version check in application entry file to work
As reported in #62, the "version check" for PHP < 5.3 in the application bootstrap did not work as the code in file would cause a parse error when run on PHP < 5.3.
By putting the class name, which contains PHP 5.3 namespace separator tokens, as a variable and then dynamically calling the class, the parse error on PHP < 5.3 is prevented and the version check at the top of the file can work as expected.
Fixes #62
Note: this is not something which can really be unit tested as this concerns the application bootstrap file. An integration test would be an option, but then, this integration test would need to be run against PHP 5.2 (or lower) in a workflow. Adding a setup for this is outside the scope of this PR.
Make the version check more informative
Previously, the PHP version check run at the start of the script would display
PHP Parallel Lint requires PHP 5.3.0 or newer.
if the PHP version was too low.The message has been updated to include the currently detected PHP version and the path to the PHP binary.
Note: both constants used are available in PHP cross-version
Testing the PR
develop
ormaster
: try to run theparallel-lint
command and see it fail with a parse error.parallel-lint
command again and see it fail with an informative error message saying that "PHP Parallel Lint requires PHP 5.3.o or newer"