Deploy Ladill Hosting / deploy (push) Failing after 17s
Shared web hosting extracted from the platform monolith, with CI deploy to /var/www/ladill-hosting matching Bird/Domains/Email. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
581 B
PHP
30 lines
581 B
PHP
<?php
|
|
|
|
namespace App\Services\Ssl;
|
|
|
|
use Carbon\CarbonInterface;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class SslCertificateExpiryParser
|
|
{
|
|
public function parseOpenSslEndDate(string $output): ?CarbonInterface
|
|
{
|
|
$line = trim($output);
|
|
|
|
if ($line === '') {
|
|
return null;
|
|
}
|
|
|
|
if (str_contains($line, '=')) {
|
|
$line = trim((string) strstr($line, '='));
|
|
$line = ltrim($line, '=');
|
|
}
|
|
|
|
try {
|
|
return Carbon::parse($line);
|
|
} catch (\Throwable) {
|
|
return null;
|
|
}
|
|
}
|
|
}
|