Open Journal Systems  3.3.0
Symfony\Component\HttpFoundation\File\File Class Reference
Inheritance diagram for Symfony\Component\HttpFoundation\File\File:
Symfony\Component\HttpFoundation\File\Stream Symfony\Component\HttpFoundation\File\UploadedFile Symfony\Component\HttpFoundation\Tests\File\FakeFile

Public Member Functions

 __construct ($path, $checkPath=true)
 
 __construct (string $path, bool $checkPath=true)
 
 getMimeType ()
 
 getMimeType ()
 
 guessExtension ()
 
 guessExtension ()
 
 move ($directory, $name=null)
 
 move ($directory, $name=null)
 

Protected Member Functions

 getName ($name)
 
 getName ($name)
 
 getTargetFile ($directory, $name=null)
 
 getTargetFile ($directory, $name=null)
 

Detailed Description

A file in the file system.

Author
Bernhard Schussek bschu.nosp@m.ssek.nosp@m.@gmai.nosp@m.l.co.nosp@m.m

Definition at line 24 of file lib/vendor/symfony/http-foundation/File/File.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

Symfony\Component\HttpFoundation\File\File::__construct (   $path,
  $checkPath = true 
)

Constructs a new file from the given path.

Parameters
string$pathThe path to the file
bool$checkPathWhether to check the path or not
Exceptions
FileNotFoundExceptionIf the given path is not a file

Reimplemented in Symfony\Component\HttpFoundation\Tests\File\FakeFile.

Definition at line 34 of file lib/vendor/symfony/http-foundation/File/File.php.

◆ __construct() [2/2]

Symfony\Component\HttpFoundation\File\File::__construct ( string  $path,
bool  $checkPath = true 
)

Constructs a new file from the given path.

Parameters
string$pathThe path to the file
bool$checkPathWhether to check the path or not
Exceptions
FileNotFoundExceptionIf the given path is not a file

Definition at line 33 of file vendor/symfony/http-foundation/File/File.php.

Member Function Documentation

◆ getMimeType() [1/2]

Symfony\Component\HttpFoundation\File\File::getMimeType ( )

Returns the mime type of the file.

The mime type is guessed using a MimeTypeGuesserInterface instance, which uses finfo_file() then the "file" system binary, depending on which of those are available.

Returns
string|null The guessed mime type (e.g. "application/pdf")
See also
MimeTypes

Definition at line 71 of file vendor/symfony/http-foundation/File/File.php.

References Symfony\Component\Mime\MimeTypes\getDefault().

◆ getMimeType() [2/2]

Symfony\Component\HttpFoundation\File\File::getMimeType ( )

Returns the mime type of the file.

The mime type is guessed using a MimeTypeGuesser instance, which uses finfo(), mime_content_type() and the system binary "file" (in this order), depending on which of those are available.

Returns
string|null The guessed mime type (e.g. "application/pdf")
See also
MimeTypeGuesser

Definition at line 75 of file lib/vendor/symfony/http-foundation/File/File.php.

References Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser\getInstance().

Referenced by Symfony\Component\HttpFoundation\File\File\guessExtension().

◆ getName() [1/2]

Symfony\Component\HttpFoundation\File\File::getName (   $name)
protected

Returns locale independent base name of the given path.

Parameters
string$nameThe new file name
Returns
string

Definition at line 127 of file vendor/symfony/http-foundation/File/File.php.

◆ getName() [2/2]

Symfony\Component\HttpFoundation\File\File::getName (   $name)
protected

Returns locale independent base name of the given path.

Parameters
string$nameThe new file name
Returns
string containing

Definition at line 128 of file lib/vendor/symfony/http-foundation/File/File.php.

Referenced by Symfony\Component\HttpFoundation\File\UploadedFile\__construct(), and Symfony\Component\HttpFoundation\File\File\getTargetFile().

◆ getTargetFile() [1/2]

Symfony\Component\HttpFoundation\File\File::getTargetFile (   $directory,
  $name = null 
)
protected

◆ getTargetFile() [2/2]

Symfony\Component\HttpFoundation\File\File::getTargetFile (   $directory,
  $name = null 
)
protected

◆ guessExtension() [1/2]

Symfony\Component\HttpFoundation\File\File::guessExtension ( )

Returns the extension based on the mime type.

If the mime type is unknown, returns null.

This method uses the mime type as guessed by getMimeType() to guess the file extension.

Returns
string|null The guessed extension or null if it cannot be guessed
See also
MimeTypes
getMimeType()

Definition at line 55 of file vendor/symfony/http-foundation/File/File.php.

References Symfony\Component\Mime\MimeTypes\getDefault(), and Symfony\Component\HttpFoundation\File\File\getMimeType().

◆ guessExtension() [2/2]

Symfony\Component\HttpFoundation\File\File::guessExtension ( )

Returns the extension based on the mime type.

If the mime type is unknown, returns null.

This method uses the mime type as guessed by getMimeType() to guess the file extension.

Returns
string|null The guessed extension or null if it cannot be guessed
See also
ExtensionGuesser
getMimeType()

Definition at line 56 of file lib/vendor/symfony/http-foundation/File/File.php.

References Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser\getInstance(), and Symfony\Component\HttpFoundation\File\File\getMimeType().

◆ move() [1/2]

Symfony\Component\HttpFoundation\File\File::move (   $directory,
  $name = null 
)

Moves the file to a new location.

Parameters
string$directoryThe destination folder
string$nameThe new file name
Returns
self A File object representing the new file
Exceptions
FileExceptionif the target file could not be created

Reimplemented in Symfony\Component\HttpFoundation\File\UploadedFile, and Symfony\Component\HttpFoundation\File\UploadedFile.

Definition at line 86 of file vendor/symfony/http-foundation/File/File.php.

References Symfony\Component\HttpFoundation\File\File\getTargetFile().

◆ move() [2/2]

Symfony\Component\HttpFoundation\File\File::move (   $directory,
  $name = null 
)

Moves the file to a new location.

Parameters
string$directoryThe destination folder
string$nameThe new file name
Returns
self A File object representing the new file
Exceptions
FileExceptionif the target file could not be created

Reimplemented in Symfony\Component\HttpFoundation\File\UploadedFile, and Symfony\Component\HttpFoundation\File\UploadedFile.

Definition at line 92 of file lib/vendor/symfony/http-foundation/File/File.php.

References Symfony\Component\HttpFoundation\File\File\getTargetFile().


The documentation for this class was generated from the following file: