Return a list of all application mime types.

@return array
510311
public static function getApplicationList() {
        if (self::$_application) {
            return self::$_application;
        }

        self::$_application = self::_getList('application');

        return self::$_application;
    }
664099
public static function getTypes() {
        return array(
            self::TYPE_CHARACTER,
            self::TYPE_LOGICAL,
            self::TYPE_DATE ,
            self::TYPE_NUMERIC,
            self::TYPE_MEMO,
        );
    }
609832
public function getMediaType()
    {
        $mime = $this->getMime();

        if ($mime == 'file') {
            return $mime;
        }

        foreach ($this->package->config('mime.media') as $mediaType => $mimes) {
            if (in_array($mime, $mimes)) {
                return $mediaType;
            }
        }

        return 'dir';
    }
1218437
protected function getMimeMappings()
    {
        $sCacheKey = 'mimes';
        $aCache    = $this->getCache($sCacheKey);

        if ($aCache) {
            return $aCache;
        }

        // --------------------------------------------------------------------------

        //  Try to work it out using Nail's mapping
        if (file_exists(NAILS_APP_PATH . 'application/config/mimes.php')) {
            require NAILS_APP_PATH . 'application/config/mimes.php';
        } else {
            require NAILS_COMMON_PATH . 'config/mimes.php';
        }

        // --------------------------------------------------------------------------

        //  Make sure we at least have an empty array
        if (!isset($mimes)) {
            $mimes = [];
        }

        // --------------------------------------------------------------------------

        $this->setCache($sCacheKey, $mimes);

        // --------------------------------------------------------------------------

        return $mimes;
    }
776499
private static function getMines()
    {
        $mines = self::getCache('all_ext_mine');
        if (empty($mines)) {
            $content = file_get_contents('http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types');
            preg_match_all('#^([^\s]{2,}?)\s+(.+?)$#ism', $content, $matches, PREG_SET_ORDER);
            foreach ($matches as $match) foreach (explode(" ", $match[2]) as $ext) $mines[$ext] = $match[1];
            self::setCache('all_ext_mine', $mines);
        }
        return $mines;
    }
