2016-09-15 15:41:54 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
|
2017-12-19 16:00:42 +00:00
|
|
|
use App\Models\WebMention;
|
2016-09-15 15:41:54 +01:00
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use App\Jobs\DownloadWebMention;
|
|
|
|
|
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';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new command instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execute the console command.
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function handle()
|
|
|
|
{
|
|
|
|
$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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|