dropped support for HHVM

This commit is contained in:
Fabien Potencier
2017-05-19 08:23:53 +02:00
parent 860f80178b
commit 6ff8d6f4e2
8 changed files with 22 additions and 44 deletions
+1 -4
View File
@@ -15,14 +15,13 @@ php:
- 7.0 - 7.0
- 7.1 - 7.1
- nightly - nightly
- hhvm
env: env:
- TWIG_EXT=no - TWIG_EXT=no
- TWIG_EXT=yes - TWIG_EXT=yes
before_install: before_install:
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi - phpenv config-rm xdebug.ini
install: install:
- travis_retry composer install - travis_retry composer install
@@ -36,8 +35,6 @@ script: ./vendor/bin/simple-phpunit
matrix: matrix:
fast_finish: true fast_finish: true
exclude: exclude:
- php: hhvm
env: TWIG_EXT=yes
- php: 7.0 - php: 7.0
env: TWIG_EXT=yes env: TWIG_EXT=yes
- php: 7.1 - php: 7.1
+1
View File
@@ -1,5 +1,6 @@
* 1.34.0 (2017-XX-XX) * 1.34.0 (2017-XX-XX)
* dropped HHVM support
* dropped PHP 5.2 support * dropped PHP 5.2 support
* 1.33.2 (2017-04-20) * 1.33.2 (2017-04-20)
-5
View File
@@ -332,11 +332,6 @@ class Twig_Error extends Exception
$r = new ReflectionObject($template); $r = new ReflectionObject($template);
$file = $r->getFileName(); $file = $r->getFileName();
// hhvm has a bug where eval'ed files comes out as the current directory
if (is_dir($file)) {
$file = '';
}
$exceptions = array($e = $this); $exceptions = array($e = $this);
while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) { while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) {
$exceptions[] = $e; $exceptions[] = $e;
+17 -26
View File
@@ -1,8 +1,7 @@
<?php <?php
if (!defined('ENT_SUBSTITUTE')) { if (!defined('ENT_SUBSTITUTE')) {
// use 0 as hhvm does not support several flags yet define('ENT_SUBSTITUTE', 8);
define('ENT_SUBSTITUTE', 0);
} }
/* /*
@@ -1006,30 +1005,22 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
// Using a static variable to avoid initializing the array // Using a static variable to avoid initializing the array
// each time the function is called. Moving the declaration on the // each time the function is called. Moving the declaration on the
// top of the function slow downs other escaping strategies. // top of the function slow downs other escaping strategies.
static $htmlspecialcharsCharsets; static $htmlspecialcharsCharsets = array(
'ISO-8859-1' => true, 'ISO8859-1' => true,
if (null === $htmlspecialcharsCharsets) { 'ISO-8859-15' => true, 'ISO8859-15' => true,
if (defined('HHVM_VERSION')) { 'utf-8' => true, 'UTF-8' => true,
$htmlspecialcharsCharsets = array('utf-8' => true, 'UTF-8' => true); 'CP866' => true, 'IBM866' => true, '866' => true,
} else { 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true,
$htmlspecialcharsCharsets = array( '1251' => true,
'ISO-8859-1' => true, 'ISO8859-1' => true, 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true,
'ISO-8859-15' => true, 'ISO8859-15' => true, 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true,
'utf-8' => true, 'UTF-8' => true, 'BIG5' => true, '950' => true,
'CP866' => true, 'IBM866' => true, '866' => true, 'GB2312' => true, '936' => true,
'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, 'BIG5-HKSCS' => true,
'1251' => true, 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true,
'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, 'EUC-JP' => true, 'EUCJP' => true,
'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true,
'BIG5' => true, '950' => true, );
'GB2312' => true, '936' => true,
'BIG5-HKSCS' => true,
'SHIFT_JIS' => true, 'SJIS' => true, '932' => true,
'EUC-JP' => true, 'EUCJP' => true,
'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true,
);
}
}
if (isset($htmlspecialcharsCharsets[$charset])) { if (isset($htmlspecialcharsCharsets[$charset])) {
return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
@@ -1,5 +1,5 @@
--TEST-- --TEST--
"url_encode" filter for PHP < 5.4 and HHVM "url_encode" filter for PHP < 5.4
--CONDITION-- --CONDITION--
defined('PHP_QUERY_RFC3986') defined('PHP_QUERY_RFC3986')
--TEMPLATE-- --TEMPLATE--
@@ -7,6 +7,7 @@
{{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date3) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
{{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }} {{ date(date4) == date('2010-10-04 13:45') ? 'OK' : 'KO' }}
{{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }} {{ date(date5) == date('1964-01-02 03:04') ? 'OK' : 'KO' }}
{{ date() > date('-1day') ? 'OK' : 'KO' }}
--DATA-- --DATA--
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
return array( return array(
@@ -23,3 +24,4 @@ OK
OK OK
OK OK
OK OK
OK
-4
View File
@@ -16,10 +16,6 @@ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase
*/ */
public function testGetProperties() public function testGetProperties()
{ {
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)');
}
$twig = new Twig_Environment(new Twig_Loader_Array(array('index' => '{{ d1.date }}{{ d2.date }}')), array( $twig = new Twig_Environment(new Twig_Loader_Array(array('index' => '{{ d1.date }}{{ d2.date }}')), array(
'debug' => true, 'debug' => true,
'cache' => false, 'cache' => false,
@@ -63,10 +63,6 @@ class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase
*/ */
public function testResolveArgumentsWithMissingValueForOptionalArgument() public function testResolveArgumentsWithMissingValueForOptionalArgument()
{ {
if (defined('HHVM_VERSION')) {
$this->markTestSkipped('Skip under HHVM as the behavior is not the same as plain PHP (which is an edge case anyway)');
}
$node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'substr_compare')); $node = new Twig_Tests_Node_Expression_Call(array(), array('type' => 'function', 'name' => 'substr_compare'));
$node->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true)); $node->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true));
} }