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

Breadcrumb

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

function File::__construct

Same name in this branch
  1. 11.1.x vendor/phpunit/php-code-coverage/src/Node/File.php \SebastianBergmann\CodeCoverage\Node\File::__construct()
  2. 11.1.x vendor/phpunit/php-code-coverage/src/Report/Xml/File.php \SebastianBergmann\CodeCoverage\Report\Xml\File::__construct()
  3. 11.1.x vendor/phpunit/phpunit/src/TextUI/Configuration/Value/File.php \PHPUnit\TextUI\Configuration\File::__construct()
  4. 11.1.x vendor/symfony/mime/Part/File.php \Symfony\Component\Mime\Part\File::__construct()
  5. 11.1.x vendor/symfony/validator/Constraints/File.php \Symfony\Component\Validator\Constraints\File::__construct()
  6. 11.1.x vendor/squizlabs/php_codesniffer/src/Files/File.php \PHP_CodeSniffer\Files\File::__construct()
  7. 11.1.x core/modules/file/src/Plugin/views/field/File.php \Drupal\file\Plugin\views\field\File::__construct()

Constructs a new file from the given path.

Parameters

string $path The path to the file:

bool $checkPath Whether to check the path or not:

Throws

FileNotFoundException If the given path is not a file

2 calls to File::__construct()
UploadedFile::__construct in vendor/symfony/http-foundation/File/UploadedFile.php
Accepts the information of the uploaded file as provided by the PHP global $_FILES.
UploadedFile::__construct in vendor/symfony/http-foundation/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 vendor/symfony/http-foundation/File/UploadedFile.php
Accepts the information of the uploaded file as provided by the PHP global $_FILES.

File

vendor/symfony/http-foundation/File/File.php, line 33

Class

File
A file in the file system.

Namespace

Symfony\Component\HttpFoundation\File

Code

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

API Navigation

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