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

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