Compare commits
4 commits
Author | SHA1 | Date | |
---|---|---|---|
53be613099 | |||
1dc4a47320 | |||
059300dde6 | |||
Simon Vieille | e9af453f57 |
|
@ -8,9 +8,9 @@ Checks the expiration dates of domains et HTTPS certificates.
|
||||||
PHP 7.3, [composer](https://getcomposer.org/), `whois` and `openssl` required.
|
PHP 7.3, [composer](https://getcomposer.org/), `whois` and `openssl` required.
|
||||||
|
|
||||||
```text
|
```text
|
||||||
$ git clone --recurse-submodules https://gitnet.fr/deblan/domain-expiration.git
|
git clone --recurse-submodules https://gitnet.fr/deblan/domain-expiration.git
|
||||||
$ cd domain-expiration
|
cd domain-expiration
|
||||||
$ composer install
|
composer install
|
||||||
```
|
```
|
||||||
|
|
||||||
```text
|
```text
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0af396b41a5dc159e31689812bdbdd0203394cfd
|
Subproject commit 3935a6d0ac8239bde3207d2a39681db0e6d517d4
|
|
@ -104,8 +104,8 @@ EOF
|
||||||
]);
|
]);
|
||||||
$process->run();
|
$process->run();
|
||||||
|
|
||||||
$whois = $process->getOutput();
|
$content = $process->getOutput();
|
||||||
$parser = new Parser($whois);
|
$parser = new Parser($content);
|
||||||
$expiryDate = $parser->getExpiryDate();
|
$expiryDate = $parser->getExpiryDate();
|
||||||
|
|
||||||
if ($expiryDate) {
|
if ($expiryDate) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ class SslCertParser
|
||||||
*/
|
*/
|
||||||
public function getExpiryDate(): ? \DateTime
|
public function getExpiryDate(): ? \DateTime
|
||||||
{
|
{
|
||||||
preg_match('/days=([^;]+);/', $this->check, $match);
|
preg_match('/expires in ([^\s]+)\s+/', $this->check, $match);
|
||||||
|
|
||||||
if (isset($match[1])) {
|
if (isset($match[1])) {
|
||||||
$days = (int) $match[1];
|
$days = (int) $match[1];
|
||||||
|
|
Loading…
Reference in a new issue