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

Breadcrumb

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

function Finder::normalizeDir

Normalizes given directory names by removing trailing slashes.

Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper

1 call to Finder::normalizeDir()
Finder::in in vendor/symfony/finder/Finder.php
Searches files and directories which match defined rules.

File

vendor/symfony/finder/Finder.php, line 838

Class

Finder
Finder allows to build rules to find files and directories.

Namespace

Symfony\Component\Finder

Code

private function normalizeDir(string $dir) : string {
    if ('/' === $dir) {
        return $dir;
    }
    $dir = rtrim($dir, '/' . \DIRECTORY_SEPARATOR);
    if (preg_match('#^(ssh2\\.)?s?ftp://#', $dir)) {
        $dir .= '/';
    }
    return $dir;
}

API Navigation

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