Compare commits

...

11 Commits

Author SHA1 Message Date
Simon Wisselink 950bf16e21 Disabled nightly testing because phpunit doesn't support php8 yet. 2020-05-05 14:52:20 +02:00
Simon Wisselink b4e55cccfc Specify dist for 5.3 2020-05-05 12:38:20 +02:00
Simon Wisselink 4de40774fe Test travis config for PHP5 versions 2020-05-05 09:56:44 +02:00
Simon Wisselink 1418c8c422 Merge branch 'AnrDaemon-fix-php5.3-compat' 2020-05-05 09:21:07 +02:00
Simon Wisselink f46c13b32a Updated changelog 2020-05-05 09:20:56 +02:00
AnrDaemon eae19f23b9 PHP 5.3 compatibility fixes 2020-05-05 01:37:36 +03:00
Sławomir Kaleta e1c050a32c Fix comment - Method can return string (#583) 2020-04-14 17:26:20 +02:00
Simon Wisselink fd148f7ade Merge branch 'release/3.1.36' 2020-04-14 16:44:26 +02:00
Simon Wisselink 07772aac90 version bump 2020-04-14 16:44:24 +02:00
Simon Wisselink 08227651fc Fixed #584 2020-04-14 16:44:09 +02:00
Simon Wisselink e0ea6899c8 fixed version of Smarty::SMARTY_VERSION and updates make-release script to do so automatically from now on 2020-04-14 16:40:44 +02:00
8 changed files with 39 additions and 23 deletions
+6 -2
View File
@@ -1,4 +1,3 @@
language: php
sudo: false
@@ -7,12 +6,17 @@ dist: trusty
matrix:
include:
- php: 5.3 # Composer requires PHP 5.3.2+ to run, so we cannot test below 5.3
dist: precise # PHP 5.3 is supported only on Precise.
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: nightly
# - php: nightly # PHP nightly build testing disabled because PHPUnit doesn't support PHP8 yet.
fast_finish: true
allow_failures:
- php: nightly
+11
View File
@@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- Travis unit tests now run for all php versions >= 5.3
### Fixed
- PHP5.3 compatability fixes
## [3.1.36] - 2020-04-14
### Fixed
- Smarty::SMARTY_VERSION wasn't updated in v3.1.35 https://github.com/smarty-php/smarty/issues/584
## [3.1.35] - 2020-04-14
- remove whitespaces after comments https://github.com/smarty-php/smarty/issues/447
- fix foreachelse on arrayiterators https://github.com/smarty-php/smarty/issues/506
+1 -1
View File
@@ -40,7 +40,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "6.4.1",
"phpunit/phpunit": "6.4.1 || ^5.7 || ^4.8",
"smarty/smarty-lexer": "^3.1"
}
}
+2 -2
View File
@@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.34-dev-7';
const SMARTY_VERSION = '3.1.36';
/**
* define variable scopes
*/
@@ -800,7 +800,7 @@ class Smarty extends Smarty_Internal_TemplateBase
* @param mixed $index index of directory to get, null to get all
* @param bool $isConfig true for config_dir
*
* @return array list of template directories, or directory of $index
* @return array|string list of template directories, or directory of $index
*/
public function getTemplateDir($index = null, $isConfig = false)
{
@@ -127,12 +127,12 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
}
private function getChunkedSubtrees() {
$chunks = [];
$chunks = array();
$currentMode = null;
$currentChunk = [];
$currentChunk = array();
for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) {
if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, ['textstripped', 'text', 'tag'])) {
if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, array('textstripped', 'text', 'tag'))) {
continue;
}
@@ -150,19 +150,19 @@ class Smarty_Internal_ParseTree_Template extends Smarty_Internal_ParseTree
if ($newMode == $currentMode) {
$currentChunk[] = $this->subtrees[ $key ];
} else {
$chunks[] = [
$chunks[] = array(
'mode' => $currentMode,
'subtrees' => $currentChunk
];
);
$currentMode = $newMode;
$currentChunk = [$this->subtrees[ $key ]];
$currentChunk = array($this->subtrees[ $key ]);
}
}
if ($currentMode && $currentChunk) {
$chunks[] = [
$chunks[] = array(
'mode' => $currentMode,
'subtrees' => $currentChunk
];
);
}
return $chunks;
}
+2 -1
View File
@@ -4,8 +4,9 @@ printf 'Creating release %s\n' "$1"
git checkout -b "release/$1"
sed -i "s/## \\[Unreleased\\]/## \\[Unreleased\\]\\n\\n## \\[$1\\] - $(date +%Y-%m-%d)/" CHANGELOG.md
sed -i "s/const SMARTY_VERSION = '[^']\+';/const SMARTY_VERSION = '$1';/" libs/Smarty.class.php
git add CHANGELOG.md
git add CHANGELOG.md libs/Smarty.class.php
git commit -m "version bump"
git checkout master
@@ -95,7 +95,7 @@ class CompileForeachTest extends PHPUnit_Smarty
array('{foreach $foo x y foo}{$y}.{$x},{foreachelse}else{/foreach}total{$smarty.foreach.foo.total}', array(9,10,11), '0.9,1.10,2.11,total3', '', $i ++),
array('{$x = "hallo"}{$bar=[1,2,3]}{foreach $foo as $x}outer={$x@index}.{$x}#{foreach $bar as $x}inner={$x@index}.{$x}{/foreach}##{/foreach}###{$x}', array(9,10,11), 'outer=0.9#inner=0.1inner=1.2inner=2.3##outer=1.10#inner=0.1inner=1.2inner=2.3##outer=2.11#inner=0.1inner=1.2inner=2.3#####hallo', '', $i ++),
array('{foreach $foo as $x}{$x}{foreachelse}else{/foreach}', null, 'else', '', $i ++),
array('{foreach $foo as $x}{$x}{foreachelse}else{/foreach}', [], 'else', '', $i ++),
array('{foreach $foo as $x}{$x}{foreachelse}else{/foreach}', array(), 'else', '', $i ++),
array('{foreach $foo as $x}{$x}{foreachelse}else{/foreach}', new \ArrayIterator(), 'else', '', $i ++),
);
}
@@ -57,7 +57,7 @@ class PhpFunctionTest extends PHPUnit_Smarty
public function testEmpty2()
{
if (version_compare(phpversion(), '5.5', '<')) {
$this->markTestSkipped('runs only on PHP > 5.5');
$this->markTestSkipped('runs only on PHP >= 5.5');
}
$this->smarty->disableSecurity();
@@ -82,7 +82,7 @@ class PhpFunctionTest extends PHPUnit_Smarty
public function testEmpty3()
{
if (version_compare(phpversion(), '5.5', '<')) {
$this->markTestSkipped('runs only on PHP > 5.5');
$this->markTestSkipped('runs only on PHP >= 5.5');
}
$this->smarty->disableSecurity();
$this->smarty->assign('var', array(true,
@@ -104,7 +104,7 @@ class PhpFunctionTest extends PHPUnit_Smarty
public function testEmpty4()
{
if (version_compare(phpversion(), '5.5', '<')) {
$this->markTestSkipped('runs only on PHP > 5.5');
$this->markTestSkipped('runs only on PHP >= 5.5');
}
$this->smarty->disableSecurity();
@@ -168,11 +168,11 @@ class PhpFunctionTest extends PHPUnit_Smarty
$this->smarty->disableSecurity();
$this->smarty->assign('varobject', new TestIsset());
$this->smarty->assign('vararray', $vararray = [
$this->smarty->assign('vararray', $vararray = array(
'keythatexists' => false,
'keywitharray' => [1 => 1],
'keywithobject' => new TestIsset()]
);
'keywitharray' => array(1 => 1),
'keywithobject' => new TestIsset()
));
$this->smarty->assign('key', 'A');
$this->smarty->assign('_varsimpleA', 1);
@@ -234,4 +234,4 @@ class TestIsset {
public function pass($v) {
return $v;
}
}
}