Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GitDownloader.php

function GitDownloader::normalizePath

10 calls to GitDownloader::normalizePath()
GitDownloader::cleanChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::discardChanges in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@phpstan-return PromiseInterface<void|null>
GitDownloader::doInstall in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::doUpdate in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc
GitDownloader::getCommitLogs in vendor/composer/composer/src/Composer/Downloader/GitDownloader.php
@inheritDoc

... See full list

File

vendor/composer/composer/src/Composer/Downloader/GitDownloader.php, line 595

Class

GitDownloader
@author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Downloader

Code

protected function normalizePath(string $path) : string {
    if (Platform::isWindows() && strlen($path) > 0) {
        $basePath = $path;
        $removed = [];
        while (!is_dir($basePath) && $basePath !== '\\') {
            array_unshift($removed, basename($basePath));
            $basePath = dirname($basePath);
        }
        if ($basePath === '\\') {
            return $path;
        }
        $path = rtrim(realpath($basePath) . '/' . implode('/', $removed), '/');
    }
    return $path;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal