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

Application bootstrap: fix version check #100

Merged
merged 2 commits into from
Mar 3, 2022
Merged
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
14 changes: 12 additions & 2 deletions parallel-lint
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ either expressed or implied, of the FreeBSD Project.
*/

if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
fwrite(STDERR, "PHP Parallel Lint requires PHP 5.3.0 or newer." . PHP_EOL);
fwrite(
STDERR,
sprintf(
'PHP Parallel Lint requires PHP 5.3.0 or newer.' . PHP_EOL
. 'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINDIR
)
);
exit(254);
}

Expand Down Expand Up @@ -70,5 +78,7 @@ if (!$loaded) {

require_once __DIR__ . '/src/polyfill.php';

$app = new PHP_Parallel_Lint\PhpParallelLint\Application();
// Prevent parse error on PHP < 5.3 so the version check above can work.
$className = 'PHP_Parallel_Lint\PhpParallelLint\Application';
$app = new $className();
exit($app->run());