ICanBoogie
  • Documentation
  • API Reference
  • HTTP 3.0.x
Namespaces
  • ICanBoogie
    • Exception
    • HTTP
      • Headers
      • Request
      • RequestDispatcher
Classes
  • CallableDispatcher
  • DispatcherProvider
  • File
  • FileInfo
  • FileList
  • FileResponse
  • Headers
  • ProvideDispatcher
  • RedirectResponse
  • Request
  • RequestDispatcher
  • RequestOptionsMapper
  • RequestRange
  • Response
  • Status
  • WeightedDispatcher
Interfaces
  • Dispatcher
  • Exception
  • FileOptions
  • RequestMethods
  • RequestOptions
  • ResponseStatus
  • SecurityError
Exceptions
  • AuthenticationRequired
  • ClientError
  • DispatcherNotDefined
  • DispatcherProviderNotDefined
  • 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.

Constants summary

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']
FORCED_TYPES : array
['.js','.json','.php','.txt']
TYPES_ALIAS : array
['text/x-php'=>'application/x-php']
HTTP 3.0.x – Check on GitHub – API documentation generated by ApiGen