Skip to content

Commit 2b257d7

Browse files
committed
feature #22758 Remove HHVM support (fabpot)
This PR was squashed before being merged into the 4.0-dev branch (closes #22758). Discussion ---------- Remove HHVM support | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | yes-ish (for HHVM users) | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 2125437 [WebServerBundle] removed obsolete ServerCommand abstract class ad1f35f removed HHVM support
2 parents ab49685 + 2125437 commit 2b257d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+69
-350
lines changed

.travis.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,25 +62,20 @@ before_install:
6262
export -f tfold
6363
6464
# php.ini configuration
65-
if [[ $PHP = hhvm* ]]; then
66-
INI=/etc/hhvm/php.ini
67-
else
68-
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
69-
phpenv config-rm xdebug.ini || echo "xdebug not available"
70-
fi
65+
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
66+
phpenv config-rm xdebug.ini || echo "xdebug not available"
7167
echo date.timezone = Europe/Paris >> $INI
7268
echo memory_limit = -1 >> $INI
7369
echo session.gc_probability = 0 >> $INI
7470
echo opcache.enable_cli = 1 >> $INI
75-
echo hhvm.jit = 0 >> $INI
7671
echo apc.enable_cli = 1 >> $INI
7772
echo extension = ldap.so >> $INI
7873
echo extension = redis.so >> $INI
7974
echo extension = memcached.so >> $INI
8075
echo extension = mongodb.so >> $INI
8176
8277
# Matrix lines for intermediate PHP versions are skipped for pull requests
83-
if [[ ! $deps && ! $PHP = $MIN_PHP && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then
78+
if [[ ! $deps && ! $PHP = $MIN_PHP && $TRAVIS_PULL_REQUEST != false ]]; then
8479
deps=skip
8580
skip=1
8681
else
@@ -145,9 +140,7 @@ install:
145140
146141
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
147142
- if [[ ! $skip ]]; then ./phpunit install; fi
148-
- |
149-
# phpinfo
150-
if [[ ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
143+
- php -i
151144

152145
- |
153146
run_tests () {
@@ -161,8 +154,6 @@ install:
161154
# Test the PhpUnit bridge on PHP 5.3, using the original phpunit script
162155
tfold src/Symfony/Bridge/PhpUnit \
163156
"cd src/Symfony/Bridge/PhpUnit && wget https://phar.phpunit.de/phpunit-4.8.phar && phpenv global 5.3 && composer update --no-progress --ansi && php phpunit-4.8.phar"
164-
elif [[ $PHP = hhvm* ]]; then
165-
$PHPUNIT --exclude-group benchmark,intl-data
166157
else
167158
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
168159
tfold tty-group $PHPUNIT --group tty

src/Symfony/Bundle/WebServerBundle/Command/ServerCommand.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\WebServerBundle\WebServer;
1515
use Symfony\Bundle\WebServerBundle\WebServerConfig;
16+
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputOption;
1819
use Symfony\Component\Console\Input\InputInterface;
@@ -26,7 +27,7 @@
2627
*
2728
* @author Michał Pipa <michal.pipa.xsolve@gmail.com>
2829
*/
29-
class ServerRunCommand extends ServerCommand
30+
class ServerRunCommand extends Command
3031
{
3132
private $documentRoot;
3233
private $environment;

src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\WebServerBundle\WebServer;
1515
use Symfony\Bundle\WebServerBundle\WebServerConfig;
16+
use Symfony\Component\Console\Command\Command;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
1819
use Symfony\Component\Console\Input\InputOption;
@@ -25,7 +26,7 @@
2526
*
2627
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
2728
*/
28-
class ServerStartCommand extends ServerCommand
29+
class ServerStartCommand extends Command
2930
{
3031
private $documentRoot;
3132
private $environment;

src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\WebServerBundle\Command;
1313

1414
use Symfony\Bundle\WebServerBundle\WebServer;
15+
use Symfony\Component\Console\Command\Command;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Input\InputOption;
1718
use Symfony\Component\Console\Output\OutputInterface;
@@ -24,7 +25,7 @@
2425
*
2526
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
2627
*/
27-
class ServerStatusCommand extends ServerCommand
28+
class ServerStatusCommand extends Command
2829
{
2930
/**
3031
* {@inheritdoc}

src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\WebServerBundle\Command;
1313

1414
use Symfony\Bundle\WebServerBundle\WebServer;
15+
use Symfony\Component\Console\Command\Command;
1516
use Symfony\Component\Console\Input\InputInterface;
1617
use Symfony\Component\Console\Output\OutputInterface;
1718
use Symfony\Component\Console\Output\ConsoleOutputInterface;
@@ -23,7 +24,7 @@
2324
*
2425
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
2526
*/
26-
class ServerStopCommand extends ServerCommand
27+
class ServerStopCommand extends Command
2728
{
2829
/**
2930
* {@inheritdoc}

src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function ($key, $value, $isHit) {
6363
public static function create($file, CacheItemPoolInterface $fallbackPool)
6464
{
6565
// Shared memory is available in PHP 7.0+ with OPCache enabled and in HHVM
66-
if (ini_get('opcache.enable') || defined('HHVM_VERSION')) {
66+
if (ini_get('opcache.enable')) {
6767
if (!$fallbackPool instanceof AdapterInterface) {
6868
$fallbackPool = new ProxyAdapter($fallbackPool);
6969
}

src/Symfony/Component/Cache/Simple/PhpArrayCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct($file, CacheInterface $fallbackPool)
4646
public static function create($file, CacheInterface $fallbackPool)
4747
{
4848
// Shared memory is available in PHP 7.0+ with OPCache enabled and in HHVM
49-
if (ini_get('opcache.enable') || defined('HHVM_VERSION')) {
49+
if (ini_get('opcache.enable')) {
5050
return new static($file, $fallbackPool);
5151
}
5252

src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@
1515

1616
abstract class AdapterTestCase extends CachePoolTest
1717
{
18-
protected function setUp()
19-
{
20-
parent::setUp();
21-
22-
if (!array_key_exists('testDeferredSaveWithoutCommit', $this->skippedTests) && defined('HHVM_VERSION')) {
23-
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Destructors are called late on HHVM.';
24-
}
25-
}
26-
2718
public function testDefaultLifeTime()
2819
{
2920
if (isset($this->skippedTests[__FUNCTION__])) {

src/Symfony/Component/Cache/composer.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
"conflict": {
3535
"symfony/var-dumper": "<3.4"
3636
},
37-
"suggest": {
38-
"symfony/polyfill-apcu": "For using ApcuAdapter on HHVM"
39-
},
4037
"autoload": {
4138
"psr-4": { "Symfony\\Component\\Cache\\": "" },
4239
"exclude-from-classmap": [

src/Symfony/Component/Config/Resource/ReflectionClassResource.php

Lines changed: 6 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -133,49 +133,14 @@ private function generateSignature(\ReflectionClass $class)
133133
}
134134
}
135135

136-
if (defined('HHVM_VERSION')) {
137-
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
138-
// workaround HHVM bug with variadics, see https://github.com/facebook/hhvm/issues/5762
139-
yield preg_replace('/^ @@.*/m', '', new ReflectionMethodHhvmWrapper($m->class, $m->name));
140-
}
141-
} else {
142-
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
143-
yield preg_replace('/^ @@.*/m', '', $m);
136+
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
137+
yield preg_replace('/^ @@.*/m', '', $m);
144138

145-
$defaults = array();
146-
foreach ($m->getParameters() as $p) {
147-
$defaults[$p->name] = $p->isDefaultValueAvailable() ? $p->getDefaultValue() : null;
148-
}
149-
yield print_r($defaults, true);
139+
$defaults = array();
140+
foreach ($m->getParameters() as $p) {
141+
$defaults[$p->name] = $p->isDefaultValueAvailable() ? $p->getDefaultValue() : null;
150142
}
143+
yield print_r($defaults, true);
151144
}
152145
}
153146
}
154-
155-
/**
156-
* @internal
157-
*/
158-
class ReflectionMethodHhvmWrapper extends \ReflectionMethod
159-
{
160-
public function getParameters()
161-
{
162-
$params = array();
163-
164-
foreach (parent::getParameters() as $i => $p) {
165-
$params[] = new ReflectionParameterHhvmWrapper(array($this->class, $this->name), $i);
166-
}
167-
168-
return $params;
169-
}
170-
}
171-
172-
/**
173-
* @internal
174-
*/
175-
class ReflectionParameterHhvmWrapper extends \ReflectionParameter
176-
{
177-
public function getDefaultValue()
178-
{
179-
return array($this->isVariadic(), $this->isDefaultValueAvailable() ? parent::getDefaultValue() : null);
180-
}
181-
}

src/Symfony/Component/Console/Application.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,6 @@ public function renderException(\Exception $e, OutputInterface $output)
667667
$len = Helper::strlen($title);
668668

669669
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
670-
// HHVM only accepts 32 bits integer in str_split, even when PHP_INT_MAX is a 64 bit integer: https://github.com/facebook/hhvm/issues/1327
671-
if (defined('HHVM_VERSION') && $width > 1 << 31) {
672-
$width = 1 << 31;
673-
}
674670
$lines = array();
675671
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
676672
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {

src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ public function testStacking()
6666
if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) {
6767
$this->markTestSkipped('The ContextErrorException class is already loaded.');
6868
}
69-
if (defined('HHVM_VERSION')) {
70-
$this->markTestSkipped('HHVM is not handled in this test case.');
71-
}
7269

7370
ErrorHandler::register();
7471

src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -489,38 +489,4 @@ public function testHandleErrorException()
489489
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
490490
$this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
491491
}
492-
493-
public function testHandleFatalErrorOnHHVM()
494-
{
495-
try {
496-
$handler = ErrorHandler::register();
497-
498-
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
499-
$logger
500-
->expects($this->once())
501-
->method('log')
502-
->with(
503-
$this->equalTo(LogLevel::CRITICAL),
504-
$this->equalTo('Fatal Error: foo')
505-
)
506-
;
507-
508-
$handler->setDefaultLogger($logger, E_ERROR);
509-
510-
$error = array(
511-
'type' => E_ERROR + 0x1000000, // This error level is used by HHVM for fatal errors
512-
'message' => 'foo',
513-
'file' => 'bar',
514-
'line' => 123,
515-
'context' => array(123),
516-
'backtrace' => array(456),
517-
);
518-
519-
call_user_func_array(array($handler, 'handleError'), $error);
520-
$handler->handleFatalError($error);
521-
} finally {
522-
restore_error_handler();
523-
restore_exception_handler();
524-
}
525-
}
526492
}

src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ function () {},
233233
$this->assertSame(array('object', 'stdClass'), $array[$i++]);
234234
$this->assertSame(array('object', 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'), $array[$i++]);
235235
$this->assertSame(array('incomplete-object', 'BogusTestClass'), $array[$i++]);
236-
$this->assertSame(array('resource', defined('HHVM_VERSION') ? 'Directory' : 'stream'), $array[$i++]);
236+
$this->assertSame(array('resource', 'stream'), $array[$i++]);
237237
$this->assertSame(array('resource', 'stream'), $array[$i++]);
238238

239239
$args = $array[$i++];

src/Symfony/Component/Debug/Tests/FatalErrorHandler/UndefinedFunctionFatalErrorHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testUndefinedFunction($error, $translatedMessage)
2626
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
2727

2828
$this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception);
29-
// class names are case insensitive and PHP/HHVM do not return the same
29+
// class names are case insensitive and PHP do not return the same
3030
$this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage()));
3131
$this->assertSame($error['type'], $exception->getSeverity());
3232
$this->assertSame($error['file'], $exception->getFile());

src/Symfony/Component/DependencyInjection/Loader/FileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function findClasses($namespace, $pattern, $excludePattern)
105105

106106
$pattern = $parameterBag->unescapeValue($parameterBag->resolveValue($pattern));
107107
$classes = array();
108-
$extRegexp = defined('HHVM_VERSION') ? '/\\.(?:php|hh)$/' : '/\\.php$/';
108+
$extRegexp = '/\\.php$/';
109109
$prefixLen = null;
110110
foreach ($this->glob($pattern, true, $resource) as $path => $info) {
111111
if (null === $prefixLen) {

src/Symfony/Component/DependencyInjection/Tests/Compiler/FactoryReturnTypePassTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,8 @@ public function testProcess()
5252
/**
5353
* @dataProvider returnTypesProvider
5454
*/
55-
public function testReturnTypes($factory, $returnType, $hhvmSupport = true)
55+
public function testReturnTypes($factory, $returnType)
5656
{
57-
if (!$hhvmSupport && defined('HHVM_VERSION')) {
58-
$this->markTestSkipped('Scalar typehints not supported by hhvm.');
59-
}
60-
6157
$container = new ContainerBuilder();
6258

6359
$service = $container->register('service');
@@ -73,7 +69,7 @@ public function returnTypesProvider()
7369
{
7470
return array(
7571
// must be loaded before the function as they are in the same file
76-
array(array(FactoryDummy::class, 'createBuiltin'), null, false),
72+
array(array(FactoryDummy::class, 'createBuiltin'), null),
7773
array(array(FactoryDummy::class, 'createParent'), FactoryParent::class),
7874
array(array(FactoryDummy::class, 'createSelf'), FactoryDummy::class),
7975
array(factoryFunction::class, FactoryDummy::class),

src/Symfony/Component/DependencyInjection/Tests/Fixtures/FactoryDummy.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public function create(): \stdClass
2121
{
2222
}
2323

24-
// Not supported by hhvm
2524
public function createBuiltin(): int
2625
{
2726
}

src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ public function testTypeConversions($key, $value, $supported)
4949
*/
5050
public function testTypeConversionsWithNativePhp($key, $value, $supported)
5151
{
52-
if (defined('HHVM_VERSION_ID')) {
53-
return $this->markTestSkipped();
54-
}
55-
5652
if (!$supported) {
5753
$this->markTestSkipped(sprintf('Converting the value "%s" to "%s" is not supported by the IniFileLoader.', $key, $value));
5854
}

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function chgrp($files, $group, $recursive = false)
247247
$this->chgrp(new \FilesystemIterator($file), $group, true);
248248
}
249249
if (is_link($file) && function_exists('lchgrp')) {
250-
if (true !== @lchgrp($file, $group) || (defined('HHVM_VERSION') && !posix_getgrnam($group))) {
250+
if (true !== @lchgrp($file, $group)) {
251251
throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
252252
}
253253
} else {

0 commit comments

Comments
 (0)