2016-09-15 15:41:54 +01:00
|
|
|
<?php
|
|
|
|
|
2018-01-15 14:02:13 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2016-09-15 15:41:54 +01:00
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
2019-10-27 16:29:15 +00:00
|
|
|
use App\Jobs\DownloadWebMention;
|
2017-12-19 16:00:42 +00:00
|
|
|
use App\Models\WebMention;
|
2016-09-15 15:41:54 +01:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
2023-07-28 11:48:07 +01:00
|
|
|
/**
|
|
|
|
* @psalm-suppress UnusedClass
|
|
|
|
*/
|
2016-09-17 21:01:23 +01:00
|
|
|
class ReDownloadWebMentions extends Command
|
2016-09-15 15:41:54 +01:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The name and signature of the console command.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
2016-09-17 21:01:23 +01:00
|
|
|
protected $signature = 'webmentions:redownload';
|
2016-09-15 15:41:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The console command description.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $description = 'Redownload the HTML content of webmentions';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the console command.
|
|
|
|
*/
|
2023-02-18 09:34:57 +00:00
|
|
|
public function handle(): void
|
2016-09-15 15:41:54 +01:00
|
|
|
{
|
|
|
|
$webmentions = WebMention::all();
|
|
|
|
foreach ($webmentions as $webmention) {
|
2016-09-19 21:22:03 +01:00
|
|
|
$this->info('Initiation re-download of ' . $webmention->source);
|
2016-09-20 13:13:05 +01:00
|
|
|
dispatch(new DownloadWebMention($webmention->source));
|
2016-09-15 15:41:54 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|