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

  • ExtensionGuesser
  • FileBinaryMimeTypeGuesser
  • FileinfoMimeTypeGuesser
  • MimeTypeExtensionGuesser
  • MimeTypeGuesser

Interfaces

  • ExtensionGuesserInterface
  • MimeTypeGuesserInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class FileBinaryMimeTypeGuesser

Guesses the mime type with the binary "file" (only available on *nix).

Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser implements Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface
Namespace: Symfony\Component\HttpFoundation\File\MimeType
Author: Bernhard Schussek bschussek@gmail.com
Located at File/MimeType/FileBinaryMimeTypeGuesser.php
Methods summary
public
# __construct( string $cmd = 'file -b --mime %s 2>/dev/null' )

Constructor.

Constructor.

The $cmd pattern must contain a "%s" string that will be replaced with the file name to guess.

The command output must start with the mime type of the file.

Parameters

$cmd
The command to run to get the mime type of a file
public static boolean
# isSupported( )

Returns whether this guesser is supported on the current OS.

Returns whether this guesser is supported on the current OS.

Returns

boolean
public string
# guess( string $path )

Guesses the mime type of the file with the given path.

Guesses the mime type of the file with the given path.

Parameters

$path
The path to the file

Returns

string
The mime type or NULL, if none could be guessed

Throws

Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException
If the file does not exist
Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException
If the file could not be read

Implementation of

Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface::guess()
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen