Overview

Namespaces

  • Composer
    • Autoload
  • Guzzle
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Mock
    • Stream
  • Mockery
    • Adapter
      • Phpunit
    • CountValidator
    • Exception
    • Generator
      • StringManipulation
        • Pass
    • Loader
    • Matcher
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP
  • Symfony
    • Component
      • EventDispatcher
        • Debug
        • DependencyInjection
        • Tests
          • Debug
          • DependencyInjection
      • HttpFoundation
        • File
          • Exception
          • MimeType
        • Session
          • Attribute
          • Flash
          • Storage
            • Handler
            • Proxy
        • Tests
          • File
            • MimeType
          • Session
            • Attribute
            • Flash
            • Storage
              • Handler
              • Proxy
      • Yaml
        • Exception
        • Tests

Classes

  • File
  • UploadedFile
  • Overview
  • Namespace
  • Class
  • Tree

Class File

A file in the file system.

SplFileInfo
Extended by Symfony\Component\HttpFoundation\File\File

Direct known subclasses

Symfony\Component\HttpFoundation\File\UploadedFile, Symfony\Component\HttpFoundation\Tests\File\FakeFile
Namespace: Symfony\Component\HttpFoundation\File
Author: Bernhard Schussek bschussek@gmail.com
Api
Located at File/File.php
Methods summary
public
# __construct( string $path, boolean $checkPath = true )

Constructs a new file from the given path.

Constructs a new file from the given path.

Parameters

$path
The path to the file
$checkPath
Whether to check the path or not

Throws

Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
If the given path is not a file

Api

Overrides

SplFileInfo::__construct()
public string|null
# guessExtension( )

Returns the extension based on the mime type.

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

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

Api

public string|null
# getMimeType( )

Returns the mime type of the file.

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 (i.e. "application/pdf")

See

Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser

Api

public string
# getExtension( )

Returns the extension of the file.

Returns the extension of the file.

\SplFileInfo::getExtension() is not available before PHP 5.3.6

Returns

string
The extension

Api

Overrides

SplFileInfo::getExtension()
public Symfony\Component\HttpFoundation\File\File
# move( string $directory, string $name = null )

Moves the file to a new location.

Moves the file to a new location.

Parameters

$directory
The destination folder
$name
The new file name

Returns

Symfony\Component\HttpFoundation\File\File
A File object representing the new file

Throws

Symfony\Component\HttpFoundation\File\Exception\FileException
if the target file could not be created

Api

protected
# getTargetFile( $directory, $name = null )
protected string
# getName( string $name )

Returns locale independent base name of the given path.

Returns locale independent base name of the given path.

Parameters

$name
The new file name

Returns

string
containing
Methods inherited from SplFileInfo
__toString(), _bad_state_ex(), getATime(), getBasename(), getCTime(), getFileInfo(), getFilename(), getGroup(), getInode(), getLinkTarget(), getMTime(), getOwner(), getPath(), getPathInfo(), getPathname(), getPerms(), getRealPath(), getSize(), getType(), isDir(), isExecutable(), isFile(), isLink(), isReadable(), isWritable(), openFile(), setFileClass(), setInfoClass()
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen