1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,48 @@ |
1 |
+<?php |
|
2 |
+ |
|
3 |
+declare(strict_types=1); |
|
4 |
+ |
|
5 |
+/* |
|
6 |
+ * This file is part of eSales Media SinglereisenBundle |
|
7 |
+ * |
|
8 |
+ * (c) Benjamin Roth |
|
9 |
+ * |
|
10 |
+ * @license proprietary |
|
11 |
+ */ |
|
12 |
+ |
|
13 |
+namespace vonRotenberg\MemberfilesBundle\Command; |
|
14 |
+ |
|
15 |
+use Contao\CoreBundle\Framework\ContaoFramework; |
|
16 |
+use Contao\System; |
|
17 |
+use Symfony\Component\Console\Command\Command; |
|
18 |
+use Symfony\Component\Console\Input\InputInterface; |
|
19 |
+use Symfony\Component\Console\Output\OutputInterface; |
|
20 |
+ |
|
21 |
+class SecureDownloadsNotificationsCommand extends Command |
|
22 |
+{ |
|
23 |
+ public function __construct(ContaoFramework $framework) |
|
24 |
+ { |
|
25 |
+ $this->framework = $framework; |
|
26 |
+ |
|
27 |
+ parent::__construct(); |
|
28 |
+ } |
|
29 |
+ |
|
30 |
+ protected function configure(): void |
|
31 |
+ { |
|
32 |
+ $this |
|
33 |
+ ->setName('secureDownloads:sendNotifications') |
|
34 |
+ ->setDescription('Sends notifications about newly added files.') |
|
35 |
+ ; |
|
36 |
+ } |
|
37 |
+ |
|
38 |
+ protected function execute(InputInterface $input, OutputInterface $output): int |
|
39 |
+ { |
|
40 |
+ $this->framework->initialize(); |
|
41 |
+ |
|
42 |
+ $secdl_service = System::getContainer()->get("vonrotenberg.cron.secure_downloads_service"); |
|
43 |
+ |
|
44 |
+ $secdl_service->sendFileNotifications('cli'); |
|
45 |
+ |
|
46 |
+ return 0; |
|
47 |
+ } |
|
48 |
+} |