Skip to content

Commit

Permalink
Merge branch 'improve/php7' into php7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nobuhiko committed Jul 26, 2018
2 parents 1a264d6 + 3bda4df commit 7a59be7
Show file tree
Hide file tree
Showing 719 changed files with 704 additions and 42,045 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# for php-coveralls
# see also. https://coveralls.io
src_dir: data
coverage_clover: reports/coverage/coverage.xml
json_path: reports/coverage/coveralls-upload.json
47 changes: 32 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,50 @@
# for travis-ci
# see also. https://travis-ci.org
language: php
sudo: required
sudo: false
php:
#- 5.3.3
#- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2

matrix:
fast_finish: true

env:
global:
- DBNAME=myapp_test HTTP_URL=http://localhost:8085/ HTTPS_URL=https://localhost:8085/
matrix:
- DB=mysql USER=root DBPASS=' ' DBUSER=root
- DB=pgsql USER=postgres DBPASS=password DBUSER=postgres
- DB=mysql USER=root DBPASS=' ' DBUSER=root
- DB=pgsql USER=postgres DBPASS=password DBUSER=postgres
- DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true # Use for coverage report

matrix:
fast_finish: true
exclude:
- php: 5.4
env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true
- php: 5.5
env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true
- php: 5.6
env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true
- php: 7.0
env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true
- php: 7.2
env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true
allow_failures:
# Use for coverage report
- php: 7.1
env: DB=pgsql USER=postgres DBPASS=password DBUSER=postgres COVERAGE=true

before_script:
## see https://github.com/symfony/symfony/blob/e0bdc0c35e9afdb3bee8af172f90e9648c4012fc/.travis.yml#L92-L97
- phpenv config-rm xdebug.ini || true
- echo "opcache.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer self-update || true
- if [[ $TRAVIS_PHP_VERSION == '5.3.3' ]]; then composer install --dev --no-interaction --prefer-source ; fi
- if [[ $TRAVIS_PHP_VERSION != '5.3.3' ]]; then composer install --dev --no-interaction ; fi
- composer install --dev --no-interaction -o --apcu-autoloader
- sh -c "if [ '$DB' = 'mysql' ]; then sh ./eccube_install.sh mysql; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then sh ./eccube_install.sh appveyor; fi"
- cp tests/require.php.jenkins tests/require.php
- cat ./data/config/config.php
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand All @@ -37,12 +53,13 @@ before_script:

script:
- mkdir -p reports/coverage
- php data/vendor/bin/phpunit -c phpunit.xml.dist
- php data/vendor/bin/codecept run --env travis --steps
- if [ ! $COVERAGE ] ; then php data/vendor/bin/phpunit -c phpunit.xml.dist ; fi
- if [ $COVERAGE ] ; then phpdbg -qrr data/vendor/bin/phpunit -c phpunit.xml.dist ; fi
- if [ ! $COVERAGE ] ; then php data/vendor/bin/codecept run --env travis --steps ; fi

after_script:
- php data/vendor/bin/coveralls -v
- cat ./data/logs/error.log
- if [ $COVERAGE ] ; then php data/vendor/bin/coveralls -v ; fi
- tail -n 100 ./data/logs/error.log

