vendor/shopware/core/Framework/Update/Services/CreateCustomAppsDir.php line 27

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Update\Services;
  3. use Shopware\Core\Framework\Update\Event\UpdatePostFinishEvent;
  4. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  5. class CreateCustomAppsDir implements EventSubscriberInterface
  6. {
  7.     private string $appDir;
  8.     /**
  9.      * @internal
  10.      */
  11.     public function __construct(string $appDir)
  12.     {
  13.         $this->appDir $appDir;
  14.     }
  15.     public static function getSubscribedEvents(): array
  16.     {
  17.         return [
  18.             UpdatePostFinishEvent::class => 'onUpdate',
  19.         ];
  20.     }
  21.     public function onUpdate(): void
  22.     {
  23.         if (is_dir($this->appDir)) {
  24.             return;
  25.         }
  26.         mkdir($this->appDir);
  27.     }
  28. }