Fileinfo Functions
소개
The functions in this module try to guess the content type and encoding of a file by looking for certain magic byte sequences at specific positions within the file. While this is not a bullet proof approach the heuristics used do a very good job.
요구 조건
magic_open library is needed to build this extension.
설치
PECL 확장 설치에 관한 정보는 매뉴얼의 PECL 확장 설치에 있습니다. 새 릴리즈, 내려받기, 소스파일, 개발자 정보, CHANGELOG 등의 추가 정보는 여기에 있습니다: » https://pecl.php.net/package/fileinfo
실행시 설정
이 확장은 php.ini 설정이 존재하지 않습니다.
자원형
There is one resource used in Fileinfo extension: a magic database descriptor returned by finfo_open().
예약 상수
이 확장은 다음의 상수들을 정의합니다. 이 확장을 PHP에 내장했거나, 실행시에 동적으로 읽어들일 경우에만 사용할 수 있습니다.
- FILEINFO_NONE (integer)
- No special handling.
- FILEINFO_SYMLINK (integer)
- Follow symlinks.
- FILEINFO_MIME (integer)
- Return a mime string, instead of a textual description.
- FILEINFO_COMPRESS (integer)
- Decompress compressed files.
- FILEINFO_DEVICES (integer)
- Look at the contents of blocks or character special devices.
- FILEINFO_CONTINUE (integer)
- Return all matches, not just the first.
- FILEINFO_PRESERVE_ATIME (integer)
- If possible preserve the original access time.
- FILEINFO_RAW (integer)
- Don't translate unprintable characters to a \ooo octal representation.
Table of Contents
- finfo_buffer — Return information about a string buffer
- finfo_close — Close fileinfo resource
- finfo_file — Return information about a file
- finfo_open — Create a new fileinfo resource
- finfo_set_flags — Set libmagic configuration options