# Cache folder, you can delete cache from Travis CI web interface
cache:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# EC-CUBE 2.13系 / 2.17系(開発中)
[![Build Status](https://travis-ci.org/EC-CUBE/eccube-2_13.svg)](https://travis-ci.org/EC-CUBE/eccube-2_13)
[![Build status](https://ci.appveyor.com/api/projects/status/4k58ucq2smwc4h7n/branch/master?svg=true)](https://ci.appveyor.com/project/ECCUBE/eccube-2-13/branch/master)
[![Coverage Status](https://coveralls.io/repos/EC-CUBE/eccube-2_13/badge.png)](https://coveralls.io/r/EC-CUBE/eccube-2_13)

---
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ install:
#- set PATH=%PATH%;C:\MinGW\msys\1.0\bin;C:\MinGW\bin
#- mingw-get install mingw-developer-toolkit
## Set PHP.
- cinst php -version 5.6.17
- cinst php -version 5.6.17 --allow-empty-checksums
- SET PATH=C:\tools\php\;%PATH%
- copy C:\tools\php\php.ini-production C:\tools\php\php.ini
- echo date.timezone="Asia/Tokyo" >> C:\tools\php\php.ini
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"pear-pear.php.net/XML_Parser" : "*",
"pear-pear.php.net/XML_Serializer" : "*",
"pear-pear.php.net/XML_Util" : "*",
"mobiledetect/mobiledetectlib": "^2.8"
"mobiledetect/mobiledetectlib": "^2.8",
"setasign/fpdf": "1.7",
"setasign/fpdi-fpdf": "1.6"
},
"autoload": {
"classmap": [
Expand Down
134 changes: 133 additions & 1 deletion composer.lock

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

2 changes: 2 additions & 0 deletions data/Smarty/templates/admin/contents/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@
<td><a href="#" onclick="eccube.fnFormModeSubmit('move','delete','news_id','<!--{$arrNews[data].news_id|h}-->'); return false;">削除</a></td>
<td>
<!--{if count($arrNews) != 1}-->
<!--{assign var=news_id value="`$arrNews[data].news_id`"}-->
<!--{if $arrErr[$news_id] != ""}--><span class="attention"><!--{$arrErr[$news_id]}--></span><!--{/if}-->
<input type="text" name="pos-<!--{$arrNews[data].news_id|h}-->" size="3" class="box3" />番目へ<a href="?" onclick="eccube.fnFormModeSubmit('move', 'moveRankSet','news_id', '<!--{$arrNews[data].news_id|h}-->'); return false;">移動</a><br />
<!--{/if}-->
<!--{if $smarty.section.data.iteration != 1}-->
Expand Down
2 changes: 1 addition & 1 deletion data/Smarty/templates/admin/products/product_class.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
<!--{/foreach}-->
</td>
<td class="center">
<!--{assign var=key value="down_filename}-->
<!--{assign var=key value="down_filename"}-->
<!--{if $arrErr[$key][$index]}-->
<span class="attention"><!--{$arrErr[$key][$index]}--></span>
<!--{/if}-->
Expand Down
4 changes: 2 additions & 2 deletions data/Smarty/templates/default/cart/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<!--{/if}-->
<!--{/if}-->

<p class="totalmoney_area">
<div class="totalmoney_area">
<!--{* カゴの中に商品がある場合にのみ表示 *}-->
<!--{if count($cartKeys) > 1}-->
<span class="attentionSt"><!--{foreach from=$cartKeys item=key name=cartKey}--><!--{$arrProductType[$key]|h}--><!--{if !$smarty.foreach.cartKey.last}--><!--{/if}--><!--{/foreach}-->は同時購入できません。<br />
Expand All @@ -53,7 +53,7 @@
<!--{if strlen($tpl_message) != 0}-->
<p class="attention"><!--{$tpl_message|h|nl2br}--></p>
<!--{/if}-->
</p>
</div>

<!--{if count($cartItems) > 0}-->
<!--{foreach from=$cartKeys item=key}-->
Expand Down
3 changes: 1 addition & 2 deletions data/Smarty/templates/sphone/products/detail.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<!--{* 画像の縦横倍率を算出 *}-->
<!--{assign var=detail_image_size value=200}-->
<!--{assign var=main_image_factor value="`$arrFile[$key].width/$detail_image_size"`}-->
<!--{assign var=main_image_factor value=$arrFile[$key].width/$detail_image_size}-->
<!--{if $arrProduct.main_large_image|strlen >= 1}-->
<a rel="external" class="expansion" href="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct.main_large_image|h}-->" target="_blank">
<img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrProduct.main_image|h}-->" alt="<!--{$arrProduct.name|h}-->" width="<!--{$arrFile.main_image.width/$main_image_factor}-->" height="<!--{$arrFile.main_image.height/$main_image_factor}-->" /></a>
Expand Down Expand Up @@ -421,4 +421,3 @@
</section>
<!--{include file= 'frontparts/search_area.tpl'}-->
6 changes: 6 additions & 0 deletions data/app_initial.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

// Flexible SSLへの対応
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ){
$_SERVER['HTTPS'] = 1;
$_SERVER['SERVER_PORT'] = 443;
}

if (!defined('CLASS_REALDIR')) {
/** クラスパス */
define('CLASS_REALDIR', DATA_REALDIR . "class/");
Expand Down
5 changes: 1 addition & 4 deletions data/class/SC_CartSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ public function getAllProductsPoint($productTypeId)
}
$point_rate = $this->cartSession[$productTypeId][$i]['point_rate'];

if (!isset($this->cartSession[$productTypeId][$i]['id'][0])) {
$this->cartSession[$productTypeId][$i]['id'][0] = '';
}
$point = SC_Utils_Ex::sfPrePoint($price, $point_rate);
$total+= ($point * $quantity);
}
Expand Down Expand Up @@ -300,7 +297,7 @@ public function getPrevURL()
public function delProductKey($keyname, $val, $productTypeId)
{
$max = $this->getMax($productTypeId);
for ($i = 0; $i < $max; $i++) {
for ($i = 0; $i <= $max; $i++) {
if ($this->cartSession[$productTypeId][$i][$keyname] == $val) {
unset($this->cartSession[$productTypeId][$i]);
}
Expand Down
14 changes: 14 additions & 0 deletions data/class/SC_CheckError.php
Original file line number Diff line number Diff line change
Expand Up @@ -1762,4 +1762,18 @@ public function numelicCheck($string)

return strlen($string) > 0 && !ctype_digit($string);
}

// 都道府県マスタに存在する値かチェック
public function PREF_CHECK($value)
{
$disp = $value[0];
$key = $value[1];

$pref_id = $this->arrParam[$key];
$objQuery = SC_Query_Ex::getSingletonInstance();
$exists = $objQuery->exists('mtb_pref', 'id = ?', array($pref_id));
if (!$exists) {
$this->arrErr[$key] = '' . $disp . 'が不正な値です。<br />';
}
}
}
Loading

0 comments on commit 7a59be7

Please sign in to comment.