PHP Class Magic

This method is slower than determining the type by file suffix but on the other hand reduces the risk of fail positives during the test. The magic file consists of ASCII characters defining the magic numbers for different file types. Each row has 4 to 5 columns, empty and commented lines (those starting with a hash character) are ignored. Columns are described below. o 1 -- byte number to begin checking from. ">" indicates a dependency upon the previous non-">" line o 2 -- type of data to match. Can be one of following - byte (single character) - short (machine-order 16-bit integer) - long (machine-order 32-bit integer) - string (arbitrary-length string) - date (long integer date (seconds since Unix epoch/1970)) - beshort (big-endian 16-bit integer) - belong (big-endian 32-bit integer) - bedate (big-endian 32-bit integer date) - leshort (little-endian 16-bit integer) - lelong (little-endian 32-bit integer) - ledate (little-endian 32-bit integer date) o 3 -- contents of data to match o 4 -- file description/MIME type if matched o 5 -- optional MIME encoding if matched and if above was a MIME type
Author: Sven Vollbehr ([email protected])
Mostrar archivo Open project: bcosca/fatfree-core Class Usage Examples

Public Methods

Method Description
__get ( $key ) : mixed Alias for offsetget()
__isset ( $key ) : mixed Alias for offsetexists()
__set ( $key, $val ) : mixed Alias for offsetset()
__unset ( $key ) : null Alias for offsetunset()
clear ( $key ) : null Unset key
exists ( $key ) : boolean Return TRUE if key is not empty
get ( $key ) : mixed Retrieve contents of key
offsetexists ( $key ) : mixed Convenience method for checking property value
offsetget ( $key ) : mixed Convenience method for retrieving property value
offsetset ( $key, $val ) : mixed Convenience method for assigning property value
offsetunset ( $key ) : null Convenience method for removing property value
set ( $key, $val ) : mixed Bind value to key

Method Details

__get() public method

Alias for offsetget()
public __get ( $key ) : mixed
$key string
return mixed

__isset() public method

Alias for offsetexists()
public __isset ( $key ) : mixed
$key string
return mixed

__set() public method

Alias for offsetset()
public __set ( $key, $val ) : mixed
$key string
$val scalar
return mixed

__unset() public method

Alias for offsetunset()
public __unset ( $key ) : null
$key string
return null

clear() abstract public method

Unset key
abstract public clear ( $key ) : null
$key string
return null

exists() abstract public method

Return TRUE if key is not empty
abstract public exists ( $key ) : boolean
$key string
return boolean

get() abstract public method

Retrieve contents of key
abstract public get ( $key ) : mixed
$key string
return mixed

offsetexists() public method

Convenience method for checking property value
public offsetexists ( $key ) : mixed
$key string
return mixed

offsetget() public method

Convenience method for retrieving property value
public offsetget ( $key ) : mixed
$key string
return mixed

offsetset() public method

Convenience method for assigning property value
public offsetset ( $key, $val ) : mixed
$key string
$val scalar
return mixed

offsetunset() public method

Convenience method for removing property value
public offsetunset ( $key ) : null
$key string
return null

set() abstract public method

Bind value to key
abstract public set ( $key, $val ) : mixed
$key string
$val mixed
return mixed