Browse code

Extensive changes due to code review

Benjamin Roth authored on21/10/2025 16:56:28
Showing1 changed files
... ...
@@ -3,11 +3,11 @@
3 3
 declare(strict_types=1);
4 4
 
5 5
 /*
6
- * This file is part of eSales Media SinglereisenBundle
6
+ * This file is part of memberfiles bundle.
7 7
  *
8
- * (c) Benjamin Roth
8
+ * (c) vonRotenberg
9 9
  *
10
- * @license proprietary
10
+ * @license commercial
11 11
  */
12 12
 
13 13
 namespace vonRotenberg\MemberfilesBundle\Command;
... ...
@@ -18,8 +18,13 @@ use Symfony\Component\Console\Command\Command;
18 18
 use Symfony\Component\Console\Input\InputInterface;
19 19
 use Symfony\Component\Console\Output\OutputInterface;
20 20
 
21
+/**
22
+ * Console command to manually trigger file import for secure downloads
23
+ */
21 24
 class SecureDownloadsImportCommand extends Command
22 25
 {
26
+    private ContaoFramework $framework;
27
+
23 28
     public function __construct(ContaoFramework $framework)
24 29
     {
25 30
         $this->framework = $framework;
Browse code

Update

Benjamin Roth authored on26/07/2023 17:00:15
Showing1 changed files
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 SecureDownloadsImportCommand 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:import')
34
+            ->setDescription('Check source folder and import files if applicable.')
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->importFiles('cli');
45
+
46
+        return 0;
47
+    }
48
+}