public function File::__construct

Constructs a new file from the given path.

@api

Parameters

string $path The path to the file:

Boolean $checkPath Whether to check the path or not:

Throws

FileNotFoundException If the given path is not a file

1 call to File::__construct()
UploadedFile::__construct in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php
Accepts the information of the uploaded file as provided by the PHP global $_FILES.
1 method overrides File::__construct()
UploadedFile::__construct in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/UploadedFile.php
Accepts the information of the uploaded file as provided by the PHP global $_FILES.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/File/File.php, line 38

Class

File
A file in the file system.

Namespace

Symfony\Component\HttpFoundation\File

Code

public function __construct($path, $checkPath = true) {
  if ($checkPath && !is_file($path)) {
    throw new FileNotFoundException($path);
  }
  parent::__construct($path);
}