Merge branch '1.8'

main
Jordi Boggiano 5 years ago
commit d3873a0565
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -180,24 +180,21 @@ class PathDownloader extends FileDownloader implements VcsCapableDownloaderInter
} }
/** /**
* Returns true if junctions can be safely used on Windows * Returns true if junctions can be created and safely used on Windows
* *
* A PHP bug makes junction detection fragile, leading to possible data loss * A PHP bug makes junction detection fragile, leading to possible data loss
* when removing a package. See https://bugs.php.net/bug.php?id=77552 * when removing a package. See https://bugs.php.net/bug.php?id=77552
* *
* For safety we require a minimum version of Windows 7, so we can call the * For safety we require a minimum version of Windows 7, so we can call the
* system rmdir which can detect junctions and not delete target content. * system rmdir which will preserve target content if given a junction.
*
* The PHP bug was fixed in 7.2.16 and 7.3.3 (requires at least Windows 7).
* *
* @return bool * @return bool
*/ */
private function safeJunctions() private function safeJunctions()
{ {
// Bug fixed in 7.3.3 and 7.2.16 // We need to call mklink, and rmdir on Windows 7 (version 6.1)
if (PHP_VERSION_ID >= 70303 || (PHP_VERSION_ID >= 70216 && PHP_VERSION_ID < 70300)) {
return true;
}
// Windows 7 is version 6.1
return function_exists('proc_open') && return function_exists('proc_open') &&
(PHP_WINDOWS_VERSION_MAJOR > 6 || (PHP_WINDOWS_VERSION_MAJOR > 6 ||
(PHP_WINDOWS_VERSION_MAJOR === 6 && PHP_WINDOWS_VERSION_MINOR >= 1)); (PHP_WINDOWS_VERSION_MAJOR === 6 && PHP_WINDOWS_VERSION_MINOR >= 1));

@ -124,6 +124,7 @@ abstract class BitbucketDriver extends VcsDriver
$composer = $this->getBaseComposerInformation($identifier); $composer = $this->getBaseComposerInformation($identifier);
if ($composer) {
// specials for bitbucket // specials for bitbucket
if (!isset($composer['support']['source'])) { if (!isset($composer['support']['source'])) {
$label = array_search( $label = array_search(
@ -169,6 +170,7 @@ abstract class BitbucketDriver extends VcsDriver
if (!isset($composer['homepage'])) { if (!isset($composer['homepage'])) {
$composer['homepage'] = empty($this->website) ? $this->homeUrl : $this->website; $composer['homepage'] = empty($this->website) ? $this->homeUrl : $this->website;
} }
}
$this->infoCache[$identifier] = $composer; $this->infoCache[$identifier] = $composer;

@ -152,8 +152,8 @@ class GitHubDriver extends VcsDriver
} }
$composer = $this->getBaseComposerInformation($identifier); $composer = $this->getBaseComposerInformation($identifier);
if ($composer) {
if ($composer) {
// specials for github // specials for github
if (!isset($composer['support']['source'])) { if (!isset($composer['support']['source'])) {
$label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier; $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier;

Loading…
Cancel
Save