Skip to content

Commit

Permalink
Merge branch 'eccubejp-local/4.0.3' into 4.0-jp
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	app/config/eccube/packages/eccube.yaml
#	html/template/default/assets/css/maps/style.css.map
#	html/template/default/assets/css/style.css
#	html/template/default/assets/scss/component/_7.3.cart.scss
#	html/template/default/assets/scss/project/_11.2.header.scss
#	src/Eccube/Controller/Admin/Order/ShippingController.php
#	src/Eccube/Controller/Admin/Product/CsvImportController.php
#	src/Eccube/Service/OrderPdfService.php
  • Loading branch information
Phong Nguyen authored and Phong Nguyen committed Sep 18, 2019
2 parents 9767946 + 7b267c5 commit c8f0920
Show file tree
Hide file tree
Showing 115 changed files with 3,279 additions and 737 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
.git
var
23 changes: 14 additions & 9 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
以下を参考にコメントを作成してください。
<!-- 以下を参考にコメントを作成してください。 -->

## 概要(Overview・Refs Issue)
+ PullRequestの目的、関連するIssue番号など
<!-- PullRequestの目的、関連するIssue番号など -->

## 方針(Policy)
+ このPullRequestを作るにあたって考慮したものや除外した内容
 - 例)Symfony のXXにならって作成、3系で同様の仕様があったため など
<!-- このPullRequestを作るにあたって考慮したものや除外した内容
 - 例)Symfony のXXにならって作成、3系で同様の仕様があったため など -->

## 実装に関する補足(Appendix)
+ コードだけではわかりづらい点など、実装するにあたってレビューアに追加で伝えておきたいこと
<!-- コードだけではわかりづらい点など、実装するにあたってレビューアに追加で伝えておきたいこと -->

## テスト(Test)
+ テストを行っている範囲など、レビューアが安心できるような情報
<!-- テストを行っている範囲など、レビューアが安心できるような情報 -->

## 相談(Discussion)
+ 相談したいことや意見を求めたいこと
<!-- 相談したいことや意見を求めたいこと -->

## マイナーバージョン互換性保持のための制限事項チェックリスト
+ マイナーバージョンでは、機能・プラグイン・デザインテンプレート互換性を損なう変更は原則取り込みません。
<!-- マイナーバージョンでは、機能・プラグイン・デザインテンプレート互換性を損なう変更は原則取り込みません。 -->

- [ ] 既存機能の仕様変更
- [ ] フックポイントの呼び出しタイミングの変更
Expand All @@ -26,5 +26,10 @@
- [ ] Serviceクラスの公開関数の、引数の削除・データ型の変更
- [ ] 入出力ファイル(CSVなど)のフォーマット変更

## レビュワー確認項目


