HTTPFile
in package
implements
FileWriterInterface
Table of Contents
Interfaces
Constants
- CURL_COMMAND = 'curl %s --output %s --header %s --connect-timeout 300 --retry 3 --http1.1 --silent --fail --insecure --location'
- CURL_ENABLED = true
- STATUS_BAD_REQUEST = 400
Properties
Methods
- copyTo() : mixed
- createFromDocument() : HTTPFile
- createFromDownload() : null|HTTPFile
- createFromFileList() : HTTPFile
- createFromJSON() : HTTPFile
- createFromPath() : HTTPFile
- createFromPHP() : null|HTTPFile
- createFromStream() : HTTPFile
- createFromString() : HTTPFile
- createFromTemp() : mixed
- createFromURL() : null|HTTPFile
- delete() : mixed
- exists() : bool
- getContents() : string
- getDocument() : mixed
- getName() : mixed
- getPath() : mixed
- getTempFile() : string
- setContents() : mixed
- setDocument() : mixed
- setStream() : mixed
- toFile() : SplFileInfo
- Converts the object's data to a file on disk.
- toFileName() : string
- toString() : string
- verifyDownload() : bool
- verifyURL() : bool
- __construct() : mixed
Constants
CURL_COMMAND
public
mixed
CURL_COMMAND
= 'curl %s --output %s --header %s --connect-timeout 300 --retry 3 --http1.1 --silent --fail --insecure --location'
CURL_ENABLED
public
mixed
CURL_ENABLED
= true
STATUS_BAD_REQUEST
public
mixed
STATUS_BAD_REQUEST
= 400
Properties
$name
protected
mixed
$name
$path
protected
mixed
$path
Methods
copyTo()
public
copyTo(mixed $dir[, mixed $name = null ][, mixed $copyClosure = null ]) : mixed
Parameters
- $dir : mixed
- $name : mixed = null
- $copyClosure : mixed = null
createFromDocument()
public
static createFromDocument(DOMDocument $doc[, string $fileName = '' ]) : HTTPFile
Parameters
- $doc : DOMDocument
- $fileName : string = ''
Return values
HTTPFilecreateFromDownload()
public
static createFromDownload(string $filePath, string $url[, int $headerCache = Seconds::YEAR ]) : null|HTTPFile
Parameters
- $filePath : string
- $url : string
- $headerCache : int = Seconds::YEAR
Return values
null|HTTPFilecreateFromFileList()
public
static createFromFileList(array<string|int, mixed> $fileList[, string $fileName = '' ]) : HTTPFile
Parameters
- $fileList : array<string|int, mixed>
- $fileName : string = ''
Return values
HTTPFilecreateFromJSON()
public
static createFromJSON(mixed $object[, string $fileName = '' ]) : HTTPFile
Parameters
- $object : mixed
- $fileName : string = ''
Return values
HTTPFilecreateFromPath()
public
static createFromPath(string $filePath[, string $fileName = '' ]) : HTTPFile
Parameters
- $filePath : string
- $fileName : string = ''
Return values
HTTPFilecreateFromPHP()
public
static createFromPHP(string $phpCommand[, string $fileName = '' ]) : null|HTTPFile
Parameters
- $phpCommand : string
- $fileName : string = ''
Return values
null|HTTPFilecreateFromStream()
public
static createFromStream(resource $resource[, string $fileName = '' ]) : HTTPFile
Parameters
- $resource : resource
- $fileName : string = ''
Return values
HTTPFilecreateFromString()
public
static createFromString(string $content[, string $fileName = '' ]) : HTTPFile
Parameters
- $content : string
- $fileName : string = ''
Return values
HTTPFilecreateFromTemp()
public
static createFromTemp([string $fileName = '' ]) : mixed
Parameters
- $fileName : string = ''
createFromURL()
public
static createFromURL(string $url[, string $fileName = '' ]) : null|HTTPFile
Parameters
- $url : string
- $fileName : string = ''
Return values
null|HTTPFiledelete()
public
delete() : mixed
exists()
public
exists() : bool
Return values
boolgetContents()
public
getContents() : string
Return values
stringgetDocument()
public
getDocument() : mixed
getName()
public
getName() : mixed
getPath()
public
getPath() : mixed
getTempFile()
public
static getTempFile() : string
Return values
stringsetContents()
public
setContents(string $content) : mixed
Parameters
- $content : string
setDocument()
public
setDocument(DOMDocument $content) : mixed
Parameters
- $content : DOMDocument
setStream()
public
setStream(mixed $content) : mixed
Parameters
- $content : mixed
toFile()
Converts the object's data to a file on disk.
public
toFile() : SplFileInfo
Subsequent calls are expected to return the same file object each time.
Return values
SplFileInfotoFileName()
public
toFileName() : string
Return values
stringtoString()
public
toString() : string
Return values
stringverifyDownload()
public
static verifyDownload(string $filePath, string $url[, int $headerCache = Seconds::YEAR ]) : bool
Parameters
- $filePath : string
- $url : string
- $headerCache : int = Seconds::YEAR
Return values
boolverifyURL()
public
static verifyURL(string $url[, int $headerCache = Seconds::YEAR ]) : bool
Parameters
- $url : string
- $headerCache : int = Seconds::YEAR
Return values
bool__construct()
protected
__construct(string $filePath[, string $fileName = '' ]) : mixed
Parameters
- $filePath : string
- $fileName : string = ''