Loader
class Loader implements LoaderInterface
Default implementation of Imagine\File\LoaderInterface.
Constants
MINIMUM_CURL_VERSION |
The mimimum supported version of curl. |
Properties
protected string | $path | The file path. | |
protected bool | $isUrl | Does $path contain an URL? | |
protected string|null | $data | The loaded data. | |
protected bool|null | $isCurlSupported | Is curl available, with a decent version? |
Methods
Initialize the instance.
Is this a local file.
Get the path of the file (local or remote).
Is the binary content already loaded?
Get the file binary contents.
The string representation of this object must be the file path (local or remote).
Read a local file.
Check that the file exists and it's readable.
Read a remote file.
Check if curl is available and it's a decent version.
Read a remote file using the cURL extension.
Set curl options.
Read a remote file using the file_get_contents.
Details
at line 61
__construct(string|mixed $path)
Initialize the instance.
at line 82
bool
isLocalFile()
Is this a local file.
at line 92
string
getPath()
Get the path of the file (local or remote).
at line 102
bool
hasReadData()
Is the binary content already loaded?
at line 115
string
getData()
Get the file binary contents.
at line 133
string
__toString()
The string representation of this object must be the file path (local or remote).
at line 145
protected string
readLocalFile()
Read a local file.
at line 161
protected
checkLocalFile()
Check that the file exists and it's readable.
at line 179
protected string
readRemoteFile()
Read a remote file.
at line 193
protected bool
isCurlSupported()
Check if curl is available and it's a decent version.
at line 218
protected string
readRemoteFileWithCurl()
Read a remote file using the cURL extension.
at line 259
protected
setCurlOptions(resource $curl)
Set curl options.
at line 287
protected string
readRemoteFileWithFileGetContents()
Read a remote file using the file_get_contents.