X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fconsolidation%2Fsite-alias%2Fsrc%2FAliasRecord.php;fp=vendor%2Fdrush%2Fdrush%2Fsrc%2FSiteAlias%2FAliasRecord.php;h=3fc00d63e0a40cf114ff9bdc510d99044a6d3d48;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=06ce29bc79b6710fa907f50e2e00cc0dd0d4dac2;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/vendor/drush/drush/src/SiteAlias/AliasRecord.php b/vendor/consolidation/site-alias/src/AliasRecord.php similarity index 59% rename from vendor/drush/drush/src/SiteAlias/AliasRecord.php rename to vendor/consolidation/site-alias/src/AliasRecord.php index 06ce29bc7..3fc00d63e 100644 --- a/vendor/drush/drush/src/SiteAlias/AliasRecord.php +++ b/vendor/consolidation/site-alias/src/AliasRecord.php @@ -1,44 +1,17 @@ get('root')); - + $root = $this->get('root'); + if ($this->isLocal()) { + return FsUtils::realpath($root); + } return $root; } /** - * Get the uri + * @inheritdoc */ public function uri() { @@ -131,9 +86,7 @@ class AliasRecord extends Config } /** - * Record the uri - * - * @param string $uri + * @inheritdoc */ public function setUri($uri) { @@ -141,10 +94,7 @@ class AliasRecord extends Config } /** - * Return user@host, or just host if there is no user. Returns - * an empty string if there is no host. - * - * @return string + * @inheritdoc */ public function remoteHostWithUser() { @@ -156,7 +106,7 @@ class AliasRecord extends Config } /** - * Get the remote user + * @inheritdoc */ public function remoteUser() { @@ -164,7 +114,7 @@ class AliasRecord extends Config } /** - * Return true if this alias record has a remote user + * @inheritdoc */ public function hasRemoteUser() { @@ -172,7 +122,7 @@ class AliasRecord extends Config } /** - * Get the remote host + * @inheritdoc */ public function remoteHost() { @@ -180,28 +130,23 @@ class AliasRecord extends Config } /** - * Return true if this alias record has a remote host that is not - * the local host + * @inheritdoc */ public function isRemote() { - return !$this->isLocal(); + return $this->has('host'); } /** - * Return true if this alias record is for the local system + * @inheritdoc */ public function isLocal() { - if ($host = $this->remoteHost()) { - return $host == 'localhost' || $host == '127.0.0.1'; - } - return true; + return !$this->isRemote(); } /** - * Determine whether this alias does not represent any site. An - * alias record must either be remote or have a root. + * @inheritdoc */ public function isNone() { @@ -209,12 +154,11 @@ class AliasRecord extends Config } /** - * Return the 'root' element of this alias if this alias record - * is local. + * @inheritdoc */ public function localRoot() { - if (!$this->isRemote()) { + if ($this->isLocal() && $this->hasRoot()) { return $this->root(); } @@ -222,8 +166,27 @@ class AliasRecord extends Config } /** - * Export the configuration values in this alias record, and reconfigure - * them so that the layout matches that of the global configuration object. + * os returns the OS that this alias record points to. For local alias + * records, PHP_OS will be returned. For remote alias records, the + * value from the `os` element will be returned. If there is no `os` + * element, then the default assumption is that the remote system is Linux. + * + * @return string + * Linux + * WIN* (e.g. WINNT) + * CYGWIN + * MINGW* (e.g. MINGW32) + */ + public function os() + { + if ($this->isLocal()) { + return PHP_OS; + } + return $this->get('os', 'Linux'); + } + + /** + * @inheritdoc */ public function exportConfig() {