From ea5104b302eac2d4aa312911d040e7dda3b7f3b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kali=C5=84ski?= Date: Wed, 4 Sep 2024 13:40:40 +0200 Subject: [PATCH 1/2] OP-519 - installation.md has been updated --- doc/installation.md | 95 ++++++++++++++++++++++++++++++--------------- 1 file changed, 64 insertions(+), 31 deletions(-) diff --git a/doc/installation.md b/doc/installation.md index 403a60e..b8329cb 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -1,66 +1,99 @@ -## Installation - - -1. *We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.* - +# Installation + +## Overview: +GENERAL +- [Requirements](#requirements) +- [Composer](#composer) +- [Basic configuration](#basic-configuration) +--- +--- +ADDITIONAL +- [Tests](#tests) +- [Known Issues](#known-issues) +--- + +## Requirements: +We work on stable, supported and up-to-date versions of packages. We recommend you to do the same. + +| Package | Version | +|---------------|-----------------| +| PHP | \>=8.0 | +| sylius/sylius | 1.12.x - 1.13.x | +| MySQL | \>= 5.7 | +| NodeJS | \>= 20.x | + +## Composer: ```bash composer require bitbag/banner-plugin --no-scripts ``` -2. Add plugin dependencies to your `config/bundles.php` file: +## Basic configuration: +Add plugin dependencies to your `config/bundles.php` file: ```php +# config/bundles.php + return [ ... - BitBag\SyliusBannerPlugin\BitBagSyliusBannerPlugin::class => ['all' => true], - ]; +]; ``` -3. Import required config in your `config/packages/_sylius.yaml` file: +Import required config in your `config/packages/_sylius.yaml` file: + ```yaml # config/packages/_sylius.yaml imports: ... - - { resource: "@BitBagSyliusBannerPlugin/Resources/config/config.yaml" } ``` -4. Import routing in your `config/routes.yaml` file: - +Add routing to your `config/routes.yaml` file: ```yaml - # config/routes.yaml -... bitbag_sylius_banner_plugin: resource: "@BitBagSyliusBannerPlugin/Resources/config/routing.yaml" ``` -5. Please clear the cache: +### Update your database +First, please run legacy-versioned migrations by using command: +```bash +bin/console doctrine:migrations:migrate +``` +After migration, please create a new diff migration and update database: +```bash +bin/console doctrine:migrations:diff +bin/console doctrine:migrations:migrate ``` +**Note:** If you are running it on production, add the `-e prod` flag to this command. + +### Clear application cache by using command: +```bash bin/console cache:clear ``` +**Note:** If you are running it on production, add the `-e prod` flag to this command. -6. Finish the installation by updating the database schema and installing assets: - -``` -bin/console doctrine:migrations:diff -bin/console doctrine:migrations:migrate +## Tests +To run the tests, execute the commands: +```bash +composer install +cd tests/Application +yarn install +yarn run gulp +bin/console assets:install public -e test +bin/console doctrine:schema:create -e test +bin/console server:run 127.0.0.1:8080 -d public -e test +open http://localhost:8080 +vendor/bin/behat +vendor/bin/phpspec run ``` -## Testing & running the plugin +## Known issues +### Translations not displaying correctly +For incorrectly displayed translations, execute the command: ```bash -$ composer install -$ cd tests/Application -$ yarn install -$ yarn run gulp -$ bin/console assets:install public -e test -$ bin/console doctrine:schema:create -e test -$ bin/console server:run 127.0.0.1:8080 -d public -e test -$ open http://localhost:8080 -$ vendor/bin/behat -$ vendor/bin/phpspec run +bin/console cache:clear ``` From 5749d39f470dc9daccc69db25e8b34d1dcf40bf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Kukli=C5=84ski?= Date: Mon, 9 Sep 2024 13:21:25 +0200 Subject: [PATCH 2/2] Update doc/installation.md --- doc/installation.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/installation.md b/doc/installation.md index b8329cb..1ffc942 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -6,7 +6,6 @@ GENERAL - [Composer](#composer) - [Basic configuration](#basic-configuration) --- ---- ADDITIONAL - [Tests](#tests) - [Known Issues](#known-issues)