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

  1. <?php declare(strict_types=1);
  2. namespace Shopware\Core\Framework\Update\Services;
  3. use Shopware\Core\Framework\Log\Package;
  4. use Shopware\Core\Framework\Update\Event\UpdatePostFinishEvent;
  5. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  6. /**
  7.  * @internal
  8.  */
  9. #[Package('system-settings')]
  10. class CreateCustomAppsDir implements EventSubscriberInterface
  11. {
  12.     /**
  13.      * @internal
  14.      */
  15.     public function __construct(private readonly string $appDir)
  16.     {
  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. }