Get all mime types that are supported right now

@param bool $coreHasPrecedence
@return array
162837
public function mimeTypes($coreHasPrecedence = false) {
		if ($coreHasPrecedence) {
			return $this->_mimeTypes += $this->_mimeTypesExt;
		}
		return $this->_mimeTypesExt += $this->_mimeTypes;
	}
39812
protected function get_image_mime_types() {
		$mime_types = get_allowed_mime_types();

		foreach ( $mime_types as $id => $type ) {
			if ( false === strpos( $type, 'image/' ) ) {
				unset( $mime_types[ $id ] );
			}
		}

		/**
		 * Filter image mime types
		 *
		 * @since 0.1.0
		 * @param array $mime_types Image mime types.
		 */
		$mime_types = apply_filters( 'icon_picker_image_mime_types', $mime_types );

		// We need to exclude image/svg*.
		unset( $mime_types['svg'] );

		return $mime_types;
	}
378330
protected function getContentTypesHash()
    {
        $contentTypeHash = [];
        foreach ($this->contentTypeService->loadContentTypeGroups() as $contentTypeGroup) {
            foreach ($this->contentTypeService->loadContentTypes($contentTypeGroup) as $contentType) {
                $contentTypeHash[$contentType->getName()] = $contentType->identifier;
            }
        }
        ksort($contentTypeHash);

        return $contentTypeHash;
    }
94494
public static function typeFromMimetype($mime)
    {
        foreach (static::types() as $type => $mimetypes) {
            if (array_search($mime, $mimetypes) !== false) {
                return $type;
            }
        }
    }
702280
public function possibleAggregateTypesForMimeType($mime)
    {
        $types = [];
        foreach ($this->config['aggregate_types'] as $type => $attributes) {
            if (in_array($mime, $attributes['mime_types'])) {
                $types[] = $type;
            }
        }

        return $types;
    }
628715
function getMimeType(){
		static $mime_types = array(
			"jpg" => "image/jpeg",
			"png" => "image/png",
			"tiff" => "image/tiff",
			"gif" => "image/gif",
			"svg" => "image/svg+xml",
			"bmp" => "image/bmp",

			"doc" => "application/msword",
			"xls" => "application/vnd.ms-excel",
			"ppt" => "application/vnd.ms-powerpoint",
			"xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",

			"docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",

			"odt" => "application/vnd.oasis.opendocument.text",
			"ods" => "application/vnd.oasis.opendocument.spreadsheet",

			"eps" => "application/postscript",
			"ai" => "application/postscript",
			"pdf" => "application/pdf",

			"zip" => "application/zip",

			"mp3" => "audio/mpeg",
		);
		$suffix = strtolower($this->getSuffix());
		if(isset($mime_types[$suffix])){
			return $mime_types[$suffix];
		}
	}
1235298
public function getAcceptMimetypes($includeQuality = false)
    {
        $mimetypes = array();
        $mimetypesWithQuality = preg_split('#\s*,\s*#', $this->getHeader('accept'));
        foreach ($mimetypesWithQuality as $mimetypeWithQuality) {
            $mimetypes[] = ($includeQuality) ? $mimetypeWithQuality : preg_replace('/;.*/', '', $mimetypeWithQuality);
        }
        return $mimetypes;
    }
1215804
public function getMimeType()
    {
        if ($this->exists()) {
            $finfo = new \finfo(FILEINFO_MIME_TYPE | FILEINFO_PRESERVE_ATIME);
            $mime = $finfo->file($this->getRealPath());
            return $mime;
        }
        return null;
    }
