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

Breadcrumb

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

function AutoloadGenerator::getPathCode

Return value

string

3 calls to AutoloadGenerator::getPathCode()
AutoloadGenerator::dump in vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php
AutoloadGenerator::getIncludeFilesFile in vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php
AutoloadGenerator::getIncludePathsFile in vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php

File

vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php, line 744

Class

AutoloadGenerator
@author Igor Wiedler <igor@wiedler.ch> @author Jordi Boggiano <j.boggiano@seld.be>

Namespace

Composer\Autoload

Code

protected function getPathCode(Filesystem $filesystem, string $basePath, string $vendorPath, string $path) {
    if (!$filesystem->isAbsolutePath($path)) {
        $path = $basePath . '/' . $path;
    }
    $path = $filesystem->normalizePath($path);
    $baseDir = '';
    if (strpos($path . '/', $vendorPath . '/') === 0) {
        $path = (string) substr($path, strlen($vendorPath));
        $baseDir = '$vendorDir . ';
    }
    else {
        $path = $filesystem->normalizePath($filesystem->findShortestPath($basePath, $path, true));
        if (!$filesystem->isAbsolutePath($path)) {
            $baseDir = '$baseDir . ';
            $path = '/' . $path;
        }
    }
    if (strpos($path, '.phar') !== false) {
        $baseDir = "'phar://' . " . $baseDir;
    }
    return $baseDir . var_export($path, true);
}

API Navigation

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