diff vendor/consolidation/site-process/src/Factory/SshTransportFactory.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vendor/consolidation/site-process/src/Factory/SshTransportFactory.php	Thu May 09 15:34:47 2019 +0100
@@ -0,0 +1,30 @@
+<?php
+
+namespace Consolidation\SiteProcess\Factory;
+
+use Consolidation\SiteAlias\SiteAliasInterface;
+use Consolidation\SiteProcess\Transport\SshTransport;
+use Consolidation\Config\ConfigInterface;
+
+/**
+ * SshTransportFactory will create an SshTransport for applicable site aliases.
+ */
+class SshTransportFactory implements TransportFactoryInterface
+{
+    /**
+     * @inheritdoc
+     */
+    public function check(SiteAliasInterface $siteAlias)
+    {
+        // TODO: deprecate and eventually remove 'isRemote()', and move the logic here.
+        return $siteAlias->isRemote();
+    }
+
+    /**
+     * @inheritdoc
+     */
+    public function create(SiteAliasInterface $siteAlias)
+    {
+        return new SshTransport($siteAlias);
+    }
+}