Skip to content

Commit

Permalink
Merge branch 'master' into add-symfony-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed May 18, 2020
2 parents 1fa297c + 4a38333 commit 04f6999
Show file tree
Hide file tree
Showing 120 changed files with 277 additions and 230 deletions.
64 changes: 44 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI/CD for EC-CUBE
on:
push:
branches:
- master
- '*'
tags:
- '*'
paths:
Expand All @@ -29,14 +29,23 @@ jobs:
- db: mysql
dbport: '3306'
dbuser: 'root'
dbpass: 'root'
dbpass: 'password'
dbname: 'eccube_db'
- db: pgsql
dbport: '5432'
dbuser: 'postgres'
dbpass: 'password'
dbname: 'eccube_db'
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:11
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
Expand All @@ -52,7 +61,7 @@ jobs:
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -79,7 +88,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
HTTP_URL: http://localhost:8085/
HTTPS_URL: http://localhost:8085/
Expand All @@ -90,14 +99,15 @@ jobs:
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '77.0.3865.40'
chromedriver-version: '2.43'

- name: Run to PHPUnit
run: |
data/vendor/bin/phpunit --exclude-group classloader
data/vendor/bin/phpunit --group classloader
sed 's|http://|https://|g' -i.bak data/config/config.php
data/vendor/bin/phpunit tests/class/SC_SessionFactoryTest.php
mv data/config/config.php.bak data/config/config.php
- name: Run chromedriver
run: |
Expand All @@ -112,7 +122,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
HTTP_URL: http://localhost:8085/
Expand All @@ -121,6 +131,10 @@ jobs:
php data/vendor/bin/codecept build
php -S 0.0.0.0:8085 -t html/ &
php data/vendor/bin/codecept run --env chrome --skip-group installer --steps
- name: Failure log
if: failure()
run: tail -n 300 data/logs/*

run-on-windows:
name: Run on Windows
runs-on: ${{ matrix.operating-system }}
Expand All @@ -131,7 +145,7 @@ jobs:
php: [ 5.5, 5.6, 7.1, 7.2, 7.3, 7.4 ]
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Composer install
uses: nanasess/composer-installer-action@master
Expand Down Expand Up @@ -165,17 +179,18 @@ jobs:
- name: Setup to database
run: |
choco install -y mysql --version 5.7.18
mysql --user=root -e "CREATE DATABASE `myapp_test`;"
mysql --user=root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';FLUSH PRIVILEGES;"
mysql --user=root -e "CREATE DATABASE eccube_db DEFAULT COLLATE=utf8_general_ci;"
mysql --user=root -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;FLUSH PRIVILEGES;"
- name: Setup to EC-CUBE
env:
DB: mysql
USER: root
DBUSER: root
DBPASS: password
DBNAME: myapp_test
DBNAME: eccube_db
DBPORT: 3306
DBSERVER: 127.0.0.1
HTTP_URL: http://localhost:8085/
HTTPS_URL: http://localhost:8085/
run: bash eccube_install.sh mysql
Expand All @@ -195,20 +210,29 @@ jobs:
fail-fast: false
matrix:
operating-system: [ ubuntu-18.04 ]
php: [ 5.4, 5.5, 5.6, 7.1, 7.2, 7.3 ]
php: [ 5.4, 5.5, 5.6, 7.1, 7.2, 7.3, 7.4 ]
db: [ mysql, pgsql ]
include:
- db: mysql
dbport: '3306'
dbuser: 'root'
dbpass: 'root'
dbpass: 'password'
dbname: 'eccube_db'
- db: pgsql
dbport: '5432'
dbuser: 'postgres'
dbpass: 'password'
dbname: 'eccube_db'
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:11
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
Expand All @@ -224,7 +248,7 @@ jobs:
- 1025:1025
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
id: composer-cache
Expand All @@ -248,7 +272,7 @@ jobs:
- name: setup-chromedriver
uses: nanasess/setup-chromedriver@master
with:
chromedriver-version: '77.0.3865.40'
chromedriver-version: '2.43'

- name: Run chromedriver
run: |
Expand All @@ -264,7 +288,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
run: mysql --user=${DBUSER} --password=${DBPASS} -h ${DBSERVER} -P ${DBPORT} -e "CREATE DATABASE ${DBNAME} DEFAULT COLLATE=utf8_general_ci;"
Expand All @@ -276,7 +300,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
run: |
Expand All @@ -290,7 +314,7 @@ jobs:
USER: ${{ matrix.dbuser }}
DBUSER: ${{ matrix.dbuser }}
DBPASS: ${{ matrix.dbpass }}
DBNAME: myapp_test
DBNAME: ${{ matrix.dbname }}
DBPORT: ${{ matrix.dbport }}
DBSERVER: 127.0.0.1
HTTP_URL: http://localhost:8085/
Expand All @@ -307,7 +331,7 @@ jobs:
steps:
- name: Checkout
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
uses: actions/checkout@master
uses: actions/checkout@v2

- name: Get Composer Cache Directory
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased' )
Expand Down
6 changes: 6 additions & 0 deletions ctests/acceptance/InstallerCept.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$I->fillField('input[name=admin_dir]', $admindirectory);

$I->click('>> オプション設定');
$I->wait(1);
$I->selectOption('input[name=mail_backend]', 'smtp');
$I->fillField('input[name=smtp_host]', '127.0.0.1');
$I->fillField('input[name=smtp_port]', '1025');
Expand All @@ -44,6 +45,7 @@
defined('DB_PASSWORD') or define('DB_PASSWORD', getenv('DBPASS') );
defined('DB_PORT') or define('DB_PORT', getenv('DBPORT'));
defined('DB_SERVER') or define('DB_SERVER', getenv('DBSERVER'));
$I->wait(1);

$I->selectOption('select[name=db_type]', DB_TYPE);
$I->fillField('input[name=db_server]', DB_SERVER);
Expand All @@ -52,6 +54,7 @@
$I->fillField('input[name=db_user]', DB_USER);
$I->fillField('input[name=db_password]', DB_PASSWORD);
$I->click('次へ進む');
$I->wait(1);

$I->expect('STEP3');
$I->see('データベースの初期化');
Expand All @@ -63,14 +66,17 @@
$I->waitForText('○:シーケンスの作成に成功しました。', 60);
$I->click('次へ進む');

$I->wait(1);
$I->expect('STEP4');
$I->see('サイト情報について');
$I->click('次へ進む');

$I->wait(1);
$I->see('インストールが完了しました。');
$I->seeInDatabase('dtb_member', ['login_id' => $user]);
$I->click('管理画面へログインする');

$I->wait(1);
$I->seeInCurrentUrl('/'.$admindirectory);
$I->fillField('input[name=login_id]', $user);
$I->fillField('input[name=password]', $password);
Expand Down
3 changes: 3 additions & 0 deletions data/Smarty/templates/default/mypage/history.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<td class="alignC">
<!--{if $orderDetail.product_type_id == $smarty.const.PRODUCT_TYPE_DOWNLOAD}-->
<!--{if $orderDetail.is_downloadable}-->
<!--{assign var="downloadable" value="1"}-->
<a target="_self" href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/download.php?order_id=<!--{$tpl_arrOrderData.order_id}-->&product_class_id=<!--{$orderDetail.product_class_id}-->">ダウンロード</a>
<!--{else}-->
<!--{if $orderDetail.payment_date == "" && $orderDetail.effective == "0"}-->
Expand Down Expand Up @@ -153,6 +154,7 @@
<!--{/if}-->
<!-- 使用ポイントここまで -->

<!--{if $downloadable != 1}-->
<!--{foreach item=shippingItem name=shippingItem from=$arrShipping}-->
<h3>お届け先<!--{if $isMultiple}--><!--{$smarty.foreach.shippingItem.iteration}--><!--{/if}--></h3>
<!--{if $isMultiple}-->
Expand Down Expand Up @@ -249,6 +251,7 @@
</tbody>
</table>
<!--{/foreach}-->
<!--{/if}-->

<br />

Expand Down
7 changes: 6 additions & 1 deletion 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.
*/