237375
private static function get_mime_type($extension) {
		$mime_type = '';
		switch ($extension) {
			case 'htm' :
			case 'html': $mime_type = 'text/html';
			             break;

			case 'css' : $mime_type = 'text/css';
			             break;

			case 'ico' : $mime_type = 'image/x-icon';
			             break;

			case 'js'  : $mime_type = 'text/javascript';
			             break;

			case 'png' : $mime_type = 'image/png';
			             break;

			case 'gif' : $mime_type = 'image/gif';
			             break;

			case 'jpg' :
			case 'jpeg': $mime_type = 'image/jpeg';
			             break;

			case 'pdf' : $mime_type = 'application/pdf';
						 break;

			case 'txt' : $mime_type = 'text/plain';
						 break;

			case 'svg' : $mime_type = 'image/svg+xml';
						 break;

			default    : $mime_type = 'application/octet-stream';
		}

		return $mime_type;
	}
217223
public function getPredecessors($classFilter = null)
    {
        $returnValue = array();

        
    	foreach ($this->getCache()->getAll() as $serial => $instance) {
			
			if (($classFilter == null || $instance instanceof $classFilter)
				&& in_array($this, $instance->getSuccessors())) {
				$returnValue[] = $instance;
				break;
			}
		}
        

        return (array) $returnValue;
    }
771257
protected function _getTypes() {
		$handle = new File(FILE_CACHE . 'mime_types.txt', true, 0770);
		if (!$handle->exists()) {
			# create and fill: ext||type||name||img (array serialized? separated by ||?)
			$MimeTypes = TableRegistry::get('Data.MimeTypes');
			$mimeTypes = $MimeTypes->find('all', ['fields' => ['name', 'ext', 'type', 'MimeTypeImages.name', 'MimeTypeImages.ext'], 'conditions' => ['MimeTypes.active' => 1], 'contain' => ['MimeTypeImages']]);

			$content = [];
			foreach ($mimeTypes as $m) {
				$img = (!empty($m->mime_type_image['ext']) ? $m->mime_type_image['name'] . '.' . $m->mime_type_image['ext'] : '');
				$content[] = [
					'ext' => $m['ext'],
					'name' => $m['name'],
					'type' => $m['type'],
					'img' => $img,
				];
			}
			# add special types? (file not found icon, default fallback icon, generic file ext icon...)

			if (!$handle->write(serialize($content), 'w', true)) {
				throw new Exception('Write error');
			}
		} else {
			$content = $handle->read();
			if ($content === false) {
				return [];
			}
			$content = unserialize($content);
			if ($content === false || !is_array($content)) {
				return [];
			}
		}
		return $content;
	}
62377
public function getMimeType($mime)
    {
        if (isset($this->mimes[$mime]))
        {
            return $this->mimes[$mime];
        }
        else
        {
            return false;
        }
    }
318117
public function type($mimeTypes) {
        $types = array();

        foreach ((array) $mimeTypes as $mimeType) {
            switch ($mimeType) {
                case 'application': $types += MimeType::getApplicationList(); break;
                case 'audio':       $types += MimeType::getAudioList(); break;
                case 'image':       $types += MimeType::getImageList(); break;
                case 'text':        $types += MimeType::getTextList(); break;
                case 'video':       $types += MimeType::getVideoList(); break;
                default:            $types += MimeType::getSubTypeList($mimeType); break;
            }
        }

        return in_array($this->getFile()->type(), $types);
    }
302704
public function getInputFilterSpecification()
    {
        $allowedMimeTypes = $this->mediaOptions->getAllowedMimeTypes();
        if (empty($allowedMimeTypes)) {
            return [];
        }
        return [
            'file' => [
                'required' => true,
                'validators' => [
                    [
                        'name' => MimeType::class,
                        'options' => [
                            'mimeType' => $allowedMimeTypes,
                        ]
                    ]
                ]
            ]
        ];
    }
772429
protected function getWhitelistedMimeTypes()
    {
        $allow = config('cms-upload-module.upload.restrict.mimetypes.allow', null);

        if ( ! is_array($allow) || ! count($allow)) {
            return false;
        }

        return array_map('trim', array_map('strtolower', $allow));
    }
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;
    }
165972
public static function getTypes()
    {
        return [
            self::TYPE_VCS,
            self::TYPE_GIT,
            self::TYPE_GIT_BITBACKET,
            self::TYPE_GITHUB,
            self::TYPE_GITLAB,
        ];
    }