芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/vendor/imagine/imagine/src/Image/Format.php
id = $id; $this->mimeType = $mimeType; $this->canonicalFileExtension = $canonicalFileExtension; $this->alternativeIDs = $alternativeIDs; } /** * @return string */ public function getID() { return $this->id; } /** * @return string */ public function getMimeType() { return $this->mimeType; } /** * @return string */ public function getCanonicalFileExtension() { return $this->canonicalFileExtension; } /** * @return string[] */ public function getAlternativeIDs() { return $this->alternativeIDs; } /** * Get a format given its ID. * * @param static|string $format the format (a Format instance of a format ID) * * @return static|null */ public static function get($format) { return static::getList()->find($format); } /** * @return static[] */ public static function getAll() { return static::getList()->getAll(); } /** * @return \Imagine\Image\FormatList */ protected static function getList() { if (self::$all !== null) { return self::$all; } $class = new ReflectionClass(get_called_class()); $formats = array(); foreach ($class->getConstants() as $constantName => $constantValue) { if (strpos($constantName, 'ID_') === 0) { $formats[] = static::create($constantValue); } } self::$all = new FormatList($formats); return self::$all; } /** * @param string $formatID * * @return static */ protected static function create($formatID) { switch ($formatID) { case static::ID_JPEG: return new static($formatID, 'image/jpeg', 'jpg', array('jpg', 'pjpeg', 'jfif')); case static::ID_WBMP: return new static($formatID, 'image/vnd.wap.wbmp', $formatID); default: return new static($formatID, "image/{$formatID}", $formatID); } } }