SYLIUS

Post-Mortem d'une migration

Grégoire Hébert

Lead-Developper & Formateur @ Les-Tilleuls.coop
@gheb_dev

Dev/consulting/training - Lille/Paris/Amiens

👊 Auto-gérée depuis 2011

⬆ 97% en 2016, 25 employés modèles

👷 ➡ jobs@les-tilleuls.coop

         masterclass@les-tilleuls.coop

LE PROJET

CRM

MONETIQUE

COMPTA

enrichissement données

SERVICE H

BOUTIQUE

MCENTER

CRM

MONETIQUE

COMPTA

SERVICE H

enrichissement données

BOUTIQUE

MCENTER

CRM

MONETIQUE

COMPTA

WEBSITE(sf)

MCENTER

enrichissement données

SERVICE H

BOUTIQUE

CRM

MONETIQUE

COMPTA

SYMFONY

Compte client

enrichissement données

BO

enrichissement données

SERVICE H

BOUTIQUE

MCENTER

CRM

MONETIQUE

COMPTA

SYMFONY

Compte client

enrichissement données

BO

enrichissement données

Compte client

SERVICE H

BOUTIQUE

MCENTER

CRM

MONETIQUE

COMPTA

SYMFONY

Compte client

enrichissement données

BO

enrichissement données

Compte client

SERVICE H

IOS

Donne
moi une API !

ANDROID

Donne
moi une API !

BOUTIQUE

MCENTER

The Shop

Définition Wikipedia:
PrestaShop est une application Web open source permettant de créer une boutique en ligne dans le but de réaliser du commerce électronique.

Quelques chiffres:

  • Créé en 2007
  • 7 Oct 2015 arrivée de Symfony 2.7 dans le projet
  • 11 Jan 2016 Symfony 2.8
  • 11 Sep 2016 support php 7.1

Le webservice

Le webservice

  • search: only GET and HEAD.
  • stock_availables: only GET, POST, and HEAD.
  • stock_movements: only GET and HEAD.
  • stocks: only GET and HEAD.
  • supply_order_details: only GET and HEAD.
  • supply_order_histories: only GET and HEAD.
  • supply_order_receipt_histories: only GET and HEAD.
  • supply_order_states: only GET and HEAD.
  • supply_orders: only GET and HEAD.
  • warehouse_product_locations: only GET and HEAD.
  • warehouses: only GET, POST, PUT, and HEAD.

Le webservice

  • search: only GET and HEAD.
  • stock_availables: only GET, POST, and HEAD.
  • stock_movements: only GET and HEAD.
  • stocks: only GET and HEAD.
  • supply_order_details: only GET and HEAD.
  • supply_order_histories: only GET and HEAD.
  • supply_order_receipt_histories: only GET and HEAD.
  • supply_order_states: only GET and HEAD.
  • supply_orders: only GET and HEAD.
  • warehouse_product_locations: only GET and HEAD.
  • warehouses: only GET, POST, PUT, and HEAD.

Nous avons choisi...

PHP 7.1

GD

Intl

exif

fileInfo

MYSQL 5.X

PostgreSQL

memory_limit > 1024

$ composer create-project sylius/sylius-standard acme
$ cd acme
$ php bin/console sylius:install

$ yarn install
$ yarn run gulp

ADMIN

SHOP

API

CORE

BUNDLES

COMPONENTS

The Good

The Good

The Good


    "replace": {
        "sylius/addressing": "self.version",
        "sylius/addressing-bundle": "self.version",
        "sylius/admin-bundle": "self.version",
        "sylius/api-bundle": "self.version",
        "sylius/attribute": "self.version",
        "sylius/attribute-bundle": "self.version",
        "sylius/core": "self.version",
        "sylius/core-bundle": "self.version",
        "sylius/currency": "self.version",
        "sylius/currency-bundle": "self.version",
        "sylius/customer": "self.version",
        "sylius/customer-bundle": "self.version",
        "sylius/fixtures-bundle": "self.version",
        "sylius/inventory": "self.version",
        "sylius/inventory-bundle": "self.version",
        "sylius/locale": "self.version",
        "sylius/locale-bundle": "self.version",
        "sylius/money-bundle": "self.version",
        "sylius/order": "self.version",
        "sylius/order-bundle": "self.version",
        "sylius/payment": "self.version",
        "sylius/payment-bundle": "self.version",
        "sylius/payum-bundle": "self.version",
        "sylius/product": "self.version",
        "sylius/product-bundle": "self.version",
        "sylius/promotion": "self.version",
        "sylius/promotion-bundle": "self.version",
        "sylius/registry": "self.version",
        "sylius/resource": "self.version",
        "sylius/resource-bundle": "self.version",
        "sylius/shipping": "self.version",
        "sylius/shipping-bundle": "self.version",
        "sylius/shop-bundle": "self.version",
        "sylius/taxation": "self.version",
        "sylius/taxation-bundle": "self.version",
        "sylius/taxonomy": "self.version",
        "sylius/taxonomy-bundle": "self.version",
        "sylius/theme-bundle": "self.version",
        "sylius/ui-bundle": "self.version",
        "sylius/user": "self.version",
        "sylius/user-bundle": "self.version"
    }

