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\FilesystemCode
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;
}