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

Breadcrumb

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

function Filesystem::trimTrailingSlash

Remove trailing slashes if present to avoid issues with symlinks

And other possible unforeseen disasters, see https://github.com/composer/composer/pull/9422

Return value

string

5 calls to Filesystem::trimTrailingSlash()
FileDownloader::getLocalChanges in vendor/composer/composer/src/Composer/Downloader/FileDownloader.php
@inheritDoc
PathDownloader::download in vendor/composer/composer/src/Composer/Downloader/PathDownloader.php
@inheritDoc
PathDownloader::getVcsReference in vendor/composer/composer/src/Composer/Downloader/PathDownloader.php
@inheritDoc
PathDownloader::install in vendor/composer/composer/src/Composer/Downloader/PathDownloader.php
@inheritDoc
PathDownloader::remove in vendor/composer/composer/src/Composer/Downloader/PathDownloader.php
@inheritDoc

File

vendor/composer/composer/src/Composer/Util/Filesystem.php, line 647

Class

Filesystem
@author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>

Namespace

Composer\Util

Code

public static function trimTrailingSlash(string $path) {
    if (!Preg::isMatch('{^[/\\\\]+$}', $path)) {
        $path = rtrim($path, '/\\');
    }
    return $path;
}

API Navigation

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