918913
public function mimeTypes($mimes)
    {
        // Archives
        $mimes['zip'] = 'application/zip';
        $mimes['gz'] = 'application/x-gzip';

        // Images
        $mimes['ico'] = 'image/x-icon';

        // Video
        $mimes['webm'] = 'video/webm';
        $mimes['mp4'] = 'video/mp4';
        $mimes['ogg'] = 'video/ogg';

        // MS Office
        $mimes['doc'] = 'application/msword';
        $mimes['pot|pps|ppt'] = 'application/vnd.ms-powerpoint';
        $mimes['wri'] = 'application/vnd.ms-write';
        $mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel';
        $mimes['mdb'] = 'application/vnd.ms-access';
        $mimes['mpp'] = 'application/vnd.ms-project';
        $mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
        $mimes['docm'] = 'application/vnd.ms-word.document.macroEnabled.12';
        $mimes['dotx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.template';
        $mimes['dotm'] = 'application/vnd.ms-word.template.macroEnabled.12';
        $mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
        $mimes['xlsm'] = 'application/vnd.ms-excel.sheet.macroEnabled.12';
        $mimes['xlsb'] = 'application/vnd.ms-excel.sheet.binary.macroEnabled.12';
        $mimes['xltx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.template';
        $mimes['xltm'] = 'application/vnd.ms-excel.template.macroEnabled.12';
        $mimes['xlam'] = 'application/vnd.ms-excel.addin.macroEnabled.12';
        $mimes['pptx'] = 'application/vnd.openxmlformats-officedocument.presentationml.presentation';
        $mimes['pptm'] = 'application/vnd.ms-powerpoint.presentation.macroEnabled.12';
        $mimes['ppsx'] = 'application/vnd.openxmlformats-officedocument.presentationml.slideshow';
        $mimes['ppsm'] = 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12';
        $mimes['potx'] = 'application/vnd.openxmlformats-officedocument.presentationml.template';
        $mimes['potm'] = 'application/vnd.ms-powerpoint.template.macroEnabled.12';
        $mimes['ppam'] = 'application/vnd.ms-powerpoint.addin.macroEnabled.12';
        $mimes['sldx'] = 'application/vnd.openxmlformats-officedocument.presentationml.slide';
        $mimes['sldm'] = 'application/vnd.ms-powerpoint.slide.macroEnabled.12';
        $mimes['onetoc|onetoc2|onetmp|onepkg'] = 'application/onenote';

        // Drawings
        $mimes['dwg']  = 'application/dwg';

        return $mimes;
    }
1341095
public function getMime()
    {
        if ($this->metadata->isFile()) {
            $mimes = $this->package->config('mime.types');
            foreach ($mimes as $mime => $mimeValues) {
                $key = collect($mimeValues)->search(function ($mimeValue) {
                    return preg_match($mimeValue, $this->metadata->getMimeType());
                });

                if ($key !== false) {
                    return $mime;
                }
            }

            return 'file';
        }

        return 'dir';
    }
1205556
public function GetList() {
        $namespacePrefix = "\\Applications\\" .
                "APP_NAME" .
                "\\Resources\\Common\\";
        $resourceNamespace = $this->GetResourceNamespace($namespacePrefix, $this->GroupValue);
        $resourceFile = new $resourceNamespace();
        return $resourceFile->GetList();
    }
1180997
public function mime()
    {
        if (!$this->exists()) {
            return false;
        }
        if (class_exists('finfo')) {
            $finfo = new finfo(FILEINFO_MIME);
            $type = $finfo->file($this->pwd());
            if (!$type) {
                return false;
            }
            list($type) = explode(';', $type);

            return $type;
        }
        if (function_exists('mime_content_type')) {
            return mime_content_type($this->pwd());
        }

        return false;
    }
468383
public function listInvalidProperties()
    {
        $invalidProperties = [];

        $allowedValues = $this->getMimeTypeAllowableValues();
        if (!is_null($this->container['mime_type']) && !in_array($this->container['mime_type'], $allowedValues, true)) {
            $invalidProperties[] = sprintf(
                "invalid value for 'mime_type', must be one of '%s'",
                implode("', '", $allowedValues)
            );
        }

        return $invalidProperties;
    }
338876
public function getMimeType()
    {
        if (function_exists('finfo_open')) {
            $finfo = finfo_open(FILEINFO_MIME);
            if (!$finfo) {
                throw new \RuntimeException('Failed to open finfo');
            }

            $actualInfo = @finfo_file($finfo, $this->getPathname());
            if (false === $actualInfo) {
                throw new \RuntimeException('Failed to read file info via finfo');
            }
            $mime = strtolower($actualInfo);
            finfo_close($finfo);

            if (!preg_match(
                '/^([a-z0-9]+\/[a-z0-9\-\.]+);\s+charset=(.*)$/', $mime, $matches
            )) {
                throw new \LogicException(
                    'An error parsing the MIME type "'.$mime.'".'
                );
            }

            return $matches[1];
        } elseif (function_exists('mime_content_type')) {
            return mime_content_type($this->getPathname());
        }

        throw new \RuntimeException(
            'The finfo extension or mime_content_type function are needed to '
            .'determine the Mime Type for this file.'
        );
    }
261739
protected function getApplications() {
        if (!$this->_applications) {
            $this->_applications = new ApplicationList($this->version, $this->solution['sid']);
        }

        return $this->_applications;
    }
642895
public function getMimetypeFromExtension($extension)
    {
        static $mimetypes = [
            '7z' => 'application/x-7z-compressed',
            'aac' => 'audio/x-aac',
            'ai' => 'application/postscript',
            'aif' => 'audio/x-aiff',
            'asc' => 'text/plain',
            'asf' => 'video/x-ms-asf',
            'atom' => 'application/atom+xml',
            'avi' => 'video/x-msvideo',
            'bmp' => 'image/bmp',
            'bz2' => 'application/x-bzip2',
            'cer' => 'application/pkix-cert',
            'crl' => 'application/pkix-crl',
            'crt' => 'application/x-x509-ca-cert',
            'css' => 'text/css',
            'csv' => 'text/csv',
            'cu' => 'application/cu-seeme',
            'deb' => 'application/x-debian-package',
            'doc' => 'application/msword',
            'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
            'dvi' => 'application/x-dvi',
            'eot' => 'application/vnd.ms-fontobject',
            'eps' => 'application/postscript',
            'epub' => 'application/epub+zip',
            'etx' => 'text/x-setext',
            'flac' => 'audio/flac',
            'flv' => 'video/x-flv',
            'gif' => 'image/gif',
            'gz' => 'application/gzip',
            'htm' => 'text/html',
            'html' => 'text/html',
            'ico' => 'image/x-icon',
            'ics' => 'text/calendar',
            'ini' => 'text/plain',
            'iso' => 'application/x-iso9660-image',
            'jar' => 'application/java-archive',
            'jpe' => 'image/jpeg',
            'jpeg' => 'image/jpeg',
            'jpg' => 'image/jpeg',
            'js' => 'text/javascript',
            'json' => 'application/json',
            'latex' => 'application/x-latex',
            'log' => 'text/plain',
            'm4a' => 'audio/mp4',
            'm4v' => 'video/mp4',
            'mid' => 'audio/midi',
            'midi' => 'audio/midi',
            'mov' => 'video/quicktime',
            'mp3' => 'audio/mpeg',
            'mp4' => 'video/mp4',
            'mp4a' => 'audio/mp4',
            'mp4v' => 'video/mp4',
            'mpe' => 'video/mpeg',
            'mpeg' => 'video/mpeg',
            'mpg' => 'video/mpeg',
            'mpg4' => 'video/mp4',
            'oga' => 'audio/ogg',
            'ogg' => 'audio/ogg',
            'ogv' => 'video/ogg',
            'ogx' => 'application/ogg',
            'pbm' => 'image/x-portable-bitmap',
            'pdf' => 'application/pdf',
            'pgm' => 'image/x-portable-graymap',
            'png' => 'image/png',
            'pnm' => 'image/x-portable-anymap',
            'ppm' => 'image/x-portable-pixmap',
            'ppt' => 'application/vnd.ms-powerpoint',
            'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
            'ps' => 'application/postscript',
            'qt' => 'video/quicktime',
            'rar' => 'application/x-rar-compressed',
            'ras' => 'image/x-cmu-raster',
            'rss' => 'application/rss+xml',
            'rtf' => 'application/rtf',
            'sgm' => 'text/sgml',
            'sgml' => 'text/sgml',
            'svg' => 'image/svg+xml',
            'swf' => 'application/x-shockwave-flash',
            'tar' => 'application/x-tar',
            'tif' => 'image/tiff',
            'tiff' => 'image/tiff',
            'torrent' => 'application/x-bittorrent',
            'ttf' => 'application/x-font-ttf',
            'txt' => 'text/plain',
            'wav' => 'audio/x-wav',
            'webm' => 'video/webm',
            'wma' => 'audio/x-ms-wma',
            'wmv' => 'video/x-ms-wmv',
            'woff' => 'application/x-font-woff',
            'wsdl' => 'application/wsdl+xml',
            'xbm' => 'image/x-xbitmap',
            'xls' => 'application/vnd.ms-excel',
            'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
            'xml' => 'application/xml',
            'xpm' => 'image/x-xpixmap',
            'xwd' => 'image/x-xwindowdump',
            'yaml' => 'text/yaml',
            'yml' => 'text/yaml',
            'zip' => 'application/zip',

            // Non-Apache standard
            'pkpass' => 'application/vnd.apple.pkpass',
            'msg' => 'application/vnd.ms-outlook',
        ];

        $extension = strtolower($extension);

        return isset($mimetypes[$extension])
            ? $mimetypes[$extension]
            : null;
    }
715379
public function getMimeType($file) {
		$mime_types = [
			'ai'		=> 'application/postscript',
			'aif'		=> 'audio/x-aiff',
			'aiff'		=> 'audio/x-aiff',
			'asf'		=> 'video/x-ms-asf',
			'asx'		=> 'video/x-ms-asf',
			'au'		=> 'audio/basic',
			'avi'		=> 'video/x-msvideo',
			'axs'		=> 'application/olescript',
			'bas'		=> 'text/plain',
			'bin'		=> 'application/octet-stream',
			'bmp'		=> 'image/bmp',
			'c'			=> 'text/plain',
			'cdf'		=> 'application/x-cdf',
			'class'		=> 'application/octet-stream',
			'clp'		=> 'application/x-msclip',
			'crd'		=> 'application/x-mscardfile',
			'css'		=> 'text/css',
			'dcr'		=> 'application/x-director',
			'dir'		=> 'application/x-director',
			'dll'		=> 'application/x-msdownload',
			'dms'		=> 'application/octet-stream',
			'doc'		=> 'application/msword',
			'dot'		=> 'application/msword',
			'dvi'		=> 'application/x-dvi',
			'dxr'		=> 'application/x-director',
			'eps'		=> 'application/postscript',
			'exe'		=> 'application/octet-stream',
			'flr'		=> 'x-world/x-vrml',
			'gif'		=> 'image/gif',
			'gtar'		=> 'application/x-gtar',
			'gz'		=> 'application/x-gzip',
			'h'			=> 'text/plain',
			'hlp'		=> 'application/winhlp',
			'hqx'		=> 'application/mac-binhex40',
			'hta'		=> 'application/hta',
			'htc'		=> 'text/x-component',
			'htm'		=> 'text/html',
			'html'		=> 'text/html',
			'htt'		=> 'text/webviewhtml',
			'ico'		=> 'image/x-icon',
			'iii'		=> 'application/x-iphone',
			'jpe'		=> 'image/jpeg',
			'jpeg'		=> 'image/jpeg',
			'jpg'		=> 'image/jpeg',
			'js'		=> 'application/x-javascript',
			'latex'		=> 'application/x-latex',
			'lha'		=> 'application/octet-stream',
			'lzh'		=> 'application/octet-stream',
			'm3u'		=> 'audio/x-mpegurl',
			'mdb'		=> 'application/x-msaccess',
			'mid'		=> 'audio/mid',
			'mov'		=> 'video/quicktime',
			'movie'		=> 'video/x-sgi-movie',
			'mp2'		=> 'video/mpeg',
			'mp3'		=> 'audio/mpeg',
			'mpeg'		=> 'video/mpeg',
			'mpg'		=> 'video/mpeg',
			'ms'		=> 'application/x-troff-ms',
			'mvb'		=> 'application/x-msmediaview',
			'pbm'		=> 'image/x-portable-bitmap',
			'pdf'		=> 'application/pdf',
			'pgm'		=> 'image/x-portable-graymap',
			'png'		=> 'image/png',
			'pot'		=> 'application/vnd.ms-powerpoint',
			'pps'		=> 'application/vnd.ms-powerpoint',
			'ppt'		=> 'application/vnd.ms-powerpoint',
			'ps'		=> 'application/postscript',
			'pub'		=> 'application/x-mspublisher',
			'qt'		=> 'video/quicktime',
			'ra'		=> 'audio/x-pn-realaudio',
			'ram'		=> 'audio/x-pn-realaudio',
			'rgb'		=> 'image/x-rgb',
			'rmi'		=> 'audio/mid',
			'rtf'		=> 'application/rtf',
			'rtx'		=> 'text/richtext',
			'scd'		=> 'application/x-msschedule',
			'sct'		=> 'text/scriptlet',
			'sh'		=> 'application/x-sh',
			'sit'		=> 'application/x-stuffit',
			'snd'		=> 'audio/basic',
			'spl'		=> 'application/futuresplash',
			'stm'		=> 'text/html',
			'svg'		=> 'image/svg+xml',
			'tar'		=> 'application/x-tar',
			'tcl'		=> 'application/x-tcl',
			'tex'		=> 'application/x-tex',
			'texi'		=> 'application/x-texinfo',
			'texinfo'	=> 'application/x-texinfo',
			'tgz'		=> 'application/x-compressed',
			'tif'		=> 'image/tiff',
			'tiff'		=> 'image/tiff',
			'tsv'		=> 'text/tab-separated-values',
			'txt'		=> 'text/plain',
			'vcf'		=> 'text/x-vcard',
			'vrml'		=> 'x-world/x-vrml',
			'wav'		=> 'audio/x-wav',
			'wcm'		=> 'application/vnd.ms-works',
			'wdb'		=> 'application/vnd.ms-works',
			'wks'		=> 'application/vnd.ms-works',
			'wmf'		=> 'application/x-msmetafile',
			'wps'		=> 'application/vnd.ms-works',
			'wri'		=> 'application/x-mswrite',
			'wrl'		=> 'x-world/x-vrml',
			'wrz'		=> 'x-world/x-vrml',
			'xaf'		=> 'x-world/x-vrml',
			'xbm'		=> 'image/x-xbitmap',
			'xla'		=> 'application/vnd.ms-excel',
			'xlc'		=> 'application/vnd.ms-excel',
			'xlm'		=> 'application/vnd.ms-excel',
			'xls'		=> 'application/vnd.ms-excel',
			'xlt'		=> 'application/vnd.ms-excel',
			'xlw'		=> 'application/vnd.ms-excel',
			'xof'		=> 'x-world/x-vrml',
			'xpm'		=> 'image/x-xpixmap',
			'z'			=> 'application/x-compress',
			'zip'		=> 'application/zip'
		];
		
		$file = pathinfo($file);
		if (isset($file['extension'])) $ext = $file['extension'];
		else $ext = 'unknown';
		if (isset($mime_types[$ext])) return $mime_types[$ext];
		else return 'application/x-'.$ext;
	}
718115
public function check_mime_detection()
    {
        $errors = array();
        $files  = array(
            'program/resources/tinymce/video.png' => 'image/png',
            'program/resources/blank.tiff'        => 'image/tiff',
            'program/resources/blocked.gif'       => 'image/gif',
        );

        foreach ($files as $path => $expected) {
            $mimetype = rcube_mime::file_content_type(INSTALL_PATH . $path, basename($path));
            if ($mimetype != $expected) {
                $errors[] = array($path, $mimetype, $expected);
            }
        }

        return $errors;
    }
106463
public function getMime() {
        switch(strtolower(pathinfo($this->path, PATHINFO_EXTENSION))) {
            case 'json':
                $mime = 'application/json';
                break;
            case 'geojson':
                $mime = 'application/vnd.geo+json';
                break;
            default:
                $mime = @mime_content_type($this->path);
        }
        return $mime;
    }
759085
public function getMIMEType()
    {
        switch ($this->version) {
            case Feed::RSS2 : $mimeType = "application/rss+xml";
                break;
            case Feed::RSS1 : $mimeType = "application/rdf+xml";
                break;
            case Feed::ATOM : $mimeType = "application/atom+xml";
                break;
            default : $mimeType = "text/xml";
        }

        return $mimeType;
    }