MIME::__construct PHP Method

__construct() public method

public __construct ( $mime_cache = '/usr/share/mime/mime.cache' )
    public function __construct($mime_cache = '/usr/share/mime/mime.cache')
    {
        if (!is_readable($mime_cache)) {
            throw new Exception('unable to read ' . $mime_cache);
        }
        $this->cache = file_get_contents($mime_cache);
        $this->version = sprintf('%d.%d', $this->uint16_at(0), $this->uint16_at(2));
        if ($this->version == '1.0') {
            $this->literal_size = 8;
            $this->glob_size = 8;
        } else {
            if ($this->version == '1.1') {
                $this->literal_size = 12;
                $this->glob_size = 12;
            } else {
                throw new Exception('unsupported mime.cache version ' . $this->version);
            }
        }
    }