| ... | ... |
@@ -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 sending notifications for new files |
|
| 23 |
+ */ |
|
| 21 | 24 |
class SecureDownloadsNotificationsCommand extends Command |
| 22 | 25 |
{
|
| 26 |
+ private ContaoFramework $framework; |
|
| 27 |
+ |
|
| 23 | 28 |
public function __construct(ContaoFramework $framework) |
| 24 | 29 |
{
|
| 25 | 30 |
$this->framework = $framework; |
| 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 |
+} |