format php and add domainIsOnServer
This commit is contained in:
parent
02372fe988
commit
45ea6abffb
1 changed files with 7 additions and 1 deletions
|
@ -6,6 +6,12 @@ use Amp\Future;
|
||||||
use Amp\Http\Client\HttpClientBuilder;
|
use Amp\Http\Client\HttpClientBuilder;
|
||||||
use Amp\Http\Client\Request;
|
use Amp\Http\Client\Request;
|
||||||
|
|
||||||
|
function domainIsOnServer($domain)
|
||||||
|
{
|
||||||
|
$domainWithoutWww = preg_replace('/^www\./m', '', $domain);
|
||||||
|
return file_exists('/etc/nginx/conf.d/'.$domainWithoutWww.'.conf');
|
||||||
|
}
|
||||||
|
|
||||||
function checkIP($domain, $withWww = false, $noip6 = false)
|
function checkIP($domain, $withWww = false, $noip6 = false)
|
||||||
{
|
{
|
||||||
if (!preg_match('/(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)/', strtolower($domain))) {
|
if (!preg_match('/(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)/', strtolower($domain))) {
|
||||||
|
|
Loading…
Reference in a new issue