PHP 클래스 Symfony\Component\HttpFoundation\File\File

저자: Bernhard Schussek ([email protected])
상속: extends SplFileInfo
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( string $path, boolean $checkPath = true ) Constructs a new file from the given path.
getExtension ( ) : string Returns the extension of the file.
getMimeType ( ) : string | null Returns the mime type of the file.
guessExtension ( ) : string | null Returns the extension based on the mime type.
move ( string $directory, string $name = null ) : File Moves the file to a new location.

메소드 상세

__construct() 공개 메소드

Constructs a new file from the given path.
public __construct ( string $path, boolean $checkPath = true )
$path string The path to the file
$checkPath boolean Whether to check the path or not

getExtension() 공개 메소드

\SplFileInfo::getExtension() is not available before PHP 5.3.6
public getExtension ( ) : string
리턴 string The extension

getMimeType() 공개 메소드

The mime type is guessed using the functions finfo(), mime_content_type() and the system binary "file" (in this order), depending on which of those is available on the current operating system.
public getMimeType ( ) : string | null
리턴 string | null The guessed mime type (i.e. "application/pdf")

guessExtension() 공개 메소드

If the mime type is unknown, returns null.
public guessExtension ( ) : string | null
리턴 string | null The guessed extension or null if it cannot be guessed

move() 공개 메소드

Moves the file to a new location.
public move ( string $directory, string $name = null ) : File
$directory string The destination folder
$name string The new file name
리턴 File A File object representing the new file