Add some PHPDoc comments for ease of programming #87
|
@ -48,6 +48,12 @@ function is_superadmin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* execute a command with sudo
|
||||||
|
* @param string $cmd The command that will be executed.
|
||||||
|
* @param ?array $output see $output parameter of exec().
|
||||||
|
* @param ?int $return_var see $result_code parameter of exec().
|
||||||
|
*/
|
||||||
function sudoexec($cmd, &$output, &$return_var) {
|
function sudoexec($cmd, &$output, &$return_var) {
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ class LetsEncrypt
|
||||||
/**
|
/**
|
||||||
* generate a CSR
|
* generate a CSR
|
||||||
* @param string $vhost
|
* @param string $vhost
|
||||||
* @param Array $domains
|
* @param array $domains
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function makeCsr($vhost, $domains)
|
public function makeCsr($vhost, $domains)
|
||||||
|
@ -69,7 +69,7 @@ class LetsEncrypt
|
||||||
/**
|
/**
|
||||||
* perform a cURL call on the remote resource
|
* perform a cURL call on the remote resource
|
||||||
* the cURL call follows redirections
|
* the cURL call follows redirections
|
||||||
* @param Array $domains list of domains
|
* @param array $domains list of domains
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function checkRemoteResourceAvailability($domain)
|
public function checkRemoteResourceAvailability($domain)
|
||||||
|
@ -108,8 +108,8 @@ class LetsEncrypt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query the corresponding IP for each domain
|
* Query the corresponding IP for each domain
|
||||||
* @param Array $domains list of HTTP checked domains
|
* @param array $domains list of HTTP checked domains
|
||||||
* @return Array $valid_dns_domains list of valid domains
|
* @return array $valid_dns_domains list of valid domains
|
||||||
*/
|
*/
|
||||||
public function checkDNSValidity($domains)
|
public function checkDNSValidity($domains)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@ class LetsEncrypt
|
||||||
/**
|
/**
|
||||||
* Retrieve the SSL certificate from the URL
|
* Retrieve the SSL certificate from the URL
|
||||||
* @param string $domain
|
* @param string $domain
|
||||||
* @return Array|false $cont list of parameters of the certificate, or false
|
* @return array|false $cont list of parameters of the certificate, or false
|
||||||
*/
|
*/
|
||||||
public function getCertificate($domain)
|
public function getCertificate($domain)
|
||||||
{
|
{
|
||||||
|
@ -164,8 +164,8 @@ class LetsEncrypt
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse the certificat arguments and extract data
|
* Parse the certificat arguments and extract data
|
||||||
* @param Array $certificateParameters certificat arguments
|
* @param array $certificateParameters certificat arguments
|
||||||
* @return Array $infosCert contains only the issuer, domains and expiration date
|
* @return array $infosCert contains only the issuer, domains and expiration date
|
||||||
*/
|
*/
|
||||||
public function parseCertificate($certificateParameters)
|
public function parseCertificate($certificateParameters)
|
||||||
{
|
{
|
||||||
|
@ -204,6 +204,12 @@ class LetsEncrypt
|
||||||
return ($timestampCertValidUntil > $currentDate) ? true : false;
|
return ($timestampCertValidUntil > $currentDate) ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the requested domain is included in the certificate
|
||||||
|
* @param string $domainRequested
|
||||||
|
* @param array|string $san
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
public function isDomainIncludedInCert($domainRequested, $san)
|
public function isDomainIncludedInCert($domainRequested, $san)
|
||||||
{
|
{
|
||||||
$san = preg_replace('/DNS:| DNS:/', '', $san);
|
$san = preg_replace('/DNS:| DNS:/', '', $san);
|
||||||
|
|
Loading…
Reference in a new issue