The Good

    "require": {
        "php": "^7.1",

        "stof/doctrine-extensions-bundle": "^1.2",
        "sylius/registry": "^1.0",
        "sylius/resource-bundle": "^1.0",
        "sylius/taxation": "^1.0",
        "symfony/framework-bundle": "^3.4"
    },

The Good

    "require": {
        "php": "^7.1",

        "sylius/registry": "^1.0",
        "sylius/resource": "^1.0"
    },

The Good

  • Addressing
  • Attribute
  • Channel
  • Currency
  • Grid
  • Inventory
  • Locales
  • Mailer
  • Order
  • Payment
  • Pricing
  • Product
  • Promotion
  • Registry
  • Resource
  • Shipping
  • Taxation
  • Taxonomy
  • User

The Good

  • Gestion de plusieurs catalogues de produits

  • Ajout d’un nombre illimité de produits et de catégories

  • Gestion de produit avancée comme l’ajout de variations pour les produits complexes par exemple

  • Suivi du stock, des taxes, des promotions et des états de livraisons

  • Gestion et affichage des taxes par pays et par catégories

  • Gestion des utilisateurs

  • Tunnel d’achat personnalisable

  • Statistiques de suivi de commandes

  • Configuration des frais de livraison selon taille et poids des produits par exemple

  • Gestion des données Via une API

The Good

The Good

The Good

The Good

The Good

The Good

The Good

The Bad

The Bad

The Bad

The Bad

final class DefaultCalculators
{
    /**
     * Flat rate per shipment calculator.
     */
    public const FLAT_RATE = 'flat_rate';

    /**
     * Fixed price per unit calculator.
     */
    public const PER_UNIT_RATE = 'per_unit_rate';

    private function __construct()
    {
    }
}

The Bad

The Bad

The Ugly

The Ugly

    "require": {
        "php": "^5.6|^7.0",

        "friendsofsymfony/oauth-server-bundle": "^1.5",
        "sylius/core-bundle": "^1.0",
        "symfony/form": "^3.2",
        "symfony/framework-bundle": "^3.2",
        "symfony/validator": "^3.2"
    },

The Ugly

    "require": {
        "php": "^7.1",

        "fzaninotto/faker": "^1.0",
        "jms/serializer-bundle": "^2.0",
        "knplabs/knp-gaufrette-bundle": "^0.3",
        "sonata-project/intl-bundle": "^2.2",
        "swiftmailer/swiftmailer": "^6.0",
        "sylius/addressing-bundle": "^1.0",
        "sylius/attribute-bundle": "^1.0",
        "sylius/core": "^1.0",
        "sylius/currency-bundle": "^1.0",
        "sylius/customer-bundle": "^1.0",
        "sylius/fixtures-bundle": "^1.0",
        "sylius/inventory-bundle": "^1.0",
        "sylius/locale-bundle": "^1.0",
        "sylius/money-bundle": "^1.0",
        "sylius/order-bundle": "^1.0",
        "sylius/payment-bundle": "^1.0",
        "sylius/payum-bundle": "^1.0",
        "sylius/product-bundle": "^1.0",
        "sylius/promotion-bundle": "^1.0",
        "sylius/resource-bundle": "^1.0",
        "sylius/review-bundle": "^1.0",
        "sylius/shipping-bundle": "^1.0",
        "sylius/taxation-bundle": "^1.0",
        "sylius/taxonomy-bundle": "^1.0",
        "sylius/theme-bundle": "^1.0",
        "sylius/user-bundle": "^1.0",
        "sylius-labs/association-hydrator": "^1.0",
        "symfony/framework-bundle": "^3.4",
        "winzou/state-machine-bundle": "^0.3",
        "liip/imagine-bundle": "^1.9.1"
    },

The Ugly

The Ugly

    "require": {
        "php": "^5.6|^7.0",

        "friendsofsymfony/oauth-server-bundle": "^1.5",
        "sylius/core-bundle": "^1.0",
        "symfony/form": "^3.2",
        "symfony/framework-bundle": "^3.2",
        "symfony/validator": "^3.2"
    },

The Ugly

    "require": {
        "php": "^5.6|^7.0",

        "friendsofsymfony/oauth-server-bundle": "^1.5",
        "sylius/core-bundle": "^1.0",
        "symfony/form": "^3.2",
        "symfony/framework-bundle": "^3.2",
        "symfony/validator": "^3.2"
    },
        "lexik/jwt-authentication-bundle": "^2.4",

The Ugly

 $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', [...]
[...]->getName() !== 'mysql', [...]

So ?

Merci !
Des questions ?

Post Mortem - From Prestashop To Sylius

By Grégoire Hébert

Post Mortem - From Prestashop To Sylius

On dit oui ?

  • 815
Loading comments...

More from Grégoire Hébert