mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 04:27:00 +00:00
dropped support for HHVM
This commit is contained in:
+1
-4
@@ -15,14 +15,13 @@ php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
- nightly
|
||||
- hhvm
|
||||
|
||||
env:
|
||||
- TWIG_EXT=no
|
||||
- TWIG_EXT=yes
|
||||
|
||||
before_install:
|
||||
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
||||
- phpenv config-rm xdebug.ini
|
||||
|
||||
install:
|
||||
- travis_retry composer install
|
||||
@@ -36,8 +35,6 @@ script: ./vendor/bin/simple-phpunit
|
||||
matrix:
|
||||
fast_finish: true
|
||||
exclude:
|
||||
- php: hhvm
|
||||
env: TWIG_EXT=yes
|
||||
- php: 7.0
|
||||
env: TWIG_EXT=yes
|
||||
- php: 7.1
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
* 1.34.0 (2017-XX-XX)
|
||||
|
||||
* dropped HHVM support
|
||||
* dropped PHP 5.2 support
|
||||
|
||||
* 1.33.2 (2017-04-20)
|
||||
|
||||
@@ -332,11 +332,6 @@ class Twig_Error extends Exception
|
||||
$r = new ReflectionObject($template);
|
||||
$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);
|
||||
while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) {
|
||||
$exceptions[] = $e;
|
||||
|
||||
+17
-26
@@ -1,8 +1,7 @@
|
||||
<?php
|
||||
|
||||
if (!defined('ENT_SUBSTITUTE')) {
|
||||
// use 0 as hhvm does not support several flags yet
|
||||
define('ENT_SUBSTITUTE', 0);
|
||||
define('ENT_SUBSTITUTE', 8);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1006,30 +1005,22 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
||||
// Using a static variable to avoid initializing the array
|
||||
// each time the function is called. Moving the declaration on the
|
||||
// top of the function slow downs other escaping strategies.
|
||||
static $htmlspecialcharsCharsets;
|
||||
|
||||
if (null === $htmlspecialcharsCharsets) {
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$htmlspecialcharsCharsets = array('utf-8' => true, 'UTF-8' => true);
|
||||
} else {
|
||||
$htmlspecialcharsCharsets = array(
|
||||
'ISO-8859-1' => true, 'ISO8859-1' => true,
|
||||
'ISO-8859-15' => true, 'ISO8859-15' => true,
|
||||
'utf-8' => true, 'UTF-8' => true,
|
||||
'CP866' => true, 'IBM866' => true, '866' => true,
|
||||
'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true,
|
||||
'1251' => true,
|
||||
'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true,
|
||||
'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
static $htmlspecialcharsCharsets = array(
|
||||
'ISO-8859-1' => true, 'ISO8859-1' => true,
|
||||
'ISO-8859-15' => true, 'ISO8859-15' => true,
|
||||
'utf-8' => true, 'UTF-8' => true,
|
||||
'CP866' => true, 'IBM866' => true, '866' => true,
|
||||
'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true,
|
||||
'1251' => true,
|
||||
'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true,
|
||||
'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => 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])) {
|
||||
return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
--TEST--
|
||||
"url_encode" filter for PHP < 5.4 and HHVM
|
||||
"url_encode" filter for PHP < 5.4
|
||||
--CONDITION--
|
||||
defined('PHP_QUERY_RFC3986')
|
||||
--TEMPLATE--
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
{{ date(date3) == 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() > date('-1day') ? 'OK' : 'KO' }}
|
||||
--DATA--
|
||||
date_default_timezone_set('UTC');
|
||||
return array(
|
||||
@@ -23,3 +24,4 @@ OK
|
||||
OK
|
||||
OK
|
||||
OK
|
||||
OK
|
||||
|
||||
@@ -16,10 +16,6 @@ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
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(
|
||||
'debug' => true,
|
||||
'cache' => false,
|
||||
|
||||
@@ -63,10 +63,6 @@ class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
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->getArguments('substr_compare', array('abcd', 'bc', 'offset' => 1, 'case_sensitivity' => true));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user