// スクリプトが HTTPS プロトコルを通じて実行されている場合に 空でない値が設定される.
// Webサーバーによっては 'On' が設定されるため正規化する
// see https://www.php.net/manual/ja/reserved.variables.server.php
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') { // ISAPI/IIS の場合は off になる
$_SERVER['HTTPS'] = 'on';
}
// Flexible SSLへの対応
if( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ){
$_SERVER['HTTPS'] = 'on';
Expand Down Expand Up @@ -54,4 +60,3 @@
// アプリケーション初期化処理
$objInit = new SC_Initial_Ex();
$objInit->init();

2 changes: 1 addition & 1 deletion data/class/SC_FormParam.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function setHtmlDispNameArray()
} else {
$this->html_disp_name[$index] = $this->disp_name[$index];
}
if ($this->arrDefault[$key] != '') {
if (strlen($this->arrDefault[$key]) >= 1) {
$this->html_disp_name[$index] .= ' [省略時初期値: ' . $this->arrDefault[$key] . ']';
}
if ($this->input_db[$index] == false) {
Expand Down
22 changes: 15 additions & 7 deletions data/class/SC_UploadFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,21 +330,29 @@ public function setHiddenKikakuFileList($arrPOST)
}

// フォームに渡す用のファイル情報配列を返す
public function getFormFileList($temp_url, $save_url, $real_size = false)
public function getFormFileList($temp_url = null, $save_url = null, $real_size = false)
{
$arrRet = array();
$cnt = 0;
foreach ($this->keyname as $val) {
if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') {
// パスのスラッシュ/が連続しないようにする。
$arrRet[$val]['filepath'] = rtrim($temp_url, '/') . '/' . $this->temp_file[$cnt];

$real_filepath =
$arrRet[$val]['real_filepath'] = $this->temp_dir . $this->temp_file[$cnt];
if (is_null($temp_url)) {
$arrRet[$val]['filepath'] = ROOT_URLPATH . substr($real_filepath, strlen(HTML_REALDIR));
} else {
// パスのスラッシュ/が連続しないようにする。
$arrRet[$val]['filepath'] = rtrim($temp_url, '/') . '/' . $this->temp_file[$cnt];
}
} elseif (isset($this->save_file[$cnt]) && $this->save_file[$cnt] != '') {
// パスのスラッシュ/が連続しないようにする。
$arrRet[$val]['filepath'] = rtrim($save_url, '/') . '/' . $this->save_file[$cnt];

$real_filepath =
$arrRet[$val]['real_filepath'] = $this->save_dir . $this->save_file[$cnt];
if (is_null($save_url)) {
$arrRet[$val]['filepath'] = ROOT_URLPATH . substr($real_filepath, strlen(HTML_REALDIR));
} else {
// パスのスラッシュ/が連続しないようにする。
$arrRet[$val]['filepath'] = rtrim($save_url, '/') . '/' . $this->save_file[$cnt];
}
}
if (isset($arrRet[$val]['filepath']) && !empty($arrRet[$val]['filepath'])) {
if ($real_size) {
Expand Down
2 changes: 1 addition & 1 deletion data/class/db/SC_DB_DBFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @package DB
* @author EC-CUBE CO.,LTD.
* @version $Id:SC_DB_DBFactory.php 15532 2007-08-31 14:39:46Z nanasess $
* @version $Id$
*/
class SC_DB_DBFactory
{
Expand Down
2 changes: 1 addition & 1 deletion data/class/db/SC_DB_MasterData.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
*
* @package DB
* @author EC-CUBE CO.,LTD.
* @version $Id:SC_DB_MasterData.php 15532 2007-08-31 14:39:46Z nanasess $
* @version $Id$
*/
class SC_DB_MasterData
{
Expand Down
2 changes: 1 addition & 1 deletion data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @package DB
* @author EC-CUBE CO.,LTD.
* @version $Id:SC_DB_DBFactory_MYSQL.php 15267 2007-08-09 12:31:52Z nanasess $
* @version $Id$
*/
class SC_DB_DBFactory_MYSQL extends SC_DB_DBFactory
{
Expand Down
2 changes: 1 addition & 1 deletion data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*
* @package DB
* @author EC-CUBE CO.,LTD.
* @version $Id:SC_DB_DBFactory_PGSQL.php 15532 2007-08-31 14:39:46Z nanasess $
* @version $Id$
*/
class SC_DB_DBFactory_PGSQL extends SC_DB_DBFactory
{
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @package Helper
* @author pineray
* @version $Id:$
* @version $Id$
*/
class SC_Helper_Address
{
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_BestProducts.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*
* @package Helper
* @author pineray
* @version $Id:$
* @version $Id$
*/
class SC_Helper_BestProducts
{
Expand Down
Loading

0 comments on commit 04f6999

Please sign in to comment.