]> _ Git - cubist_util.git/commitdiff
wip #5700 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 Jan 2023 10:26:43 +0000 (11:26 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 30 Jan 2023 10:26:43 +0000 (11:26 +0100)
composer.lock
src/CommandLine/CloneProgram.php
src/CommandLine/CloneUserpassProgram.php

index ed7d9acdb4d8c5e8680492afabad5ad17ac257c1..d81c605d9b57fb559e0a8531d85dfa6c466a39e1 100644 (file)
             "source": {
                 "type": "git",
                 "url": "git://git.cubedesigners.com/cubist_net.git",
-                "reference": "afc022a3a2f8934c321d8f1ab3b36a0d716254cd"
+                "reference": "c7e86c950bac79f1f8f05627c120cdabd77c572a"
             },
             "dist": {
                 "type": "tar",
-                "url": "https://composer.cubedesigners.com/dist/cubist/net/cubist-net-dev-master-f6e9d7.tar",
-                "reference": "afc022a3a2f8934c321d8f1ab3b36a0d716254cd",
-                "shasum": "bd10e7999bbe55165eab57cf3f08af2c972a8338"
+                "url": "https://composer.cubedesigners.com/dist/cubist/net/cubist-net-dev-master-b52505.tar",
+                "reference": "c7e86c950bac79f1f8f05627c120cdabd77c572a",
+                "shasum": "dd64e294afe5c54b0e9fbc5fde179918f756e64d"
             },
             "require": {
                 "cubist/util": "dev-master",
@@ -98,7 +98,7 @@
                 }
             ],
             "description": "net cubist composer package",
-            "time": "2023-01-27T07:49:39+00:00"
+            "time": "2023-01-27T14:43:25+00:00"
         },
         {
             "name": "dflydev/dot-access-data",
index 60cb1ab0913c8d5b16d7927573e9069a3e2bfa33..1791114169b8846fdd3725a737646461da0eef4e 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace Cubist\Util\CommandLine;
 
+use Cubist\Net\Transfer\IServer;
 use Cubist\Util\CommandLine;
 
 class CloneProgram extends CommandLine
@@ -30,6 +31,12 @@ class CloneProgram extends CommandLine
      */
     protected $_prog;
 
+
+    /**
+     * @var string
+     */
+    protected $_basePath = '';
+
     /**
      * @var array
      */
@@ -100,8 +107,43 @@ class CloneProgram extends CommandLine
         return $this;
     }
 
+    /**
+     * @return string
+     */
+    public function getBasePath(): string
+    {
+        return $this->_basePath;
+    }
+
+    /**
+     * @param string $basePath
+     */
+    public function setBasePath(string $basePath): void
+    {
+        $this->_basePath = $basePath;
+    }
+
+    public function getFinalDest()
+    {
+        $base = rtrim($this->getBasePath(), '/');
+        $res = '';
+        if ($base) {
+            $res .= $base . '/';
+            $res .= ltrim($this->getDest() . '/');
+        } else {
+            $res .= $this->getDest();
+        }
+        return $res;
+    }
+
     public function setCloneArg($name, $value = null)
     {
         $this->_cloneArgs[] = [$name, $value];
     }
+
+
+    public function setServer(IServer $server)
+    {
+        $this->setBasePath($server->getBasePath());
+    }
 }
\ No newline at end of file
index 167b10b4b8509428308388697a19d53552cfad94..a9fffb26bd8564cbcd9280f9b477ab5cd8ce8e24 100644 (file)
@@ -113,8 +113,10 @@ class CloneUserpassProgram extends CloneProgram
         $this->_host = $host;
     }
 
+
     public function setServer(IServer $server)
     {
+        parent::setServer($server);
         $this->setProtocol($server->getProtocol());
         $this->setHost($server->getHost());
         $this->setPort($server->getPort());