- [ ] 動作確認
- [ ] コードレビュー
- [ ] E2E/Unit テスト確認(テストの追加・変更が必要かどうか)
- [ ] 互換性が保持されているか
- [ ] セキュリティ上の問題がないか
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ composer.phar
/app/template/*
!/app/template/admin
!/app/template/default
/app/proxy/entity/*
!/app/proxy/entity/.gitkeep
/html/plugin/*
!/html/plugin/.gitkeep
/html/install/temp/*
Expand Down
9 changes: 5 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DirectoryIndex index.php index.html .ht

<FilesMatch "^composer|^COPYING|^\.env|^\.maintenance|^Procfile|^app\.json|^gulpfile\.js|^package\.json|^package-lock\.json|web\.config|\.(ini|lock|dist|git|sh|bak|swp|env|twig|yml|yaml)$">
<FilesMatch "^composer|^COPYING|^\.env|^\.maintenance|^Procfile|^app\.json|^gulpfile\.js|^package\.json|^package-lock\.json|web\.config|^Dockerfile|\.(ini|lock|dist|git|sh|bak|swp|env|twig|yml|yaml|dockerignore)$">
order allow,deny
deny from all
</FilesMatch>
Expand All @@ -19,9 +19,9 @@ DirectoryIndex index.php index.html .ht
Header set X-Content-Type-Options nosniff
</IfModule>

# デフォルトテンプレートの状態で 2M 以上となるため
# デザインテンプレートを適用するため10Mで設定
<IfModule mod_php7.c>
php_value upload_max_filesize 5M
php_value upload_max_filesize 10M
</IfModule>

<IfModule mod_rewrite.c>
Expand Down Expand Up @@ -49,6 +49,7 @@ DirectoryIndex index.php index.html .ht
RewriteRule "^node_modules/" - [F]
RewriteRule "^codeception/" - [F]
RewriteRule "^bin/" - [F]
RewriteRule "^dockerbuild/" - [F]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !^(.*)\.(gif|png|jpe?g|css|ico|js|svg|map)$ [NC]
Expand All @@ -67,4 +68,4 @@ DirectoryIndex index.php index.html .ht
# <RequireAll>
# Require all granted
# Require not env admin_path
# </RequireAll>#
# </RequireAll>#
30 changes: 24 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# for travis-ci
# see also. https://travis-ci.org
dist: xenial
git:
submodules: false

sudo: required

language: php
services:
- docker
- mysql
- postgresql
- xvfb

addons:
apt:
Expand All @@ -23,6 +27,7 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot

env:
- DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
Expand All @@ -31,6 +36,7 @@ env:

matrix:
allow_failures:
- php: 7.4snapshot
- env: DATABASE_URL=sqlite:///var/eccube.db DATABASE_SERVER_VERSION=3 COVERAGE=1

## see https://github.com/symfony/symfony/blob/e0bdc0c35e9afdb3bee8af172f90e9648c4012fc/.travis.yml#L92-L97
Expand Down Expand Up @@ -68,6 +74,7 @@ script:
- ./bin/phpunit --group update-schema-doctrine-install --filter=testEnablePluginWithProxy
- ./bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithNoProxy
- ./bin/phpunit --group update-schema-doctrine-install --filter=testDisablePluginWithProxy
- ./bin/phpunit --group update-schema-doctrine-install --filter=testCreateEntityAndTrait

jobs:
fast_finish: true
Expand All @@ -91,26 +98,27 @@ jobs:
stage: E2E Test
before_install:
- *php_setup
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- wget -c -nc --retry-connrefused --tries=0 http://chromedriver.storage.googleapis.com/2.43/chromedriver_linux64.zip
- unzip -o -q chromedriver_linux64.zip
- sudo mv -f ./chromedriver /usr/local/bin/
- sudo chmod +x /usr/local/bin/chromedriver
- docker pull schickling/mailcatcher
- docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher
install:
- *composer_install
- *eccube_setup
php: 7.3
env: GROUP=admin01 APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
script: ./codeception.sh -g ${GROUP}
- <<: *e2e_test
php: 7.3
env: GROUP=admin02 APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
- <<: *e2e_test
php: 7.3
env: GROUP=admin03 APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
- <<: *e2e_test
php: 7.3
env: GROUP=front APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -138,6 +146,7 @@ jobs:
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_install_remove_store
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -165,6 +174,7 @@ jobs:
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_install_enable_update_disable_remove_local
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -192,6 +202,7 @@ jobs:
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_install_assets_store
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -219,6 +230,7 @@ jobs:
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_extend_same_table_crossed_local
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand All @@ -242,6 +254,7 @@ jobs:
psql eccube_db -h 127.0.0.1 -U postgres -c "update dtb_base_info set authentication_key='test', php_path = '$(which php)';"
./codeception.sh EA10PluginCest:install_enable_disable_enable_disable_remove_store
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=mysql://root:@localhost/eccube_db DATABASE_SERVER_VERSION=5 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -269,6 +282,7 @@ jobs:
mysql -h 127.0.0.1 -u root eccube_db -e "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_install_remove_store
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=mysql://root:@localhost/eccube_db DATABASE_SERVER_VERSION=5 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -296,6 +310,7 @@ jobs:
mysql -h 127.0.0.1 -u root eccube_db -e "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_install_enable_update_disable_remove_local
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=mysql://root:@localhost/eccube_db DATABASE_SERVER_VERSION=5 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -323,6 +338,7 @@ jobs:
mysql -h 127.0.0.1 -u root eccube_db -e "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_install_assets_store
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=mysql://root:@localhost/eccube_db DATABASE_SERVER_VERSION=5 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand Down Expand Up @@ -350,6 +366,7 @@ jobs:
mysql -h 127.0.0.1 -u root eccube_db -e "update dtb_base_info set authentication_key='test';"
./codeception.sh EA10PluginCest:test_extend_same_table_crossed_local
- <<: *e2e_test
php: 7.3
env: APP_ENV=codeception DATABASE_URL=mysql://root:@localhost/eccube_db DATABASE_SERVER_VERSION=5 MAILER_URL=smtp://localhost:1025 ECCUBE_PACKAGE_API_URL=http://localhost:8080 NO_FIXTURES=1
script:
- *package_api_setup
Expand All @@ -372,6 +389,7 @@ jobs:
# インストーラのテスト
- <<: *e2e_test
# codeceptionのbootstrapでデータ投入を行っているので、本来は不要だけどコマンドラインからのインストールを実行させる
php: 7.3
env: GROUP=installer APP_ENV=codeception DATABASE_URL=postgres://postgres:password@localhost/eccube_db DATABASE_SERVER_VERSION=9 MAILER_URL=smtp://localhost:1025
script:
- echo "APP_ENV=install" >> .env
Expand Down
73 changes: 73 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
FROM php:7.3-apache-stretch

ENV APACHE_DOCUMENT_ROOT /var/www/html

RUN echo "deb http://cdn.debian.net/debian/ stretch main contrib non-free" > /etc/apt/sources.list.d/mirror.jp.list
RUN echo "deb http://cdn.debian.net/debian/ stretch-updates main contrib" >> /etc/apt/sources.list.d/mirror.jp.list

RUN /bin/rm /etc/apt/sources.list

RUN apt-get update && apt-get install -y \
curl apt-utils apt-transport-https debconf-utils gcc build-essential \
zlib1g-dev git gnupg2 unzip libfreetype6-dev libjpeg62-turbo-dev \
libpng-dev libzip-dev libicu-dev vim git ssl-cert \
&& docker-php-ext-install -j$(nproc) zip gd mysqli pdo_mysql opcache intl \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y libpq-dev \
&& docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql \
&& docker-php-ext-install -j$(nproc) pgsql pdo_pgsql \
&& rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get install -y locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen

RUN pecl install apcu && echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apc.ini

RUN if [ ! -d ${APACHE_DOCUMENT_ROOT} ]; then mkdir -p ${APACHE_DOCUMENT_ROOT} ; fi
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

RUN a2enmod rewrite
RUN a2enmod headers

# Enable SSL
RUN a2enmod ssl
RUN ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/default-ssl.conf
EXPOSE 443

# Use the default production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
# Override with custom configuration settings
COPY dockerbuild/php.ini $PHP_INI_DIR/conf.d/

RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/bin/composer

COPY composer.json /tmp/composer.json
COPY composer.lock /tmp/composer.lock
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN composer install --no-scripts --no-autoloader --no-dev -d /tmp

COPY . ${APACHE_DOCUMENT_ROOT}

RUN cp -rp /tmp/vendor ${APACHE_DOCUMENT_ROOT}/vendor \
&& rm -rf /tmp/vendor

WORKDIR ${APACHE_DOCUMENT_ROOT}
RUN chown -R www-data:www-data ${APACHE_DOCUMENT_ROOT}
RUN chown www-data:www-data /var/www

USER www-data
RUN composer dumpautoload -o --apcu --no-dev

RUN if [ ! -f ${APACHE_DOCUMENT_ROOT}/.env ]; then \
cp -p .env.dist .env \
; fi

RUN if [ ! -f ${APACHE_DOCUMENT_ROOT}/var/eccube.db ]; then \
composer run-script installer-scripts && composer run-script auto-scripts \
; fi

USER root

46 changes: 46 additions & 0 deletions app/DoctrineMigrations/Version20190821081036.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

declare(strict_types=1);

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190821081036 extends AbstractMigration
{
const NAME = 'dtb_csv';

public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
if (!$schema->hasTable(self::NAME)) {
return;
}

$taxRateExists = $this->connection->fetchColumn("SELECT COUNT(*) FROM dtb_csv WHERE csv_type_id = 1 AND entity_name = ? AND field_name = 'TaxRule' AND reference_field_name = 'tax_rate'", ['Eccube\\\\Entity\\\\ProductClass']);
if ($taxRateExists == 0) {
$this->addSql("INSERT INTO dtb_csv (csv_type_id, creator_id, entity_name, field_name, reference_field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type) VALUES (1, null , ?, 'TaxRule', 'tax_rate', '税率', 31, false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP,'csv')", ['Eccube\\\\Entity\\\\ProductClass']);
}
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs

}
}
6 changes: 3 additions & 3 deletions app/config/eccube/packages/eccube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ parameters:
env(ECCUBE_GC_MAXLIFETIME): 1440
env(ECCUBE_PACKAGE_API_URL): 'https://package-api.ec-cube.net'
env(ECCUBE_OWNERS_STORE_URL): 'https://www.ec-cube.net'
env(ECCUBE_MAINTENANCE_FILE_PATH): '%kernel.project_dir%/.maintenance'

# EC-CUBE parameter
eccube_database_url: '%env(DATABASE_URL)%'
Expand Down Expand Up @@ -59,7 +60,7 @@ parameters:
plugin_data_realdir: '%kernel.project_dir%/app/PluginData'
plugin_temp_realdir: /PATH/TO/WEB_ROOT/src/Eccube/Repository/Master/upload/temp_plugin/ # upload_tmp_dir に任せればよい?
eccube_price_len: 16 # 最大値で制御したい
eccube_search_pmax: 10
eccube_search_pmax: 12
eccube_stext_len: 255
eccube_sltext_len: 500
eccube_smtext_len: 100
Expand Down Expand Up @@ -129,8 +130,7 @@ parameters:
eccube_news_start_year: 2000
eccube_result_cache_lifetime: 3600 # doctrineのresult cacheのlifetime.
eccube_result_cache_lifetime_short: 10 # doctrineのresult cacheのlifetime. 商品一覧画面など長期間キャッシュできない箇所で使用する.
eccube_content_maintenance_file_path: '%kernel.project_dir%/.maintenance'
eccube_content_maintenance_file_path: '%env(ECCUBE_MAINTENANCE_FILE_PATH)%'
eccube_form_date_format: 'dd-MM-yyyy'
eccube_form_date_format_js_calendar: 'dd-mm-yyyy'
eccube_space: ' '

Loading

0 comments on commit c8f0920

Please sign in to comment.