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

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. /**
  6.  * @deprecated tag:v6.5.0 - reason:becomes-internal - EventSubscribers will become internal in v6.5.0
  7.  */
  8. class CreateCustomAppsDir implements EventSubscriberInterface
  9. {
  10.     private string $appDir;
  11.     /**
  12.      * @internal
  13.      */
  14.     public function __construct(string $appDir)
  15.     {
  16.         $this->appDir $appDir;
  17.     }
  18.     public static function getSubscribedEvents(): array
  19.     {
  20.         return [
  21.             UpdatePostFinishEvent::class => 'onUpdate',
  22.         ];
  23.     }
  24.     public function onUpdate(): void
  25.     {
  26.         if (is_dir($this->appDir)) {
  27.             return;
  28.         }
  29.         mkdir($this->appDir);
  30.     }
  31. }