Install EC-CUBE from Github

Hostnbit

Clone EC-CUBE (4.0.5 or later).

 git clone https://github.com/EC-CUBE/ec-cube.git
 cd ec-cube
 composer install

Change DATABASE_URL and DATABASE_SERVER_VERSION as appropriate. (Adjust to the actual environment)

## for PostgreSQL
 sed -i.bak -e 's/DATABASE_URL=sqlite:\/\/\/var\/eccube.db/DATABASE_URL=postgres:\/\/postgres:password@127.0.0.1\/eccubedb/g' ./.env
 sed -i.bak -e 's/DATABASE_SERVER_VERSION=3/DATABASE_SERVER_VERSION=9/g' ./.env
## for MySQL
 sed -i.bak -e 's/DATABASE_URL=sqlite:\/\/\/var\/eccube.db/DATABASE_URL=mysql:\/\/root:password@127.0.0.1\/eccubedb/g' ./.env
 sed -i.bak -e 's/DATABASE_SERVER_VERSION=3/DATABASE_SERVER_VERSION=5.7/g' ./.env

Install EC-CUBE4.

bin/console eccube:install --no-interaction

Set up a mock server for the EC-CUBE owner’s store.

 # プラグインの保管ディレクトリを作成
 mkdir ${PWD}/repos
 # mockサーバを起動。ここでは9999をポート番号に設定していますが、必要に応じて変更してください
 docker run -d --rm -v ${PWD}/repos:/repos -e MOCK_REPO_DIR=/repos -p 9999:8080 eccube/mock-package-api
 # mockサーバを参照するように環境変数を定義
 echo ECCUBE_PACKAGE_API_URL=http://127.0.0.1:9999 >> .env

Set the authentication key.

 bin/console doctrine:query:sql "update dtb_base_info set authentication_key='dummy'"

Place the plug-in package.

 cd repos
 git clone https://github.com/EC-CUBE/eccube-api4.git
 cd eccube-api4
 tar cvzf ../Api-1.0.0.tgz *
 cd ../../

Install the plugin.

 bin/console eccube:composer:require ec-cube/Api
 bin/console eccube:plugin:enable --code=Api

You can also install plugins from the administration screen → owner’s store → plugins → search for plugins.

Launch the built-in web server

 bin/console server:run

To replace it with the Git repository for API plugin development: Please note that uninstalling the plugin will delete the entire Git repository.

cd app/Plugin/

rm -rf Api
git clone https://github.com/EC-CUBE/eccube-api4.git
mv eccube-api4 Api
Hostnbit

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Menu Title
Scroll to Top