PHP 클래스 PMA\libraries\File

파일 보기 프로젝트 열기: phpmyadmin/phpmyadmin 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_charset charset of file
$_chunk_size size of chunk to read with every step
$_compression type of compression
$_content the content
$_decompress whether to decompress content before returning
$_error_message the error message
$_handle file handle
$_is_temp whether the file is temporary or not
$_name the temporary file name
$_offset integer

공개 메소드들

메소드 설명
__construct ( boolean | string $name = false ) constructor
__destruct ( ) destructor
checkTblChangeForm ( string $key, string $rownumber ) : boolean checks the superglobals provided if the tbl_change form is submitted and uses the submitted/selected file
checkUploadedFile ( ) : boolean If we are on a server with open_basedir, we must move the file before opening it. The FAQ 1.11 explains how to create the "./tmp" directory - if needed
cleanUp ( ) : boolean deletes file if it is temporary, usually from a moved upload file
close ( ) : void Closes the file
delete ( ) : boolean deletes the file
eof ( ) : boolean Checks whether we've reached end of file
errorUnsupported ( ) : void Sets error message for unsupported compression.
fetchUploadedFromTblChangeRequestMultiple ( array $file, string $rownumber, string $key ) : array strips some dimension from the multi-dimensional array from $_FILES
getCharset ( ) : string Returns the character set of the file
getChunkSize ( ) : integer Returns the chunk size
getCompression ( ) : string Returns compression used by file.
getContent ( ) : string | false Gets file content
getContentLength ( ) : integer Returns the length of the content in the file
getError ( ) : Message | null Returns possible error message.
getHandle ( ) : resource Returns the file handle
getName ( ) : string accessor
getOffset ( ) : integer Returns the offset
getRawContent ( ) : string | false Gets file content
isError ( ) : boolean Checks whether there was any error.
isReadable ( ) : boolean Checks whether file can be read.
isTemp ( boolean $is_temp = null ) : boolean checks or sets the temp flag for this file file objects with temp flags are deleted with object destruction
isUploaded ( ) : boolean Whether file is uploaded.
open ( ) : boolean Attempts to open the file.
openZip ( string | null $specific_entry = null ) : boolean Opens file from zip
read ( integer $size ) : string Reads data from file
setCharset ( string $charset ) : void Sets the character set of the file
setChunkSize ( integer $chunk_size ) : void Sets the chunk size
setDecompressContent ( boolean $decompress ) : void Sets whether the content should be decompressed before returned
setHandle ( object $handle ) : void Sets the file handle
setLocalSelectedFile ( string $name ) : boolean Sets named file to be read from UploadDir.
setName ( string $name ) : void accessor
setSelectedFromTblChangeRequest ( string $key, string $rownumber = null ) : boolean sets the name if the file to the one selected in the tbl_change form
setUploadedFile ( string $name ) : boolean Initializes object from uploaded file.
setUploadedFromTblChangeRequest ( string $key, string $rownumber ) : boolean Loads uploaded file from table change request.

보호된 메소드들

메소드 설명
detectCompression ( ) : string | false Detects what compression the file uses

메소드 상세

__construct() 공개 메소드

constructor
public __construct ( boolean | string $name = false )
$name boolean | string file name or false

__destruct() 공개 메소드

destructor
또한 보기: File::cleanUp()
public __destruct ( )

checkTblChangeForm() 공개 메소드

checks the superglobals provided if the tbl_change form is submitted and uses the submitted/selected file
public checkTblChangeForm ( string $key, string $rownumber ) : boolean
$key string the md5 hash of the column name
$rownumber string number of row to process
리턴 boolean success

checkUploadedFile() 공개 메소드

If we are on a server with open_basedir, we must move the file before opening it. The FAQ 1.11 explains how to create the "./tmp" directory - if needed
public checkUploadedFile ( ) : boolean
리턴 boolean whether uploaded file is fine or not

cleanUp() 공개 메소드

deletes file if it is temporary, usually from a moved upload file
public cleanUp ( ) : boolean
리턴 boolean success

close() 공개 메소드

Closes the file
public close ( ) : void
리턴 void

delete() 공개 메소드

deletes the file
public delete ( ) : boolean
리턴 boolean success

detectCompression() 보호된 메소드

Detects what compression the file uses
protected detectCompression ( ) : string | false
리턴 string | false false on error, otherwise string MIME type of compression, none for none

eof() 공개 메소드

Checks whether we've reached end of file
public eof ( ) : boolean
리턴 boolean

errorUnsupported() 공개 메소드

Sets error message for unsupported compression.
public errorUnsupported ( ) : void
리턴 void

fetchUploadedFromTblChangeRequestMultiple() 공개 메소드

$file['name']['multi_edit'][$rownumber][$key] = [value] $file['type']['multi_edit'][$rownumber][$key] = [value] $file['size']['multi_edit'][$rownumber][$key] = [value] $file['tmp_name']['multi_edit'][$rownumber][$key] = [value] $file['error']['multi_edit'][$rownumber][$key] = [value] becomes: $file['name'] = [value] $file['type'] = [value] $file['size'] = [value] $file['tmp_name'] = [value] $file['error'] = [value]
public fetchUploadedFromTblChangeRequestMultiple ( array $file, string $rownumber, string $key ) : array
$file array the array
$rownumber string number of row to process
$key string key to process
리턴 array

