-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nabeel S <nabeelio@users.noreply.github.com>
- Loading branch information
1 parent
e0d4fa0
commit 64db89a
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Listeners; | ||
|
||
use App\Events\CronWeekly; | ||
use Illuminate\Support\Facades\Http; | ||
use Illuminate\Support\Facades\Log; | ||
|
||
class TLDUpdater | ||
{ | ||
public function handle(CronWeekly $event): void | ||
{ | ||
$response = Http::get(config('phpvms.tld_list_url')); | ||
|
||
if ($response->successful()) { | ||
Log::info('Updating TLD list'); | ||
|
||
$filePath = resource_path('tld/public_suffix_list.dat'); | ||
|
||
file_put_contents($filePath, $response->body()); | ||
} else { | ||
Log::error('Unable to update TLD list, Error: '.$response->body()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters