custom/plugins/CrayssnLabsConfigurator/src/CrayssnLabsConfigurator.php line 24

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace CrayssnLabsConfigurator;
  3. use Shopware\Core\Framework\Api\Context\SystemSource;
  4. use Shopware\Core\Framework\Context;
  5. use Shopware\Core\Framework\Plugin;
  6. /**
  7.  * Class CrayssnLabsConfigurator
  8.  *
  9.  * @package   CrayssnLabsConfigurator
  10.  *
  11.  * @author    Sebastian Ludwig <dev@cl.team>
  12.  * @copyright Copyright (c) 2020, CrayssnLabs Ludwig Wiegler GbR
  13.  *
  14.  * sudo apt update ; sudo apt install -y imagemagick imagemagick-doc ffmpeg webp nano libheif-examples
  15.  *
  16.  * ImageMagic did not allow to process pdf files with convert. To remove this
  17.  * policy entry:
  18.  * sudo nano /etc/ImageMagick-6/policy.xml
  19.  * replace <policy domain="coder" rights="none" pattern="PDF" /> with <!--<policy domain="coder" rights="none" pattern="PDF" />-->
  20.  */
  21. class CrayssnLabsConfigurator extends Plugin
  22. {
  23.     /**
  24.      * Function getContext
  25.      *
  26.      * @return \Shopware\Core\Framework\Context
  27.      */
  28.     public static function getContext(): Context
  29.     {
  30.         static $context;
  31.         if($context === null)
  32.         {
  33.             $context = new Context(new SystemSource());
  34.         }
  35.         return $context;
  36.     }
  37. }