]> _ Git - cubist_net.git/commitdiff
wip #7008 @1:00
authorsoufiane <soufiane@cubedesigners.com>
Mon, 29 Jul 2024 10:46:52 +0000 (12:46 +0200)
committersoufiane <soufiane@cubedesigners.com>
Mon, 29 Jul 2024 10:46:52 +0000 (12:46 +0200)
src/Transfer/Local.php

index f7e7e84b6368da0eabb7d95511c7bc7d137eaa0b..cf11e23c60baec6304294386656a8e376a9cc34e 100644 (file)
@@ -9,6 +9,8 @@ class Local extends Driver
 {
     protected $_rootPath = '';
 
+    protected $_cache = [];
+
     const ERROR_FOLDER_UNMOUNT = 3;
 
     public function __construct(IServer $server, $rootPath = null)
@@ -74,14 +76,15 @@ class Local extends Driver
     }
 
     public function checkConnexion($data = []) {
-        $ipHosting = $data['protocol'] === 'hosting' ? gethostbyname('hosting.fluidbook.com') : gethostbyname('hosting2.fluidbook.com');
+        $hosting = $data['protocol'] === 'hosting' ? 'hosting.fluidbook.com' : 'hosting2.fluidbook.com';
+        $ipHosting = dns_get_record($hosting, DNS_A)[0]['ip'];
 
         $subdomains = explode("\r\n",$data['subdomains']);
         $subdomainsIntruder = [];
 
         if($subdomains) {
             foreach($subdomains as $subdomain) {
-                $ipSubdomain = gethostbyname($subdomain);
+                $ipSubdomain = dns_get_record($subdomain, DNS_A)[0]['ip'];
                 if($ipSubdomain === $ipHosting) {
                     continue;
                 }else {
@@ -92,7 +95,7 @@ class Local extends Driver
 
         if($subdomainsIntruder) {
             $subdomainsList = implode(", ",$subdomainsIntruder);
-            return ['subdomains' => $subdomainsList];
+            return ['subdomains' => $subdomainsList, 'host' => $hosting];
         }
 
         if(file_exists($this->getRootPath().'status')) {