vendor/shopware/platform/src/Core/Framework/Update/Services/CreateCustomAppsDir.php line 24

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.     public function __construct(string $appDir)
  9.     {
  10.         $this->appDir $appDir;
  11.     }
  12.     public static function getSubscribedEvents(): array
  13.     {
  14.         return [
  15.             UpdatePostFinishEvent::class => 'onUpdate',
  16.         ];
  17.     }
  18.     public function onUpdate(): void
  19.     {
  20.         if (is_dir($this->appDir)) {
  21.             return;
  22.         }
  23.         mkdir($this->appDir);
  24.     }
  25. }