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

Breadcrumb

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

function Filesystem::exists

Checks the existence of files or directories.

3 calls to Filesystem::exists()
Filesystem::hardlink in vendor/symfony/filesystem/Filesystem.php
Creates a hard link, or several hard links to a file.
Filesystem::mirror in vendor/symfony/filesystem/Filesystem.php
Mirrors a directory to another.
Filesystem::readlink in vendor/symfony/filesystem/Filesystem.php
Resolves links in paths.

File

vendor/symfony/filesystem/Filesystem.php, line 106

Class

Filesystem
Provides basic utility to manipulate the file system.

Namespace

Symfony\Component\Filesystem

Code

public function exists(string|iterable $files) : bool {
    $maxPathLength = \PHP_MAXPATHLEN - 2;
    foreach ($this->toIterable($files) as $file) {
        if (\strlen($file) > $maxPathLength) {
            throw new IOException(\sprintf('Could not check if file exist because path length exceeds %d characters.', $maxPathLength), 0, null, $file);
        }
        if (!file_exists($file)) {
            return false;
        }
    }
    return true;
}

API Navigation

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