Skip to content

Commit

Permalink
Merge pull request #4999 from okazy/improve/4.0
Browse files Browse the repository at this point in the history
4.0ブランチの修正を4.1-featureブランチに取り込み
  • Loading branch information
Kiyotaka Oku authored Apr 5, 2021
2 parents 3f08e3f + 23da54c commit 60f8669
Show file tree
Hide file tree
Showing 77 changed files with 231 additions and 613 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,13 @@ jobs:
rm -rf $GITHUB_WORKSPACE/.gitignore
rm -rf $GITHUB_WORKSPACE/.buildpath
rm -rf $GITHUB_WORKSPACE/.gitmodules
rm -rf $GITHUB_WORKSPACE/.scrutinizer.yml
rm -rf $GITHUB_WORKSPACE/.travis.yml
rm -rf $GITHUB_WORKSPACE/appveyor.yml
rm -rf $GITHUB_WORKSPACE/.coveralls.yml
rm -rf $GITHUB_WORKSPACE/.php_cs.dist
rm -rf $GITHUB_WORKSPACE/phpunit.xml.dist
rm -rf $GITHUB_WORKSPACE/phpstan.neon.dist
rm -rf $GITHUB_WORKSPACE/app.json
rm -rf $GITHUB_WORKSPACE/Procfile
rm -rf $GITHUB_WORKSPACE/LICENSE.txt
rm -rf $GITHUB_WORKSPACE/README.md
rm -rf $GITHUB_WORKSPACE/codeception.sh
rm -rf $GITHUB_WORKSPACE/codeception.yml
rm -rf $GITHUB_WORKSPACE/app/Plugin/*
rm -rf $GITHUB_WORKSPACE/codeception
Expand Down
426 changes: 0 additions & 426 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ EXPOSE 443
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/
COPY dockerbuild/docker-php-entrypoint /usr/local/bin/

RUN chown www-data:www-data /var/www \
&& mkdir -p ${APACHE_DOCUMENT_ROOT}/vendor \
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# EC-CUBE 4.0

[![Build Status](https://travis-ci.com/EC-CUBE/ec-cube.svg?branch=4.0)](https://travis-ci.com/EC-CUBE/ec-cube)
[![Unit test for EC-CUBE](https://github.com/EC-CUBE/ec-cube/actions/workflows/unit-test.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/unit-test.yml)
[![E2E test for EC-CUBE](https://github.com/EC-CUBE/ec-cube/actions/workflows/e2e-test.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/e2e-test.yml)
[![Plugin test for EC-CUBE](https://github.com/EC-CUBE/ec-cube/actions/workflows/plugin-test.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/plugin-test.yml)
[![PHPStan](https://github.com/EC-CUBE/ec-cube/actions/workflows/phpstan.yml/badge.svg?branch=4.0)](https://github.com/EC-CUBE/ec-cube/actions/workflows/phpstan.yml)
[![codecov](https://codecov.io/gh/EC-CUBE/ec-cube/branch/4.0/graph/badge.svg?token=BhnPjjvfwd)](https://codecov.io/gh/EC-CUBE/ec-cube)

[![Slack](https://img.shields.io/badge/slack-join%5fchat-brightgreen.svg?style=flat)](https://join.slack.com/t/ec-cube/shared_invite/enQtNDA1MDYzNDQxMTIzLTY5MTRhOGQ2MmZhMjQxYTAwMmVlMDc5MDU2NjJlZmFiM2E3M2Q0M2Y3OTRlMGY4NTQzN2JiZDBkNmQwNTUzYzc)
Expand Down
6 changes: 3 additions & 3 deletions app/Plugin/HogePlugin/composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ec-cube/Hoge",
"name": "ec-cube/HogePlugin",
"version": "1.0.0",
"description": "プラグインサンプル",
"type": "eccube-plugin",
"extra": {
"code": "Hoge"
"code": "HogePlugin"
}
}
}
26 changes: 0 additions & 26 deletions codeception.sh

This file was deleted.

4 changes: 2 additions & 2 deletions codeception/acceptance/EA01TopCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public function top_001(\AcceptanceTester $I)
// お知らせの記事をクリックすると設定されたURLに遷移することを確認
$I->switchToIFrame('information');
$selector = '.news_area .link_list .tableish a:nth-child(1)';
$url = $I->grabAttributeFrom($selector, 'href');
$url = $I->executeJS('return location.href');
$I->click(['css' => $selector]);
$I->switchToNewWindow();
$I->assertEquals($url, $I->executeJS('return location.href'), $url.' が一致しません');
$I->assertNotEquals($url, $I->executeJS('return location.href'), $url.' から遷移していません。');
$I->switchToWindow();

// ショップ情報の在庫切れ商品をクリックすると商品管理ページに遷移することを確認
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: '3'

services:
ec-cube:
volumes:
- ".:/var/www/html:cached"
27 changes: 27 additions & 0 deletions docker-compose.mysql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'

volumes:
mysql-database:
driver: local

services:
ec-cube:
depends_on:
- mysql
environment:
DATABASE_URL: "mysql://dbuser:secret@mysql/eccubedb"
DATABASE_SERVER_VERSION: 10

mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccubedb
MYSQL_USER: dbuser
MYSQL_PASSWORD: secret
volumes:
- mysql-database:/var/lib/mysql
ports:
- 13306:3306
networks:
- backend
File renamed without changes.
26 changes: 26 additions & 0 deletions docker-compose.pgsql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3'

volumes:
pg-database:
driver: local

services:
ec-cube:
depends_on:
- postgres
environment:
DATABASE_URL: "postgres://dbuser:secret@postgres/eccubedb"
DATABASE_SERVER_VERSION: 10

postgres:
image: postgres:10
environment:
POSTGRES_DB: eccubedb
POSTGRES_USER: dbuser
POSTGRES_PASSWORD: secret
ports:
- 15432:5432
volumes:
- pg-database:/var/lib/postgresql/data
networks:
- backend
54 changes: 21 additions & 33 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ networks:
driver: bridge

volumes:
pg-database:
driver: local
mysql-database:
driver: local
mailcatcher-data:
driver: local

Expand All @@ -33,40 +29,32 @@ services:
- 8080:80
- 4430:443
volumes:
- ".:/var/www/html:cached"
### 同期対象からコストの重いフォルダを除外 #####################
- "var:/var/www/html/var"
- "vendor:/var/www/html/vendor"
- "node_modules:/var/www/html/node_modules"
networks:
- backend

### Postgres ################################
postgres:
image: postgres:10
environment:
- POSTGRES_DB=eccubedb
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=secret
ports:
- 15432:5432
volumes:
- pg-database:/var/lib/postgresql/data
networks:
- backend

### MySQL ##################################
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eccubedb
MYSQL_USER: dbuser
MYSQL_PASSWORD: secret
volumes:
- mysql-database:/var/lib/mysql
ports:
- 13306:3306
# EC-CUBE environments
APP_ENV: "dev"
APP_DEBUG: 1
DATABASE_URL: "sqlite:///var/eccube.db"
DATABASE_SERVER_VERSION: 3
MAILER_URL: "smtp://mailcatcher:1025"
ECCUBE_AUTH_MAGIC: "<change.me>"
# ECCUBE_LOCALE: "ja"
# ECCUBE_TIMEZONE: "Asia/Tokyo"
# ECCUBE_CURRENCY: "JPY"
# ECCUBE_ADMIN_ROUTE: "admin"
# ECCUBE_USER_DATA_ROUTE: "user_data"
# ECCUBE_ADMIN_ALLOW_HOSTS: []
# ECCUBE_FORCE_SSL: false
# ECCUBE_TEMPLATE_CODE: "default"
# ECCUBE_COOKIE_NAME: "eccube"
# ECCUBE_COOKIE_PATH: "/"
# ECCUBE_COOKIE_LIFETIME: 0
# ECCUBE_GC_MAXLIFETIME: 1440
# ECCUBE_ADMIN_USER: "admin"
# ECCUBE_ADMIN_PASS: "password"
networks:
- backend

Expand Down
13 changes: 13 additions & 0 deletions dockerbuild/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
set -e

if [ -n "${APP_ENV}" ]; then
echo "SetEnv APP_ENV ${APP_ENV}" >> /etc/apache2/conf-enabled/app_env.conf
fi

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- apache2-foreground "$@"
fi

exec "$@"
1 change: 1 addition & 0 deletions dockerbuild/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ opcache.max_accelerated_files = 20000
opcache.memory_consumption=256
realpath_cache_size = 4096K
realpath_cache_ttl = 600
memory_limit = 786M
2 changes: 0 additions & 2 deletions html/template/install/assets/js/vendor/jquery-3.3.1.min.js

This file was deleted.

2 changes: 2 additions & 0 deletions html/template/install/assets/js/vendor/jquery-3.5.1.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion nginx.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ server {
location ~ /\. {
deny all;
}
location ~^/(var|test|vendor|app|src) {
location ~^/(var|test|vendor|app|src|bin) {
deny all;
}
}
24 changes: 12 additions & 12 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion src/Eccube/Command/GenerateDummyDataCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('Order: id='.$Order->getId());
break;
}
$this->entityManager->flush($Order);
$this->entityManager->flush();
$j++;
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL && ($j % 100) === 0 && $j > 0) {
$output->writeln(' ...'.$j);
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Command/PluginGenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public function index(Request \$request)
if (\$form->isSubmitted() && \$form->isValid()) {
\$Config = \$form->getData();
\$this->entityManager->persist(\$Config);
\$this->entityManager->flush(\$Config);
\$this->entityManager->flush();
\$this->addSuccess('登録しました。', 'admin');
return \$this->redirectToRoute('${snakecased}_admin_config');
Expand Down
6 changes: 3 additions & 3 deletions src/Eccube/Controller/Admin/Content/LayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function delete(Layout $Layout, CacheUtil $cacheUtil)
}

$this->entityManager->remove($Layout);
$this->entityManager->flush($Layout);
$this->entityManager->flush();

$this->addSuccess('admin.common.delete_complete', 'admin');

Expand Down Expand Up @@ -180,15 +180,15 @@ public function edit(Request $request, $id = null, $previewPageId = null, CacheU
// Layoutの更新
$Layout = $form->getData();
$this->entityManager->persist($Layout);
$this->entityManager->flush($Layout);
$this->entityManager->flush();

// BlockPositionの更新
// delete/insertのため、一度削除する.
$BlockPositions = $Layout->getBlockPositions();
foreach ($BlockPositions as $BlockPosition) {
$Layout->removeBlockPosition($BlockPosition);
$this->entityManager->remove($BlockPosition);
$this->entityManager->flush($BlockPosition);
$this->entityManager->flush();
}

// ブロックの個数分登録を行う.
Expand Down
6 changes: 3 additions & 3 deletions src/Eccube/Controller/Admin/Content/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function edit(Request $request, $id = null, Environment $twig, RouterInte
foreach ($Page->getPageLayouts() as $PageLayout) {
$Page->removePageLayout($PageLayout);
$this->entityManager->remove($PageLayout);
$this->entityManager->flush($PageLayout);
$this->entityManager->flush();
}

$Layout = $form['PcLayout']->getData();
Expand All @@ -195,7 +195,7 @@ public function edit(Request $request, $id = null, Environment $twig, RouterInte
$PageLayout->setPage($Page);

$this->entityManager->persist($PageLayout);
$this->entityManager->flush($PageLayout);
$this->entityManager->flush();
}

$Layout = $form['SpLayout']->getData();
Expand All @@ -208,7 +208,7 @@ public function edit(Request $request, $id = null, Environment $twig, RouterInte
$PageLayout->setPage($Page);

$this->entityManager->persist($PageLayout);
$this->entityManager->flush($PageLayout);
$this->entityManager->flush();
}

$event = new EventArgs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public function delete(Request $request, $id, TranslatorInterface $translator)

try {
$this->entityManager->remove($Customer);
$this->entityManager->flush($Customer);
$this->entityManager->flush();
$this->addSuccess('admin.common.delete_complete', 'admin');
} catch (ForeignKeyConstraintViolationException $e) {
log_error('会員削除失敗', [$e]);
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Admin/Order/EditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public function index(Request $request, $id = null, RouterInterface $router)
// 会員の場合、購入回数、購入金額などを更新
if ($Customer = $TargetOrder->getCustomer()) {
$this->orderRepository->updateOrderSummary($Customer);
$this->entityManager->flush($Customer);
$this->entityManager->flush();
}

$event = new EventArgs(
Expand Down
Loading

0 comments on commit 60f8669

Please sign in to comment.