Skip to content

Commit

Permalink
Merge pull request EC-CUBE#615 from nanasess/use-smarty42
Browse files Browse the repository at this point in the history
Smarty4.3 を使用する
  • Loading branch information
dotani1111 authored Mar 13, 2024
2 parents 9fb10ef + 0846c96 commit 302f86f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 33 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ jobs:
docker tag ec-cube2 ghcr.io/ec-cube/ec-cube2-php:${PHP_VERSION_TAG}-apache
TAG=${PHP_VERSION_TAG}-apache docker-compose up -d
- run: docker-compose exec -T ec-cube composer require smarty/smarty "^3.1"
if: matrix.php < 7.1

- run: sleep 1
- run: |
yarn install
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ jobs:
- name: composer install
run: composer install --no-interaction -o

- run: composer require smarty/smarty "^3.1"
if: matrix.php < 7.1

- name: Setup PHP
uses: nanasess/setup-php@master
with:
Expand Down Expand Up @@ -178,6 +181,10 @@ jobs:
- name: composer install
run: composer install --no-interaction -o

- run: composer require smarty/smarty "^3.1"
if: matrix.php < 7.1
shell: bash

- name: Start PostgreSQL on Windows
# see https://www.cybertec-postgresql.com/en/postgresql-github-actions-continuous-integration/
run: |
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"config": {
"vendor-dir": "data/vendor",
"platform": {
"php": "5.4.16"
"php": "7.4.0"
},
"optimize-autoloader": true,
"sort-packages": true,
Expand All @@ -22,13 +22,16 @@
}
},
"require-dev": {
"doctrine/instantiator": "~1.0.5",
"fzaninotto/faker": "^1.8",
"nanasess/eccube2-fixture-generator": "^1.1",
"nanasess/ec-cube2-class-extends-stubs": "^1.0",
"php5friends/phpunit48": ">=4.8.41"
"nanasess/eccube2-fixture-generator": "^1.1",
"php5friends/phpunit48": ">=4.8.41",
"phpdocumentor/reflection-docblock": "~2.0.5",
"symfony/yaml": "^2.8 || ^3.4 || ^4.4"
},
"require": {
"php": ">=5.4.16",
"php": "^5.4 || ^7.0 || ^8.0",
"ext-gd": "*",
"ext-mbstring": "*",
"mobiledetect/mobiledetectlib": "^2.8",
Expand All @@ -42,7 +45,7 @@
"pear/xml_util": "*",
"setasign/fpdf": "^1.8",
"setasign/fpdi": "^1.6",
"smarty/smarty": "*"
"smarty/smarty": "^3.1 || ^4.3"
},
"autoload": {
"classmap": [
Expand Down
54 changes: 30 additions & 24 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions data/class/SC_View.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class SC_View
{
/** @var SmartyBC */
/** @var Smarty */
public $_smarty;

/** @var LC_Page */
Expand All @@ -41,9 +41,7 @@ public function __construct()
public function init()
{
// include_phpの利用のためSmartyBCを呼び出す、ホントはinclude_phpをなくしたいそうすれば、blank.tplもなくせる
$this->_smarty = new SmartyBC;
// see https://github.com/smarty-php/smarty/issues/605#issuecomment-742832333
$this->_smarty->setErrorReporting(E_ALL & ~E_WARNING & ~E_NOTICE);
$this->_smarty = new Smarty;
$this->_smarty->left_delimiter = '<!--{';
$this->_smarty->right_delimiter = '}-->';
$this->_smarty->registerPlugin('modifier', 'sfDispDBDate', function ($dbdate, $time = true) { return SC_Utils_Ex::sfDispDBDate($dbdate, $time); });
Expand Down

0 comments on commit 302f86f

Please sign in to comment.