Skip to content

Commit

Permalink
Reintroduce support for HHVM (experimental, see #176)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed Jun 4, 2017
1 parent f344f2f commit 6dceba7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ sudo: false
php:
- 7.0
- 7.1
- hhvm
- nightly

matrix:
allow_failures:
- php: hhvm
- php: nightly

before_script:
Expand Down
10 changes: 8 additions & 2 deletions src/main/php/__xp.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<?php namespace xp;

if (version_compare(PHP_VERSION, '7.0.0', '<')) {
throw new \Exception('This version of the XP Framework requires PHP 7.0.0+, have PHP '.PHP_VERSION);
if (PHP_VERSION_ID < 70000) {
if (!defined('HHVM_VERSION_ID')) {
throw new \Exception('This version of the XP Framework requires PHP 7.0.0+, have PHP '.PHP_VERSION);
} else if (HHVM_VERSION_ID < 31100) {
throw new \Exception('This version of the XP Framework requires HHVM 3.10.0+, have HHVM '.HHVM_VERSION);
} else if (!ini_get('hhvm.php7.all')) {
throw new \Exception('This version of the XP Framework requires hhvm.php7.all to be set to 1');
}
}

$p= max(strrpos(__FILE__, DIRECTORY_SEPARATOR), strrpos(__FILE__, '?'));
Expand Down

0 comments on commit 6dceba7

Please sign in to comment.