public static function getTypeFromPath($file_name){
		$ext = strtolower(preg_replace('/^.*\.([^.]+)$/', '$1', $file_name));
		switch( $ext ){
			case 'jpeg':
			case 'jpg':
				return self::JPEG;
				break;
			case 'otf':
				return self::OpenType;
				break;
			case 'opf':
				return self::OPF2;
				break;
			case 'smil':
				return self::MediaOverlays301;
				break;
			case 'js':
				return self::JS;
				break;
			default:
				$const_name = strtoupper($ext);
				$refl = new \ReflectionClass(get_called_class());
				return $refl->getConstant($const_name);
				break;
		}
	}
public static function getTypeFromPath($file_name){
		$ext = strtolower(preg_replace('/^.*\.([^.]+)$/', '$1', $file_name));
		switch( $ext ){
			case 'jpeg':
			case 'jpg':
				return self::JPEG;
				break;
			case 'otf':
				return self::OpenType;
				break;
			case 'opf':
				return self::OPF2;
				break;
			case 'smil':
				return self::MediaOverlays301;
				break;
			case 'js':
				return self::JS;
				break;
			default:
				$const_name = strtoupper($ext);
				$refl = new \ReflectionClass(get_called_class());
				return $refl->getConstant($const_name);
				break;
		}
	}
public static function getTypeFromPath ( $ file_name ) { $ ext = strtolower ( preg_replace ( '/^.*\.([^.]+)$/' , '$1' , $ file_name ) ) ; switch ( $ ext ) { case 'jpeg' : case 'jpg' : return self :: JPEG ; break ; case 'otf' : return self :: OpenType ; break ; case 'opf' : return self :: OPF2 ; break ; case 'smil' : return self :: MediaOverlays301 ; break ; case 'js' : return self :: JS ; break ; default : $ const_name = strtoupper ( $ ext ) ; $ refl = new \ ReflectionClass ( get_called_class ( ) ) ; return $ refl -> getConstant ( $ const_name ) ; break ; } }
Get extension from file path

@param string $file_name

@return string
Get extension from file path