getCharset() 공개 메소드

Returns the character set of the file
public getCharset ( ) : string
리턴 string character set of the file

getChunkSize() 공개 메소드

Returns the chunk size
public getChunkSize ( ) : integer
리턴 integer the chunk size

getCompression() 공개 메소드

Returns compression used by file.
public getCompression ( ) : string
리턴 string MIME type of compression, none for none

getContent() 공개 메소드

Gets file content
public getContent ( ) : string | false
리턴 string | false the binary file content as a string, or false if no content

getContentLength() 공개 메소드

Returns the length of the content in the file
public getContentLength ( ) : integer
리턴 integer the length of the file content

getError() 공개 메소드

Returns possible error message.
public getError ( ) : Message | null
리턴 Message | null error message

getHandle() 공개 메소드

Returns the file handle
public getHandle ( ) : resource
리턴 resource file handle

getName() 공개 메소드

accessor
public getName ( ) : string
리턴 string File::$_name

getOffset() 공개 메소드

Returns the offset
public getOffset ( ) : integer
리턴 integer the offset

getRawContent() 공개 메소드

Gets file content
public getRawContent ( ) : string | false
리턴 string | false the binary file content, or false if no content

isError() 공개 메소드

Checks whether there was any error.
public isError ( ) : boolean
리턴 boolean whether an error occurred or not

isReadable() 공개 메소드

Checks whether file can be read.
public isReadable ( ) : boolean
리턴 boolean whether the file is readable or not

isTemp() 공개 메소드

checks or sets the temp flag for this file file objects with temp flags are deleted with object destruction
public isTemp ( boolean $is_temp = null ) : boolean
$is_temp boolean sets the temp flag
리턴 boolean File::$_is_temp

isUploaded() 공개 메소드

Whether file is uploaded.
public isUploaded ( ) : boolean
리턴 boolean

open() 공개 메소드

Attempts to open the file.
public open ( ) : boolean
리턴 boolean

openZip() 공개 메소드

Opens file from zip
public openZip ( string | null $specific_entry = null ) : boolean
$specific_entry string | null Entry to open
리턴 boolean

read() 공개 메소드

Reads data from file
public read ( integer $size ) : string
$size integer Number of bytes to read
리턴 string

setCharset() 공개 메소드

Sets the character set of the file
public setCharset ( string $charset ) : void
$charset string character set of the file
리턴 void

setChunkSize() 공개 메소드

Sets the chunk size
public setChunkSize ( integer $chunk_size ) : void
$chunk_size integer the chunk size
리턴 void

setDecompressContent() 공개 메소드

Sets whether the content should be decompressed before returned
public setDecompressContent ( boolean $decompress ) : void
$decompress boolean whether to decompress
리턴 void

setHandle() 공개 메소드

Sets the file handle
public setHandle ( object $handle ) : void
$handle object file handle
리턴 void

setLocalSelectedFile() 공개 메소드

Sets named file to be read from UploadDir.
public setLocalSelectedFile ( string $name ) : boolean
$name string file name
리턴 boolean success

setName() 공개 메소드

accessor
public setName ( string $name ) : void
$name string file name
리턴 void

setSelectedFromTblChangeRequest() 공개 메소드

sets the name if the file to the one selected in the tbl_change form
public setSelectedFromTblChangeRequest ( string $key, string $rownumber = null ) : boolean
$key string the md5 hash of the column name
$rownumber string number of row to process
리턴 boolean success

setUploadedFile() 공개 메소드

Initializes object from uploaded file.
public setUploadedFile ( string $name ) : boolean
$name string name of file uploaded
리턴 boolean success

setUploadedFromTblChangeRequest() 공개 메소드

Loads uploaded file from table change request.
public setUploadedFromTblChangeRequest ( string $key, string $rownumber ) : boolean
$key string the md5 hash of the column name
$rownumber string number of row to process
리턴 boolean success

프로퍼티 상세

$_charset 공개적으로 프로퍼티

charset of file
public $_charset

$_chunk_size 공개적으로 프로퍼티

size of chunk to read with every step
public $_chunk_size

$_compression 공개적으로 프로퍼티

type of compression
public $_compression

$_content 공개적으로 프로퍼티

the content
public $_content

$_decompress 공개적으로 프로퍼티

whether to decompress content before returning
public $_decompress

$_error_message 공개적으로 프로퍼티

the error message
public $_error_message

$_handle 공개적으로 프로퍼티

file handle
public $_handle

$_is_temp 공개적으로 프로퍼티

whether the file is temporary or not
public $_is_temp

$_name 공개적으로 프로퍼티

the temporary file name
public $_name

$_offset 공개적으로 프로퍼티

public int $_offset
리턴 integer