PHP Class Elgg\FileService\File

显示文件 Open project: elgg/elgg Class Usage Examples

Public Methods

Method Description
bindSession ( boolean $use_cookie = true ) : void Bind URL to current user session
getFile ( ) : ElggFile | null Returns file object
getURL ( ) : string | false Returns publicly accessible URL
setDisposition ( string $disposition = self::ATTACHMENT ) : void Sets content disposition
setExpires ( integer $expires = '+2 hours' ) : void Sets URL expiration
setFile ( ElggFile $file ) : void Set file object

Method Details

bindSession() public method

Bind URL to current user session
public bindSession ( boolean $use_cookie = true ) : void
$use_cookie boolean Use cookie
return void

getFile() public method

Returns file object
public getFile ( ) : ElggFile | null
return ElggFile | null

getURL() public method

Returns publicly accessible URL
public getURL ( ) : string | false
return string | false

setDisposition() public method

Sets content disposition
public setDisposition ( string $disposition = self::ATTACHMENT ) : void
$disposition string Content disposition ('inline' or 'attachment')
return void

setExpires() public method

Sets URL expiration
public setExpires ( integer $expires = '+2 hours' ) : void
$expires integer String suitable for strtotime()
return void

setFile() public method

Set file object
public setFile ( ElggFile $file ) : void
$file ElggFile File object
return void