deleteFiles example


    public function decrement(string $key, int $offset = 1)
    {
        return $this->increment($key, -$offset);
    }

    /** * {@inheritDoc} */
    public function clean()
    {
        return $this->deleteFiles($this->path, false, true);
    }

    /** * {@inheritDoc} */
    public function getCacheInfo()
    {
        return $this->getDirFileInfo($this->path);
    }

    /** * {@inheritDoc} */
return self::SUCCESS;
        }

        $confirm = $io->confirm(sprintf('Are you sure that you want to delete %d expired files?', $count), false);

        if (!$confirm) {
            $io->caution('Aborting due to user input.');

            return self::SUCCESS;
        }

        $this->deleteExpiredFilesService->deleteFiles($context);
        $io->success(sprintf('Successfully deleted %d expired files.', $count));

        return self::SUCCESS;
    }
}

    public function __construct(
        EntityRepository $repository,
        private readonly DeleteExpiredFilesService $deleteExpiredFilesService
    ) {
        parent::__construct($repository);
    }

    public function run(): void
    {
        $this->deleteExpiredFilesService->deleteFiles(Context::createDefaultContext());
    }
}
Home | Imprint | This part of the site doesn't use cookies.