ICanBoogie
  • Documentation
  • API Reference
  • HTTP v2.5.0
Namespaces
  • ICanBoogie
    • Exception
    • HTTP
      • Headers
      • Request
      • RequestDispatcher
Classes
  • CallableDispatcher
  • File
  • FileInfo
  • FileList
  • FileResponse
  • Headers
  • RedirectResponse
  • Request
  • RequestDispatcher
  • RequestRange
  • Response
  • Status
  • WeightedDispatcher
Interfaces
  • Dispatcher
  • Exception
  • SecurityError
Exceptions
  • AuthenticationRequired
  • ClientError
  • DispatcherNotDefined
  • ForceRedirect
  • MethodNotSupported
  • NotFound
  • PermissionRequired
  • ServerError
  • ServiceUnavailable
  • StatusCodeNotValid

Class FileInfo

File information.

Namespace: ICanBoogie\HTTP
Located at FileInfo.php

Methods summary

public static resolve_type( string $pathname, string & $extension = null ) : string

Resolves the MIME type of a file.

Resolves the MIME type of a file.

Parameters

$pathname
Pathname to the file.
$extension

The variable passed by reference receives the extension of the file.

Returns

string

The MIME type of the file, or application/octet-stream if it could not be determined.

Properties summary

public static $types : array
[

    '.doc'  => 'application/msword',
    '.docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
    '.gif'  => 'image/gif',
    '.jpg'  => 'image/jpeg',
    '.jpeg' => 'image/jpeg',
    '.js'   => 'application/javascript',
    '.json' => 'application/json',
    '.mp3'  => 'audio/mpeg',
    '.odt'  => 'application/vnd.oasis.opendocument.text',
    '.pdf'  => 'application/pdf',
    '.php'  => 'application/x-php',
    '.png'  => 'image/png',
    '.psd'  => 'application/psd',
    '.rar'  => 'application/rar',
    '.txt'  => 'text/plain',
    '.zip'  => 'application/zip',
    '.xls'  => 'application/vnd.ms-excel',
    '.xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'

]
public static $forced_types : array
[

    '.js',
    '.json',
    '.php',
    '.txt'

]
public static $types_alias : array
[

    'text/x-php' => 'application/x-php'

]
HTTP v2.5.0 – Check on GitHub – API documentation generated by ApiGen