Remove official support of HHVM

As of HHVM 4.0, PHP is no longer supported:
    "With this release, we no longer aim to be compatible with PHP"
    "We are considering removing support for <?php in the next release [...]"
This commit is contained in:
Zach Borboa
2021-03-17 09:33:50 -04:00
parent d946b02b89
commit 05a1a21090
6 changed files with 20 additions and 79 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ For latest commit version:
### Requirements
PHP Curl Class works with PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, and HHVM.
PHP Curl Class works with PHP 5.3, 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, and 8.0.
### Quick Start and Examples
+5 -5
View File
@@ -20,8 +20,8 @@ $curl->post('https://www.example.com/login/', array(
// A POST request performs a post-redirect-get by default. Other request
// methods force an option which conflicts with the post-redirect-get behavior.
// Due to technical limitations of PHP engines <5.5.11 and HHVM, it is not
// possible to reset this option. It is therefore impossible to perform a
// post-redirect-get request using a php-curl-class Curl object that has already
// been used to perform other types of requests. Either use a new php-curl-class
// Curl object or upgrade your PHP engine.
// Due to technical limitations of PHP engines <5.5.11, it is not possible to
// reset this option. It is therefore impossible to perform a post-redirect-get
// request using a php-curl-class Curl object that has already been used to
// perform other types of requests. Either use a new php-curl-class Curl object
// or upgrade your PHP engine.
+5 -5
View File
@@ -686,9 +686,9 @@ class Curl
* - In order to force a 303 redirection to be performed using the same method, the
* underlying cURL object must be set in a special state (the CURLOPT_CURSTOMREQUEST
* option must be set to the method to use after the redirection). Due to a limitation
* of the cURL extension of PHP < 5.5.11 ([2], [3]) and of HHVM, it is not possible
* to reset this option. Using these PHP engines, it is therefore impossible to
* restore this behavior on an existing php-curl-class Curl object.
* of the cURL extension of PHP < 5.5.11 ([2], [3]), it is not possible to reset this
* option. Using these PHP engines, it is therefore impossible to restore this behavior
* on an existing php-curl-class Curl object.
*
* @return mixed Returns the value provided by exec.
*
@@ -710,9 +710,9 @@ class Curl
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'POST');
} else {
if (isset($this->options[CURLOPT_CUSTOMREQUEST])) {
if ((version_compare(PHP_VERSION, '5.5.11') < 0) || defined('HHVM_VERSION')) {
if ((version_compare(PHP_VERSION, '5.5.11') < 0)) {
trigger_error(
'Due to technical limitations of PHP <= 5.5.11 and HHVM, it is not possible to '
'Due to technical limitations of PHP <= 5.5.11, it is not possible to '
. 'perform a post-redirect-get request using a php-curl-class Curl object that '
. 'has already been used to perform other types of requests. Either use a new '
. 'php-curl-class Curl object or upgrade your PHP engine.',
+4 -21
View File
@@ -498,18 +498,14 @@ class CurlTest extends \PHPUnit\Framework\TestCase
$this->assertEquals('Redirected: POST', $test->server('post_redirect_get', 'POST', array(), true));
// On compatible PHP engines, ensure that it is possible to reuse an existing Curl object
if ((version_compare(PHP_VERSION, '5.5.11') > 0) && !defined('HHVM_VERSION')) {
if (version_compare(PHP_VERSION, '5.5.11') > 0) {
$this->assertEquals('Redirected: GET', $test->server('post_redirect_get', 'POST'));
}
}
public function testPostRedirectGetReuseObjectIncompatibleEngine()
{
if ((version_compare(PHP_VERSION, '5.5.11') > 0) && !defined('HHVM_VERSION')) {
$this->markTestSkipped();
}
if (getenv('CI_PHP_VERSION') === 'hhvm-nightly') {
if (version_compare(PHP_VERSION, '5.5.11') > 0) {
$this->markTestSkipped();
}
@@ -3283,11 +3279,6 @@ class CurlTest extends \PHPUnit\Framework\TestCase
public function testAlternativeStandardErrorOutput()
{
// Skip test on HHVM due to "Segmentation fault".
if (defined('HHVM_VERSION')) {
$this->markTestSkipped();
}
$buffer = fopen('php://memory', 'w+');
$curl = new Curl();
@@ -3310,8 +3301,8 @@ class CurlTest extends \PHPUnit\Framework\TestCase
public function testOptionSet()
{
// Skip this test on 5.3, 5.4, and HHVM.
if (version_compare(PHP_VERSION, '5.5.0', '<') || defined('HHVM_VERSION')) {
// Skip this test on 5.3 and 5.4.
if (version_compare(PHP_VERSION, '5.5.0', '<')) {
$this->markTestSkipped();
}
@@ -3542,14 +3533,6 @@ class CurlTest extends \PHPUnit\Framework\TestCase
}
}
// Not all keys are included on HHVM (tested 3.6.6).
if (defined('HHVM_VERSION')) {
foreach (array('certinfo', 'primary_ip', 'primary_port', 'local_ip', 'redirect_url') as $value) {
$key = array_search($value, $expected_keys);
unset($expected_keys[$key]);
}
}
foreach ($expected_keys as $key) {
$this->assertArrayHasKey($key, $info);
}
-39
View File
@@ -180,45 +180,6 @@ elif [[ "${CI_PHP_VERSION}" == "7.4" ]]; then
start_php_servers
elif [[ "${CI_PHP_VERSION}" == "8.0" ]]; then
start_php_servers
elif [[ "${CI_PHP_VERSION}" == "hhvm" || "${CI_PHP_VERSION}" == "hhvm-nightly" ]]; then
curl "https://nginx.org/keys/nginx_signing.key" | sudo apt-key add -
echo "deb https://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
echo "deb-src https://nginx.org/packages/mainline/ubuntu/ trusty nginx" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y nginx
sudo tee /etc/nginx/conf.d/default.conf <<"EOF"
server {
listen 8000 default_server;
server_name localhost;
root /usr/share/nginx/html;
location / {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
EOF
sudo /etc/init.d/hhvm restart
sleep 5
sudo service nginx stop
sleep 5
sudo service nginx start
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
root="${SCRIPT_DIR}/PHPCurlClass"
sudo cp -v "${root}/"* "/usr/share/nginx/html/"
# Use an older version of PHPUnit for HHVM builds so that unit tests can be
# started. HHVM 3.18 (PHP_VERSION=PHP 5.6.99-hhvm) is the last version to
# run on Trusty yet PHPUnit 6 requires PHP 7.0 or PHP 7.1.
# Avoids error:
# This version of PHPUnit is supported on PHP 7.0 and PHP 7.1.
# You are using PHP 5.6.99-hhvm (/usr/bin/hhvm).
if [[ "${CI_PHP_VERSION}" == "hhvm" ]]; then
phpunit_shim
composer require phpunit/phpunit:5.7.*
fi
elif [[ "${CI_PHP_VERSION}" == "nightly" ]]; then
start_php_servers
fi
+5 -8
View File
@@ -56,14 +56,11 @@ EOF
)
php --run "${script}" "${filename}"
}
# Skip hhvm "Notice: File could not be loaded: ..."
if [[ "${CI_PHP_VERSION}" != "hhvm" ]] && [[ "${CI_PHP_VERSION}" != "hhvm-nightly" ]]; then
export -f "find_invalid_indentation"
invalid_indentation=$(find .. -type "f" -iname "*.php" ! -path "*/vendor/*" -exec bash -c 'find_invalid_indentation "{}"' \;)
if [[ ! -z "${invalid_indentation}" ]]; then
echo "${invalid_indentation}"
((errors++))
fi
export -f "find_invalid_indentation"
invalid_indentation=$(find .. -type "f" -iname "*.php" ! -path "*/vendor/*" -exec bash -c 'find_invalid_indentation "{}"' \;)
if [[ ! -z "${invalid_indentation}" ]]; then
echo "${invalid_indentation}"
((errors++))
fi
# Prohibit trailing whitespace in php files.