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 -------2125437c09
[WebServerBundle] removed obsolete ServerCommand abstract classad1f35fc72
removed HHVM support
This commit is contained in:
commit
2b257d7c94
17
.travis.yml
17
.travis.yml
@ -62,17 +62,12 @@ before_install:
|
|||||||
export -f tfold
|
export -f tfold
|
||||||
|
|
||||||
# php.ini configuration
|
# php.ini configuration
|
||||||
if [[ $PHP = hhvm* ]]; then
|
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||||
INI=/etc/hhvm/php.ini
|
phpenv config-rm xdebug.ini || echo "xdebug not available"
|
||||||
else
|
|
||||||
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
|
||||||
phpenv config-rm xdebug.ini || echo "xdebug not available"
|
|
||||||
fi
|
|
||||||
echo date.timezone = Europe/Paris >> $INI
|
echo date.timezone = Europe/Paris >> $INI
|
||||||
echo memory_limit = -1 >> $INI
|
echo memory_limit = -1 >> $INI
|
||||||
echo session.gc_probability = 0 >> $INI
|
echo session.gc_probability = 0 >> $INI
|
||||||
echo opcache.enable_cli = 1 >> $INI
|
echo opcache.enable_cli = 1 >> $INI
|
||||||
echo hhvm.jit = 0 >> $INI
|
|
||||||
echo apc.enable_cli = 1 >> $INI
|
echo apc.enable_cli = 1 >> $INI
|
||||||
echo extension = ldap.so >> $INI
|
echo extension = ldap.so >> $INI
|
||||||
echo extension = redis.so >> $INI
|
echo extension = redis.so >> $INI
|
||||||
@ -80,7 +75,7 @@ before_install:
|
|||||||
echo extension = mongodb.so >> $INI
|
echo extension = mongodb.so >> $INI
|
||||||
|
|
||||||
# Matrix lines for intermediate PHP versions are skipped for pull requests
|
# Matrix lines for intermediate PHP versions are skipped for pull requests
|
||||||
if [[ ! $deps && ! $PHP = $MIN_PHP && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then
|
if [[ ! $deps && ! $PHP = $MIN_PHP && $TRAVIS_PULL_REQUEST != false ]]; then
|
||||||
deps=skip
|
deps=skip
|
||||||
skip=1
|
skip=1
|
||||||
else
|
else
|
||||||
@ -145,9 +140,7 @@ install:
|
|||||||
|
|
||||||
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
|
- if [[ ! $skip ]]; then $COMPOSER_UP; fi
|
||||||
- if [[ ! $skip ]]; then ./phpunit install; fi
|
- if [[ ! $skip ]]; then ./phpunit install; fi
|
||||||
- |
|
- php -i
|
||||||
# phpinfo
|
|
||||||
if [[ ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
|
|
||||||
|
|
||||||
- |
|
- |
|
||||||
run_tests () {
|
run_tests () {
|
||||||
@ -161,8 +154,6 @@ install:
|
|||||||
# Test the PhpUnit bridge on PHP 5.3, using the original phpunit script
|
# Test the PhpUnit bridge on PHP 5.3, using the original phpunit script
|
||||||
tfold src/Symfony/Bridge/PhpUnit \
|
tfold src/Symfony/Bridge/PhpUnit \
|
||||||
"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"
|
"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"
|
||||||
elif [[ $PHP = hhvm* ]]; then
|
|
||||||
$PHPUNIT --exclude-group benchmark,intl-data
|
|
||||||
else
|
else
|
||||||
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
|
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
|
||||||
tfold tty-group $PHPUNIT --group tty
|
tfold tty-group $PHPUNIT --group tty
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file is part of the Symfony package.
|
|
||||||
*
|
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Symfony\Bundle\WebServerBundle\Command;
|
|
||||||
|
|
||||||
use Symfony\Component\Console\Command\Command;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Base methods for commands related to a local web server.
|
|
||||||
*
|
|
||||||
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
|
||||||
*
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
abstract class ServerCommand extends Command
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function isEnabled()
|
|
||||||
{
|
|
||||||
return !defined('HHVM_VERSION') && parent::isEnabled();
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,6 +13,7 @@ namespace Symfony\Bundle\WebServerBundle\Command;
|
|||||||
|
|
||||||
use Symfony\Bundle\WebServerBundle\WebServer;
|
use Symfony\Bundle\WebServerBundle\WebServer;
|
||||||
use Symfony\Bundle\WebServerBundle\WebServerConfig;
|
use Symfony\Bundle\WebServerBundle\WebServerConfig;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
@ -26,7 +27,7 @@ use Symfony\Component\Process\Process;
|
|||||||
*
|
*
|
||||||
* @author Michał Pipa <michal.pipa.xsolve@gmail.com>
|
* @author Michał Pipa <michal.pipa.xsolve@gmail.com>
|
||||||
*/
|
*/
|
||||||
class ServerRunCommand extends ServerCommand
|
class ServerRunCommand extends Command
|
||||||
{
|
{
|
||||||
private $documentRoot;
|
private $documentRoot;
|
||||||
private $environment;
|
private $environment;
|
||||||
|
@ -13,6 +13,7 @@ namespace Symfony\Bundle\WebServerBundle\Command;
|
|||||||
|
|
||||||
use Symfony\Bundle\WebServerBundle\WebServer;
|
use Symfony\Bundle\WebServerBundle\WebServer;
|
||||||
use Symfony\Bundle\WebServerBundle\WebServerConfig;
|
use Symfony\Bundle\WebServerBundle\WebServerConfig;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
@ -25,7 +26,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
|||||||
*
|
*
|
||||||
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
||||||
*/
|
*/
|
||||||
class ServerStartCommand extends ServerCommand
|
class ServerStartCommand extends Command
|
||||||
{
|
{
|
||||||
private $documentRoot;
|
private $documentRoot;
|
||||||
private $environment;
|
private $environment;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Bundle\WebServerBundle\Command;
|
namespace Symfony\Bundle\WebServerBundle\Command;
|
||||||
|
|
||||||
use Symfony\Bundle\WebServerBundle\WebServer;
|
use Symfony\Bundle\WebServerBundle\WebServer;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
@ -24,7 +25,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
|||||||
*
|
*
|
||||||
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
||||||
*/
|
*/
|
||||||
class ServerStatusCommand extends ServerCommand
|
class ServerStatusCommand extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
namespace Symfony\Bundle\WebServerBundle\Command;
|
namespace Symfony\Bundle\WebServerBundle\Command;
|
||||||
|
|
||||||
use Symfony\Bundle\WebServerBundle\WebServer;
|
use Symfony\Bundle\WebServerBundle\WebServer;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
use Symfony\Component\Console\Output\ConsoleOutputInterface;
|
||||||
@ -23,7 +24,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
|||||||
*
|
*
|
||||||
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
* @author Christian Flothmann <christian.flothmann@xabbuh.de>
|
||||||
*/
|
*/
|
||||||
class ServerStopCommand extends ServerCommand
|
class ServerStopCommand extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
|
@ -63,7 +63,7 @@ class PhpArrayAdapter implements AdapterInterface
|
|||||||
public static function create($file, CacheItemPoolInterface $fallbackPool)
|
public static function create($file, CacheItemPoolInterface $fallbackPool)
|
||||||
{
|
{
|
||||||
// Shared memory is available in PHP 7.0+ with OPCache enabled and in HHVM
|
// Shared memory is available in PHP 7.0+ with OPCache enabled and in HHVM
|
||||||
if (ini_get('opcache.enable') || defined('HHVM_VERSION')) {
|
if (ini_get('opcache.enable')) {
|
||||||
if (!$fallbackPool instanceof AdapterInterface) {
|
if (!$fallbackPool instanceof AdapterInterface) {
|
||||||
$fallbackPool = new ProxyAdapter($fallbackPool);
|
$fallbackPool = new ProxyAdapter($fallbackPool);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ class PhpArrayCache implements CacheInterface
|
|||||||
public static function create($file, CacheInterface $fallbackPool)
|
public static function create($file, CacheInterface $fallbackPool)
|
||||||
{
|
{
|
||||||
// Shared memory is available in PHP 7.0+ with OPCache enabled and in HHVM
|
// Shared memory is available in PHP 7.0+ with OPCache enabled and in HHVM
|
||||||
if (ini_get('opcache.enable') || defined('HHVM_VERSION')) {
|
if (ini_get('opcache.enable')) {
|
||||||
return new static($file, $fallbackPool);
|
return new static($file, $fallbackPool);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,15 +15,6 @@ use Cache\IntegrationTests\CachePoolTest;
|
|||||||
|
|
||||||
abstract class AdapterTestCase extends CachePoolTest
|
abstract class AdapterTestCase extends CachePoolTest
|
||||||
{
|
{
|
||||||
protected function setUp()
|
|
||||||
{
|
|
||||||
parent::setUp();
|
|
||||||
|
|
||||||
if (!array_key_exists('testDeferredSaveWithoutCommit', $this->skippedTests) && defined('HHVM_VERSION')) {
|
|
||||||
$this->skippedTests['testDeferredSaveWithoutCommit'] = 'Destructors are called late on HHVM.';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testDefaultLifeTime()
|
public function testDefaultLifeTime()
|
||||||
{
|
{
|
||||||
if (isset($this->skippedTests[__FUNCTION__])) {
|
if (isset($this->skippedTests[__FUNCTION__])) {
|
||||||
|
@ -34,9 +34,6 @@
|
|||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/var-dumper": "<3.4"
|
"symfony/var-dumper": "<3.4"
|
||||||
},
|
},
|
||||||
"suggest": {
|
|
||||||
"symfony/polyfill-apcu": "For using ApcuAdapter on HHVM"
|
|
||||||
},
|
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Component\\Cache\\": "" },
|
"psr-4": { "Symfony\\Component\\Cache\\": "" },
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
|
@ -133,49 +133,14 @@ class ReflectionClassResource implements SelfCheckingResourceInterface, \Seriali
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('HHVM_VERSION')) {
|
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
|
||||||
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
|
yield preg_replace('/^ @@.*/m', '', $m);
|
||||||
// workaround HHVM bug with variadics, see https://github.com/facebook/hhvm/issues/5762
|
|
||||||
yield preg_replace('/^ @@.*/m', '', new ReflectionMethodHhvmWrapper($m->class, $m->name));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
|
|
||||||
yield preg_replace('/^ @@.*/m', '', $m);
|
|
||||||
|
|
||||||
$defaults = array();
|
$defaults = array();
|
||||||
foreach ($m->getParameters() as $p) {
|
foreach ($m->getParameters() as $p) {
|
||||||
$defaults[$p->name] = $p->isDefaultValueAvailable() ? $p->getDefaultValue() : null;
|
$defaults[$p->name] = $p->isDefaultValueAvailable() ? $p->getDefaultValue() : null;
|
||||||
}
|
|
||||||
yield print_r($defaults, true);
|
|
||||||
}
|
}
|
||||||
|
yield print_r($defaults, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
class ReflectionMethodHhvmWrapper extends \ReflectionMethod
|
|
||||||
{
|
|
||||||
public function getParameters()
|
|
||||||
{
|
|
||||||
$params = array();
|
|
||||||
|
|
||||||
foreach (parent::getParameters() as $i => $p) {
|
|
||||||
$params[] = new ReflectionParameterHhvmWrapper(array($this->class, $this->name), $i);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $params;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
class ReflectionParameterHhvmWrapper extends \ReflectionParameter
|
|
||||||
{
|
|
||||||
public function getDefaultValue()
|
|
||||||
{
|
|
||||||
return array($this->isVariadic(), $this->isDefaultValueAvailable() ? parent::getDefaultValue() : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -667,10 +667,6 @@ class Application
|
|||||||
$len = Helper::strlen($title);
|
$len = Helper::strlen($title);
|
||||||
|
|
||||||
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
|
$width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : PHP_INT_MAX;
|
||||||
// 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
|
|
||||||
if (defined('HHVM_VERSION') && $width > 1 << 31) {
|
|
||||||
$width = 1 << 31;
|
|
||||||
}
|
|
||||||
$lines = array();
|
$lines = array();
|
||||||
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
|
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
|
||||||
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
|
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
|
||||||
|
@ -66,9 +66,6 @@ class DebugClassLoaderTest extends TestCase
|
|||||||
if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) {
|
if (class_exists('Symfony\Component\Debug\Exception\ContextErrorException', false)) {
|
||||||
$this->markTestSkipped('The ContextErrorException class is already loaded.');
|
$this->markTestSkipped('The ContextErrorException class is already loaded.');
|
||||||
}
|
}
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('HHVM is not handled in this test case.');
|
|
||||||
}
|
|
||||||
|
|
||||||
ErrorHandler::register();
|
ErrorHandler::register();
|
||||||
|
|
||||||
|
@ -489,38 +489,4 @@ class ErrorHandlerTest extends TestCase
|
|||||||
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
|
$this->assertInstanceOf('Symfony\Component\Debug\Exception\ClassNotFoundException', $args[0]);
|
||||||
$this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
|
$this->assertStringStartsWith("Attempted to load class \"Foo\" from the global namespace.\nDid you forget a \"use\" statement", $args[0]->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testHandleFatalErrorOnHHVM()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$handler = ErrorHandler::register();
|
|
||||||
|
|
||||||
$logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
|
|
||||||
$logger
|
|
||||||
->expects($this->once())
|
|
||||||
->method('log')
|
|
||||||
->with(
|
|
||||||
$this->equalTo(LogLevel::CRITICAL),
|
|
||||||
$this->equalTo('Fatal Error: foo')
|
|
||||||
)
|
|
||||||
;
|
|
||||||
|
|
||||||
$handler->setDefaultLogger($logger, E_ERROR);
|
|
||||||
|
|
||||||
$error = array(
|
|
||||||
'type' => E_ERROR + 0x1000000, // This error level is used by HHVM for fatal errors
|
|
||||||
'message' => 'foo',
|
|
||||||
'file' => 'bar',
|
|
||||||
'line' => 123,
|
|
||||||
'context' => array(123),
|
|
||||||
'backtrace' => array(456),
|
|
||||||
);
|
|
||||||
|
|
||||||
call_user_func_array(array($handler, 'handleError'), $error);
|
|
||||||
$handler->handleFatalError($error);
|
|
||||||
} finally {
|
|
||||||
restore_error_handler();
|
|
||||||
restore_exception_handler();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ class FlattenExceptionTest extends TestCase
|
|||||||
$this->assertSame(array('object', 'stdClass'), $array[$i++]);
|
$this->assertSame(array('object', 'stdClass'), $array[$i++]);
|
||||||
$this->assertSame(array('object', 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'), $array[$i++]);
|
$this->assertSame(array('object', 'Symfony\Component\HttpKernel\Exception\NotFoundHttpException'), $array[$i++]);
|
||||||
$this->assertSame(array('incomplete-object', 'BogusTestClass'), $array[$i++]);
|
$this->assertSame(array('incomplete-object', 'BogusTestClass'), $array[$i++]);
|
||||||
$this->assertSame(array('resource', defined('HHVM_VERSION') ? 'Directory' : 'stream'), $array[$i++]);
|
$this->assertSame(array('resource', 'stream'), $array[$i++]);
|
||||||
$this->assertSame(array('resource', 'stream'), $array[$i++]);
|
$this->assertSame(array('resource', 'stream'), $array[$i++]);
|
||||||
|
|
||||||
$args = $array[$i++];
|
$args = $array[$i++];
|
||||||
|
@ -26,7 +26,7 @@ class UndefinedFunctionFatalErrorHandlerTest extends TestCase
|
|||||||
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
|
$exception = $handler->handleError($error, new FatalErrorException('', 0, $error['type'], $error['file'], $error['line']));
|
||||||
|
|
||||||
$this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception);
|
$this->assertInstanceOf('Symfony\Component\Debug\Exception\UndefinedFunctionException', $exception);
|
||||||
// class names are case insensitive and PHP/HHVM do not return the same
|
// class names are case insensitive and PHP do not return the same
|
||||||
$this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage()));
|
$this->assertSame(strtolower($translatedMessage), strtolower($exception->getMessage()));
|
||||||
$this->assertSame($error['type'], $exception->getSeverity());
|
$this->assertSame($error['type'], $exception->getSeverity());
|
||||||
$this->assertSame($error['file'], $exception->getFile());
|
$this->assertSame($error['file'], $exception->getFile());
|
||||||
|
@ -105,7 +105,7 @@ abstract class FileLoader extends BaseFileLoader
|
|||||||
|
|
||||||
$pattern = $parameterBag->unescapeValue($parameterBag->resolveValue($pattern));
|
$pattern = $parameterBag->unescapeValue($parameterBag->resolveValue($pattern));
|
||||||
$classes = array();
|
$classes = array();
|
||||||
$extRegexp = defined('HHVM_VERSION') ? '/\\.(?:php|hh)$/' : '/\\.php$/';
|
$extRegexp = '/\\.php$/';
|
||||||
$prefixLen = null;
|
$prefixLen = null;
|
||||||
foreach ($this->glob($pattern, true, $resource) as $path => $info) {
|
foreach ($this->glob($pattern, true, $resource) as $path => $info) {
|
||||||
if (null === $prefixLen) {
|
if (null === $prefixLen) {
|
||||||
|
@ -52,12 +52,8 @@ class FactoryReturnTypePassTest extends TestCase
|
|||||||
/**
|
/**
|
||||||
* @dataProvider returnTypesProvider
|
* @dataProvider returnTypesProvider
|
||||||
*/
|
*/
|
||||||
public function testReturnTypes($factory, $returnType, $hhvmSupport = true)
|
public function testReturnTypes($factory, $returnType)
|
||||||
{
|
{
|
||||||
if (!$hhvmSupport && defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('Scalar typehints not supported by hhvm.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
|
||||||
$service = $container->register('service');
|
$service = $container->register('service');
|
||||||
@ -73,7 +69,7 @@ class FactoryReturnTypePassTest extends TestCase
|
|||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
// must be loaded before the function as they are in the same file
|
// must be loaded before the function as they are in the same file
|
||||||
array(array(FactoryDummy::class, 'createBuiltin'), null, false),
|
array(array(FactoryDummy::class, 'createBuiltin'), null),
|
||||||
array(array(FactoryDummy::class, 'createParent'), FactoryParent::class),
|
array(array(FactoryDummy::class, 'createParent'), FactoryParent::class),
|
||||||
array(array(FactoryDummy::class, 'createSelf'), FactoryDummy::class),
|
array(array(FactoryDummy::class, 'createSelf'), FactoryDummy::class),
|
||||||
array(factoryFunction::class, FactoryDummy::class),
|
array(factoryFunction::class, FactoryDummy::class),
|
||||||
|
@ -21,7 +21,6 @@ class FactoryDummy extends FactoryParent
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not supported by hhvm
|
|
||||||
public function createBuiltin(): int
|
public function createBuiltin(): int
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -49,10 +49,6 @@ class IniFileLoaderTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testTypeConversionsWithNativePhp($key, $value, $supported)
|
public function testTypeConversionsWithNativePhp($key, $value, $supported)
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION_ID')) {
|
|
||||||
return $this->markTestSkipped();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$supported) {
|
if (!$supported) {
|
||||||
$this->markTestSkipped(sprintf('Converting the value "%s" to "%s" is not supported by the IniFileLoader.', $key, $value));
|
$this->markTestSkipped(sprintf('Converting the value "%s" to "%s" is not supported by the IniFileLoader.', $key, $value));
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ class Filesystem
|
|||||||
$this->chgrp(new \FilesystemIterator($file), $group, true);
|
$this->chgrp(new \FilesystemIterator($file), $group, true);
|
||||||
}
|
}
|
||||||
if (is_link($file) && function_exists('lchgrp')) {
|
if (is_link($file) && function_exists('lchgrp')) {
|
||||||
if (true !== @lchgrp($file, $group) || (defined('HHVM_VERSION') && !posix_getgrnam($group))) {
|
if (true !== @lchgrp($file, $group)) {
|
||||||
throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
|
throw new IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -449,10 +449,6 @@ class FilesystemTest extends FilesystemTestCase
|
|||||||
{
|
{
|
||||||
$this->markAsSkippedIfChmodIsMissing();
|
$this->markAsSkippedIfChmodIsMissing();
|
||||||
|
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('chmod() changes permissions even when passing invalid modes on HHVM');
|
|
||||||
}
|
|
||||||
|
|
||||||
$dir = $this->workspace.DIRECTORY_SEPARATOR.'file';
|
$dir = $this->workspace.DIRECTORY_SEPARATOR.'file';
|
||||||
touch($dir);
|
touch($dir);
|
||||||
|
|
||||||
@ -1426,10 +1422,6 @@ class FilesystemTest extends FilesystemTestCase
|
|||||||
|
|
||||||
public function testDumpFileWithFileScheme()
|
public function testDumpFileWithFileScheme()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('HHVM does not handle the file:// scheme correctly');
|
|
||||||
}
|
|
||||||
|
|
||||||
$scheme = 'file://';
|
$scheme = 'file://';
|
||||||
$filename = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';
|
$filename = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';
|
||||||
|
|
||||||
@ -1476,10 +1468,6 @@ class FilesystemTest extends FilesystemTestCase
|
|||||||
|
|
||||||
public function testAppendToFileWithScheme()
|
public function testAppendToFileWithScheme()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('HHVM does not handle the file:// scheme correctly');
|
|
||||||
}
|
|
||||||
|
|
||||||
$scheme = 'file://';
|
$scheme = 'file://';
|
||||||
$filename = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';
|
$filename = $scheme.$this->workspace.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'baz.txt';
|
||||||
$this->filesystem->dumpFile($filename, 'foo');
|
$this->filesystem->dumpFile($filename, 'foo');
|
||||||
|
@ -132,11 +132,6 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
|||||||
return $this->rewindable;
|
return $this->rewindable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// workaround for an HHVM bug, should be removed when https://github.com/facebook/hhvm/issues/7281 is fixed
|
|
||||||
if ('' === $this->getPath()) {
|
|
||||||
return $this->rewindable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (false !== $stream = @opendir($this->getPath())) {
|
if (false !== $stream = @opendir($this->getPath())) {
|
||||||
$infos = stream_get_meta_data($stream);
|
$infos = stream_get_meta_data($stream);
|
||||||
closedir($stream);
|
closedir($stream);
|
||||||
|
@ -139,23 +139,16 @@ class JsonResponse extends Response
|
|||||||
*/
|
*/
|
||||||
public function setData($data = array())
|
public function setData($data = array())
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
try {
|
||||||
// HHVM does not trigger any warnings and let exceptions
|
// PHP 5.4 and up wrap exceptions thrown by JsonSerializable
|
||||||
// thrown from a JsonSerializable object pass through.
|
// objects in a new exception that needs to be removed.
|
||||||
// If only PHP did the same...
|
// Fortunately, PHP 5.5 and up do not trigger any warning anymore.
|
||||||
$data = json_encode($data, $this->encodingOptions);
|
$data = json_encode($data, $this->encodingOptions);
|
||||||
} else {
|
} catch (\Exception $e) {
|
||||||
try {
|
if ('Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
|
||||||
// PHP 5.4 and up wrap exceptions thrown by JsonSerializable
|
throw $e->getPrevious() ?: $e;
|
||||||
// objects in a new exception that needs to be removed.
|
|
||||||
// Fortunately, PHP 5.5 and up do not trigger any warning anymore.
|
|
||||||
$data = json_encode($data, $this->encodingOptions);
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
if ('Exception' === get_class($e) && 0 === strpos($e->getMessage(), 'Failed calling ')) {
|
|
||||||
throw $e->getPrevious() ?: $e;
|
|
||||||
}
|
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (JSON_ERROR_NONE !== json_last_error()) {
|
if (JSON_ERROR_NONE !== json_last_error()) {
|
||||||
|
@ -1258,8 +1258,7 @@ class Response
|
|||||||
{
|
{
|
||||||
$status = ob_get_status(true);
|
$status = ob_get_status(true);
|
||||||
$level = count($status);
|
$level = count($status);
|
||||||
// PHP_OUTPUT_HANDLER_* are not defined on HHVM 3.3
|
$flags = PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE);
|
||||||
$flags = defined('PHP_OUTPUT_HANDLER_REMOVABLE') ? PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE) : -1;
|
|
||||||
|
|
||||||
while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || $flags === ($s['flags'] & $flags) : $s['del'])) {
|
while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || $flags === ($s['flags'] & $flags) : $s['del'])) {
|
||||||
if ($flush) {
|
if ($flush) {
|
||||||
|
@ -31,10 +31,6 @@ class MemcacheSessionHandlerTest extends TestCase
|
|||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('PHPUnit_MockObject cannot mock the Memcache class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->memcache = $this->getMockBuilder('Memcache')->getMock();
|
$this->memcache = $this->getMockBuilder('Memcache')->getMock();
|
||||||
$this->storage = new MemcacheSessionHandler(
|
$this->storage = new MemcacheSessionHandler(
|
||||||
|
@ -32,10 +32,6 @@ class MemcachedSessionHandlerTest extends TestCase
|
|||||||
|
|
||||||
protected function setUp()
|
protected function setUp()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('PHPUnit_MockObject cannot mock the Memcached class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
|
|
||||||
}
|
|
||||||
|
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
if (version_compare(phpversion('memcached'), '2.2.0', '>=') && version_compare(phpversion('memcached'), '3.0.0b1', '<')) {
|
if (version_compare(phpversion('memcached'), '2.2.0', '>=') && version_compare(phpversion('memcached'), '3.0.0b1', '<')) {
|
||||||
|
@ -136,10 +136,6 @@ class PdoSessionHandlerTest extends TestCase
|
|||||||
|
|
||||||
public function testReadConvertsStreamToString()
|
public function testReadConvertsStreamToString()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('PHPUnit_MockObject cannot mock the PDOStatement class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
|
|
||||||
}
|
|
||||||
|
|
||||||
$pdo = new MockPdo('pgsql');
|
$pdo = new MockPdo('pgsql');
|
||||||
$pdo->prepareResult = $this->getMockBuilder('PDOStatement')->getMock();
|
$pdo->prepareResult = $this->getMockBuilder('PDOStatement')->getMock();
|
||||||
|
|
||||||
@ -157,10 +153,6 @@ class PdoSessionHandlerTest extends TestCase
|
|||||||
|
|
||||||
public function testReadLockedConvertsStreamToString()
|
public function testReadLockedConvertsStreamToString()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('PHPUnit_MockObject cannot mock the PDOStatement class on HHVM. See https://github.com/sebastianbergmann/phpunit-mock-objects/pull/289');
|
|
||||||
}
|
|
||||||
|
|
||||||
$pdo = new MockPdo('pgsql');
|
$pdo = new MockPdo('pgsql');
|
||||||
$selectStmt = $this->getMockBuilder('PDOStatement')->getMock();
|
$selectStmt = $this->getMockBuilder('PDOStatement')->getMock();
|
||||||
$insertStmt = $this->getMockBuilder('PDOStatement')->getMock();
|
$insertStmt = $this->getMockBuilder('PDOStatement')->getMock();
|
||||||
|
@ -51,10 +51,6 @@ class IntlBundleReaderTest extends TestCase
|
|||||||
|
|
||||||
public function testReadDoesNotFollowFallback()
|
public function testReadDoesNotFollowFallback()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('ResourceBundle does not support disabling fallback properly on HHVM.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// "ro_MD" -> "ro"
|
// "ro_MD" -> "ro"
|
||||||
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'ro_MD');
|
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'ro_MD');
|
||||||
|
|
||||||
@ -67,10 +63,6 @@ class IntlBundleReaderTest extends TestCase
|
|||||||
|
|
||||||
public function testReadDoesNotFollowFallbackAlias()
|
public function testReadDoesNotFollowFallbackAlias()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('ResourceBundle does not support disabling fallback properly on HHVM.');
|
|
||||||
}
|
|
||||||
|
|
||||||
// "mo" = "ro_MD" -> "ro"
|
// "mo" = "ro_MD" -> "ro"
|
||||||
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'mo');
|
$data = $this->reader->read(__DIR__.'/Fixtures/res', 'mo');
|
||||||
|
|
||||||
|
@ -326,7 +326,7 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
|
|||||||
|
|
||||||
public function formatTimezoneProvider()
|
public function formatTimezoneProvider()
|
||||||
{
|
{
|
||||||
$cases = array(
|
return array(
|
||||||
array('z', 'GMT', 'GMT'),
|
array('z', 'GMT', 'GMT'),
|
||||||
array('zz', 'GMT', 'GMT'),
|
array('zz', 'GMT', 'GMT'),
|
||||||
array('zzz', 'GMT', 'GMT'),
|
array('zzz', 'GMT', 'GMT'),
|
||||||
@ -365,20 +365,13 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
|
|||||||
array('zzzzz', 'Etc/Zulu', 'Coordinated Universal Time'),
|
array('zzzzz', 'Etc/Zulu', 'Coordinated Universal Time'),
|
||||||
array('zzzzz', 'Etc/UCT', 'Coordinated Universal Time'),
|
array('zzzzz', 'Etc/UCT', 'Coordinated Universal Time'),
|
||||||
array('zzzzz', 'Etc/Greenwich', 'Greenwich Mean Time'),
|
array('zzzzz', 'Etc/Greenwich', 'Greenwich Mean Time'),
|
||||||
|
|
||||||
|
array('z', 'GMT+03:00', 'GMT+3'),
|
||||||
|
array('zz', 'GMT+03:00', 'GMT+3'),
|
||||||
|
array('zzz', 'GMT+03:00', 'GMT+3'),
|
||||||
|
array('zzzz', 'GMT+03:00', 'GMT+03:00'),
|
||||||
|
array('zzzzz', 'GMT+03:00', 'GMT+03:00'),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!defined('HHVM_VERSION')) {
|
|
||||||
// these timezones are not considered valid in HHVM
|
|
||||||
$cases = array_merge($cases, array(
|
|
||||||
array('z', 'GMT+03:00', 'GMT+3'),
|
|
||||||
array('zz', 'GMT+03:00', 'GMT+3'),
|
|
||||||
array('zzz', 'GMT+03:00', 'GMT+3'),
|
|
||||||
array('zzzz', 'GMT+03:00', 'GMT+03:00'),
|
|
||||||
array('zzzzz', 'GMT+03:00', 'GMT+03:00'),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
return $cases;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFormatWithGmtTimezone()
|
public function testFormatWithGmtTimezone()
|
||||||
@ -428,10 +421,6 @@ abstract class AbstractIntlDateFormatterTest extends TestCase
|
|||||||
|
|
||||||
public function testFormatWithDateTimeZoneGmtOffset()
|
public function testFormatWithDateTimeZoneGmtOffset()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION_ID')) {
|
|
||||||
$this->markTestSkipped('See https://github.com/facebook/hhvm/issues/5875');
|
|
||||||
}
|
|
||||||
|
|
||||||
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, new \DateTimeZone('GMT+03:00'), IntlDateFormatter::GREGORIAN, 'zzzz');
|
$formatter = $this->getDateFormatter('en', IntlDateFormatter::MEDIUM, IntlDateFormatter::SHORT, new \DateTimeZone('GMT+03:00'), IntlDateFormatter::GREGORIAN, 'zzzz');
|
||||||
|
|
||||||
$this->assertEquals('GMT+03:00', $formatter->format(0));
|
$this->assertEquals('GMT+03:00', $formatter->format(0));
|
||||||
|
@ -42,7 +42,7 @@ class IntlTestHelper
|
|||||||
// * the intl extension is loaded with version Intl::getIcuStubVersion()
|
// * the intl extension is loaded with version Intl::getIcuStubVersion()
|
||||||
// * the intl extension is not loaded
|
// * the intl extension is not loaded
|
||||||
|
|
||||||
if (($minimumIcuVersion || defined('HHVM_VERSION_ID')) && IcuVersion::compare(Intl::getIcuVersion(), $minimumIcuVersion, '<', 1)) {
|
if ($minimumIcuVersion && IcuVersion::compare(Intl::getIcuVersion(), $minimumIcuVersion, '<', 1)) {
|
||||||
$testCase->markTestSkipped('ICU version '.$minimumIcuVersion.' is required.');
|
$testCase->markTestSkipped('ICU version '.$minimumIcuVersion.' is required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,11 +38,6 @@ class PhpExecutableFinder
|
|||||||
$args = $this->findArguments();
|
$args = $this->findArguments();
|
||||||
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
|
$args = $includeArgs && $args ? ' '.implode(' ', $args) : '';
|
||||||
|
|
||||||
// HHVM support
|
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
return (getenv('PHP_BINARY') ?: PHP_BINARY).$args;
|
|
||||||
}
|
|
||||||
|
|
||||||
// PHP_BINARY return the current sapi executable
|
// PHP_BINARY return the current sapi executable
|
||||||
if (PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
|
if (PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) && is_file(PHP_BINARY)) {
|
||||||
return PHP_BINARY.$args;
|
return PHP_BINARY.$args;
|
||||||
@ -78,10 +73,7 @@ class PhpExecutableFinder
|
|||||||
public function findArguments()
|
public function findArguments()
|
||||||
{
|
{
|
||||||
$arguments = array();
|
$arguments = array();
|
||||||
|
if ('phpdbg' === PHP_SAPI) {
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$arguments[] = '--php';
|
|
||||||
} elseif ('phpdbg' === PHP_SAPI) {
|
|
||||||
$arguments[] = '-qrr';
|
$arguments[] = '-qrr';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1449,7 +1449,7 @@ class Process implements \IteratorAggregate
|
|||||||
return self::$sigchild;
|
return self::$sigchild;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('phpinfo') || defined('HHVM_VERSION')) {
|
if (!function_exists('phpinfo')) {
|
||||||
return self::$sigchild = false;
|
return self::$sigchild = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class ExecutableFinderTest extends TestCase
|
|||||||
$this->markTestSkipped('Cannot test when open_basedir is set');
|
$this->markTestSkipped('Cannot test when open_basedir is set');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->iniSet('open_basedir', dirname(PHP_BINARY).(!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR.'/' : ''));
|
$this->iniSet('open_basedir', dirname(PHP_BINARY).PATH_SEPARATOR.'/');
|
||||||
|
|
||||||
$finder = new ExecutableFinder();
|
$finder = new ExecutableFinder();
|
||||||
$result = $finder->find($this->getPhpBinaryName());
|
$result = $finder->find($this->getPhpBinaryName());
|
||||||
@ -109,7 +109,7 @@ class ExecutableFinderTest extends TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->setPath('');
|
$this->setPath('');
|
||||||
$this->iniSet('open_basedir', PHP_BINARY.(!defined('HHVM_VERSION') || HHVM_VERSION_ID >= 30800 ? PATH_SEPARATOR.'/' : ''));
|
$this->iniSet('open_basedir', PHP_BINARY.PATH_SEPARATOR.'/');
|
||||||
|
|
||||||
$finder = new ExecutableFinder();
|
$finder = new ExecutableFinder();
|
||||||
$result = $finder->find($this->getPhpBinaryName(), false);
|
$result = $finder->find($this->getPhpBinaryName(), false);
|
||||||
|
@ -24,10 +24,6 @@ class PhpExecutableFinderTest extends TestCase
|
|||||||
*/
|
*/
|
||||||
public function testFind()
|
public function testFind()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('Should not be executed in HHVM context.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$f = new PhpExecutableFinder();
|
$f = new PhpExecutableFinder();
|
||||||
|
|
||||||
$current = PHP_BINARY;
|
$current = PHP_BINARY;
|
||||||
@ -37,23 +33,6 @@ class PhpExecutableFinderTest extends TestCase
|
|||||||
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
|
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* tests find() with the env var / constant PHP_BINARY with HHVM.
|
|
||||||
*/
|
|
||||||
public function testFindWithHHVM()
|
|
||||||
{
|
|
||||||
if (!defined('HHVM_VERSION')) {
|
|
||||||
$this->markTestSkipped('Should be executed in HHVM context.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$f = new PhpExecutableFinder();
|
|
||||||
|
|
||||||
$current = getenv('PHP_BINARY') ?: PHP_BINARY;
|
|
||||||
|
|
||||||
$this->assertEquals($current.' --php', $f->find(), '::find() returns the executable PHP');
|
|
||||||
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tests find() with the env var PHP_PATH.
|
* tests find() with the env var PHP_PATH.
|
||||||
*/
|
*/
|
||||||
@ -61,9 +40,7 @@ class PhpExecutableFinderTest extends TestCase
|
|||||||
{
|
{
|
||||||
$f = new PhpExecutableFinder();
|
$f = new PhpExecutableFinder();
|
||||||
|
|
||||||
if (defined('HHVM_VERSION')) {
|
if ('phpdbg' === PHP_SAPI) {
|
||||||
$this->assertEquals($f->findArguments(), array('--php'), '::findArguments() returns HHVM arguments');
|
|
||||||
} elseif ('phpdbg' === PHP_SAPI) {
|
|
||||||
$this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments');
|
$this->assertEquals($f->findArguments(), array('-qrr'), '::findArguments() returns phpdbg arguments');
|
||||||
} else {
|
} else {
|
||||||
$this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments');
|
$this->assertEquals($f->findArguments(), array(), '::findArguments() returns no arguments');
|
||||||
|
@ -86,10 +86,6 @@ class PhpGeneratorDumperTest extends TestCase
|
|||||||
|
|
||||||
public function testDumpWithTooManyRoutes()
|
public function testDumpWithTooManyRoutes()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION_ID')) {
|
|
||||||
$this->markTestSkipped('HHVM consumes too much memory on this test.');
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
|
$this->routeCollection->add('Test', new Route('/testing/{foo}'));
|
||||||
for ($i = 0; $i < 32769; ++$i) {
|
for ($i = 0; $i < 32769; ++$i) {
|
||||||
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
|
$this->routeCollection->add('route_'.$i, new Route('/route_'.$i));
|
||||||
|
File diff suppressed because one or more lines are too long
@ -30,15 +30,6 @@ class RedisCaster
|
|||||||
{
|
{
|
||||||
$prefix = Caster::PREFIX_VIRTUAL;
|
$prefix = Caster::PREFIX_VIRTUAL;
|
||||||
|
|
||||||
if (defined('HHVM_VERSION_ID')) {
|
|
||||||
if (isset($a[Caster::PREFIX_PROTECTED.'serializer'])) {
|
|
||||||
$ser = $a[Caster::PREFIX_PROTECTED.'serializer'];
|
|
||||||
$a[Caster::PREFIX_PROTECTED.'serializer'] = isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $a;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$connected = $c->isConnected()) {
|
if (!$connected = $c->isConnected()) {
|
||||||
return $a + array(
|
return $a + array(
|
||||||
$prefix.'isConnected' => $connected,
|
$prefix.'isConnected' => $connected,
|
||||||
|
@ -36,7 +36,6 @@ class ReflectionCaster
|
|||||||
$prefix = Caster::PREFIX_VIRTUAL;
|
$prefix = Caster::PREFIX_VIRTUAL;
|
||||||
$c = new \ReflectionFunction($c);
|
$c = new \ReflectionFunction($c);
|
||||||
|
|
||||||
$stub->class = 'Closure'; // HHVM generates unique class names for closures
|
|
||||||
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
||||||
|
|
||||||
if (isset($a[$prefix.'parameters'])) {
|
if (isset($a[$prefix.'parameters'])) {
|
||||||
@ -213,9 +212,6 @@ class ReflectionCaster
|
|||||||
self::addExtra($a, $c);
|
self::addExtra($a, $c);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Added by HHVM
|
|
||||||
unset($a[Caster::PREFIX_DYNAMIC.'static']);
|
|
||||||
|
|
||||||
return $a;
|
return $a;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,9 +226,6 @@ class ReflectionCaster
|
|||||||
{
|
{
|
||||||
$prefix = Caster::PREFIX_VIRTUAL;
|
$prefix = Caster::PREFIX_VIRTUAL;
|
||||||
|
|
||||||
// Added by HHVM
|
|
||||||
unset($a['info']);
|
|
||||||
|
|
||||||
self::addMap($a, $c, array(
|
self::addMap($a, $c, array(
|
||||||
'position' => 'getPosition',
|
'position' => 'getPosition',
|
||||||
'isVariadic' => 'isVariadic',
|
'isVariadic' => 'isVariadic',
|
||||||
|
@ -282,23 +282,19 @@ class VarCloner extends AbstractCloner
|
|||||||
self::$hashOffset = 16 - PHP_INT_SIZE;
|
self::$hashOffset = 16 - PHP_INT_SIZE;
|
||||||
self::$hashMask = -1;
|
self::$hashMask = -1;
|
||||||
|
|
||||||
if (defined('HHVM_VERSION')) {
|
// check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
|
||||||
self::$hashOffset += 16;
|
$obFuncs = array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush');
|
||||||
} else {
|
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
|
||||||
// check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
|
if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && in_array($frame['function'], $obFuncs)) {
|
||||||
$obFuncs = array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush');
|
$frame['line'] = 0;
|
||||||
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
|
break;
|
||||||
if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && in_array($frame['function'], $obFuncs)) {
|
|
||||||
$frame['line'] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!empty($frame['line'])) {
|
|
||||||
ob_start();
|
|
||||||
debug_zval_dump($obj);
|
|
||||||
self::$hashMask = (int) substr(ob_get_clean(), 17);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!empty($frame['line'])) {
|
||||||
|
ob_start();
|
||||||
|
debug_zval_dump($obj);
|
||||||
|
self::$hashMask = (int) substr(ob_get_clean(), 17);
|
||||||
|
}
|
||||||
|
|
||||||
self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, PHP_INT_SIZE));
|
self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, PHP_INT_SIZE));
|
||||||
}
|
}
|
||||||
|
@ -26,20 +26,11 @@ class RedisCasterTest extends TestCase
|
|||||||
{
|
{
|
||||||
$redis = new \Redis();
|
$redis = new \Redis();
|
||||||
|
|
||||||
if (defined('HHVM_VERSION_ID')) {
|
$xCast = <<<'EODUMP'
|
||||||
$xCast = <<<'EODUMP'
|
|
||||||
Redis {
|
|
||||||
#host: ""
|
|
||||||
%A
|
|
||||||
}
|
|
||||||
EODUMP;
|
|
||||||
} else {
|
|
||||||
$xCast = <<<'EODUMP'
|
|
||||||
Redis {
|
Redis {
|
||||||
isConnected: false
|
isConnected: false
|
||||||
}
|
}
|
||||||
EODUMP;
|
EODUMP;
|
||||||
}
|
|
||||||
|
|
||||||
$this->assertDumpMatchesFormat($xCast, $redis);
|
$this->assertDumpMatchesFormat($xCast, $redis);
|
||||||
}
|
}
|
||||||
@ -52,15 +43,7 @@ EODUMP;
|
|||||||
self::markTestSkipped($e['message']);
|
self::markTestSkipped($e['message']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('HHVM_VERSION_ID')) {
|
$xCast = <<<'EODUMP'
|
||||||
$xCast = <<<'EODUMP'
|
|
||||||
Redis {
|
|
||||||
#host: "127.0.0.1"
|
|
||||||
%A
|
|
||||||
}
|
|
||||||
EODUMP;
|
|
||||||
} else {
|
|
||||||
$xCast = <<<'EODUMP'
|
|
||||||
Redis {
|
Redis {
|
||||||
+"socket": Redis Socket Buffer resource
|
+"socket": Redis Socket Buffer resource
|
||||||
isConnected: true
|
isConnected: true
|
||||||
@ -78,7 +61,6 @@ Redis {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
EODUMP;
|
EODUMP;
|
||||||
}
|
|
||||||
|
|
||||||
$this->assertDumpMatchesFormat($xCast, $redis);
|
$this->assertDumpMatchesFormat($xCast, $redis);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,6 @@ class CliDumperTest extends TestCase
|
|||||||
$intMax = PHP_INT_MAX;
|
$intMax = PHP_INT_MAX;
|
||||||
$res = (int) $var['res'];
|
$res = (int) $var['res'];
|
||||||
|
|
||||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
|
||||||
$this->assertStringMatchesFormat(
|
$this->assertStringMatchesFormat(
|
||||||
<<<EOTXT
|
<<<EOTXT
|
||||||
array:24 [
|
array:24 [
|
||||||
@ -74,9 +73,9 @@ array:24 [
|
|||||||
+foo: "foo"
|
+foo: "foo"
|
||||||
+"bar": "bar"
|
+"bar": "bar"
|
||||||
}
|
}
|
||||||
"closure" => Closure {{$r}
|
"closure" => Closure {#%d
|
||||||
class: "Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest"
|
class: "Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest"
|
||||||
this: Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest {{$r} …}
|
this: Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest {#%d …}
|
||||||
parameters: {
|
parameters: {
|
||||||
\$a: {}
|
\$a: {}
|
||||||
&\$b: {
|
&\$b: {
|
||||||
@ -231,10 +230,6 @@ EOTXT
|
|||||||
|
|
||||||
public function testClosedResource()
|
public function testClosedResource()
|
||||||
{
|
{
|
||||||
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
|
||||||
$this->markTestSkipped();
|
|
||||||
}
|
|
||||||
|
|
||||||
$var = fopen(__FILE__, 'r');
|
$var = fopen(__FILE__, 'r');
|
||||||
fclose($var);
|
fclose($var);
|
||||||
|
|
||||||
@ -325,11 +320,10 @@ EOTXT
|
|||||||
$dumper->dump($data, $out);
|
$dumper->dump($data, $out);
|
||||||
$out = stream_get_contents($out, -1, 0);
|
$out = stream_get_contents($out, -1, 0);
|
||||||
|
|
||||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
|
||||||
$this->assertStringMatchesFormat(
|
$this->assertStringMatchesFormat(
|
||||||
<<<EOTXT
|
<<<EOTXT
|
||||||
stream resource {@{$ref}
|
stream resource {@{$ref}
|
||||||
⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r}
|
⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {#%d
|
||||||
#message: "Unexpected Exception thrown from a caster: Foobar"
|
#message: "Unexpected Exception thrown from a caster: Foobar"
|
||||||
trace: {
|
trace: {
|
||||||
%sTwig.php:2: {
|
%sTwig.php:2: {
|
||||||
@ -384,10 +378,9 @@ EOTXT
|
|||||||
$data = $cloner->cloneVar($var);
|
$data = $cloner->cloneVar($var);
|
||||||
$out = $dumper->dump($data, true);
|
$out = $dumper->dump($data, true);
|
||||||
|
|
||||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
|
||||||
$this->assertStringMatchesFormat(
|
$this->assertStringMatchesFormat(
|
||||||
<<<EOTXT
|
<<<EOTXT
|
||||||
{{$r}
|
{#%d
|
||||||
+"foo": &1 "foo"
|
+"foo": &1 "foo"
|
||||||
+"bar": &1 "foo"
|
+"bar": &1 "foo"
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,6 @@ class HtmlDumperTest extends TestCase
|
|||||||
$dumpId = $dumpId[0];
|
$dumpId = $dumpId[0];
|
||||||
$res = (int) $var['res'];
|
$res = (int) $var['res'];
|
||||||
|
|
||||||
$r = defined('HHVM_VERSION') ? '' : '<a class=sf-dump-ref>#%d</a>';
|
|
||||||
$this->assertStringMatchesFormat(
|
$this->assertStringMatchesFormat(
|
||||||
<<<EOTXT
|
<<<EOTXT
|
||||||
<foo></foo><bar><span class=sf-dump-note>array:24</span> [<samp>
|
<foo></foo><bar><span class=sf-dump-note>array:24</span> [<samp>
|
||||||
@ -75,10 +74,10 @@ class HtmlDumperTest extends TestCase
|
|||||||
+<span class=sf-dump-public title="Public property">foo</span>: "<span class=sf-dump-str title="3 characters">foo</span>"
|
+<span class=sf-dump-public title="Public property">foo</span>: "<span class=sf-dump-str title="3 characters">foo</span>"
|
||||||
+"<span class=sf-dump-public title="Runtime added dynamic property">bar</span>": "<span class=sf-dump-str title="3 characters">bar</span>"
|
+"<span class=sf-dump-public title="Runtime added dynamic property">bar</span>": "<span class=sf-dump-str title="3 characters">bar</span>"
|
||||||
</samp>}
|
</samp>}
|
||||||
"<span class=sf-dump-key>closure</span>" => <span class=sf-dump-note>Closure</span> {{$r}<samp>
|
"<span class=sf-dump-key>closure</span>" => <span class=sf-dump-note>Closure</span> {<a class=sf-dump-ref>#%d</a><samp>
|
||||||
<span class=sf-dump-meta>class</span>: "<span class=sf-dump-str title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest
|
<span class=sf-dump-meta>class</span>: "<span class=sf-dump-str title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest
|
||||||
55 characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-class">Symfony\Component\VarDumper\Tests\Dumper</span><span class=sf-dump-ellipsis>\</span>HtmlDumperTest</span>"
|
55 characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-class">Symfony\Component\VarDumper\Tests\Dumper</span><span class=sf-dump-ellipsis>\</span>HtmlDumperTest</span>"
|
||||||
<span class=sf-dump-meta>this</span>: <abbr title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest" class=sf-dump-note>HtmlDumperTest</abbr> {{$r} &%s;}
|
<span class=sf-dump-meta>this</span>: <abbr title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest" class=sf-dump-note>HtmlDumperTest</abbr> {<a class=sf-dump-ref>#%d</a> &%s;}
|
||||||
<span class=sf-dump-meta>parameters</span>: {<samp>
|
<span class=sf-dump-meta>parameters</span>: {<samp>
|
||||||
<span class=sf-dump-meta>\$a</span>: {}
|
<span class=sf-dump-meta>\$a</span>: {}
|
||||||
<span class=sf-dump-meta>&\$b</span>: {<samp>
|
<span class=sf-dump-meta>&\$b</span>: {<samp>
|
||||||
|
Reference in New Issue
Block a user