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

Breadcrumb

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

function ContainerBuilder::inVendors

3 calls to ContainerBuilder::inVendors()
ContainerBuilder::addResource in vendor/symfony/dependency-injection/ContainerBuilder.php
ContainerBuilder::fileExists in vendor/symfony/dependency-injection/ContainerBuilder.php
Checks whether the requested file or directory exists and registers the result for resource tracking.
ContainerBuilder::getReflectionClass in vendor/symfony/dependency-injection/ContainerBuilder.php
Retrieves the requested reflection class and registers it for resource tracking.

File

vendor/symfony/dependency-injection/ContainerBuilder.php, line 1751

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

private function inVendors(string $path) : bool {
    $path = is_file($path) ? \dirname($path) : $path;
    if (isset($this->pathsInVendor[$path])) {
        return $this->pathsInVendor[$path];
    }
    $this->vendors ??= (new ComposerResource())->getVendors();
    $path = realpath($path) ?: $path;
    if (isset($this->pathsInVendor[$path])) {
        return $this->pathsInVendor[$path];
    }
    foreach ($this->vendors as $vendor) {
        if (\in_array($path[\strlen($vendor)] ?? '', [
            '/',
            \DIRECTORY_SEPARATOR,
        ], true) && str_starts_with($path, $vendor)) {
            $this->pathsInVendor[$vendor . \DIRECTORY_SEPARATOR . 'composer'] = false;
            $this->addResource(new FileResource($vendor . \DIRECTORY_SEPARATOR . 'composer' . \DIRECTORY_SEPARATOR . 'installed.json'));
            $this->pathsInVendor[$vendor . \DIRECTORY_SEPARATOR . 'composer'] = true;
            return $this->pathsInVendor[$path] = true;
        }
    }
    return $this->pathsInVendor[$path] = false;
}

API Navigation

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