class Data
DataURI\Data object is a representation of an url which embed (small) media type data directly inline.
It owns three main properties :
the data, the type of the media and some optional parameters
Constants
LITLEN |
The LITLEN (1024) limits the number of characters which can appear in a single attribute value literal |
ATTSPLEN |
The ATTSPLEN (2100) limits the sum of all lengths of all attribute value specifications which appear in a tag |
TAGLEN |
The TAGLEN (2100) limits the overall length of a tag |
ATTS_TAG_LIMIT |
ATTS_TAG_LIMIT is the length limit allowed for TAGLEN & ATTSPLEN DataURi |
LIT_LIMIT |
LIT_LIMIT is the length limit allowed for LITLEN DataURi |
BASE_64 |
Base64 encode prefix |
Methods
__construct(string $data, string $mimeType = null, array $parameters = array(), boolean $strict = false, int $lengthMode = self::TAGLEN)
A DataURI Object which by default has a 'text/plain' media type and a 'charset=US-ASCII' as optionnal parameter |
||
string |
getData()
File Datas |
|
string |
getMimeType()
Media type |
|
string |
getParameters()
File parameters |
|
boolean |
isBinaryData()
Data is binary data |
|
Data |
setBinaryData(boolean $boolean)
Set if Data is binary data |
|
File |
addParameters(string $paramName, string $paramValue)
Add a custom parameters to the DataURi |
|
File |
write(string $pathfile, Boolean $override = false)
Write datas to the specified file |
|
static Data |
buildFromFile(string $file, boolean $strict = false, int $lengthMode = Data::TAGLEN)
Get a new instance of DataUri\Data from a file |
Details
at line 109
public
__construct(string $data, string $mimeType = null, array $parameters = array(), boolean $strict = false, int $lengthMode = self::TAGLEN)
A DataURI Object which by default has a 'text/plain' media type and a 'charset=US-ASCII' as optionnal parameter
at line 124
public string
getData()
File Datas
at line 133
public string
getMimeType()
Media type
at line 142
public string
getParameters()
File parameters
at line 151
public boolean
isBinaryData()
Data is binary data
at line 162
public Data
setBinaryData(boolean $boolean)
Set if Data is binary data
at line 175
public File
addParameters(string $paramName, string $paramValue)
Add a custom parameters to the DataURi
at line 192
public File
write(string $pathfile, Boolean $override = false)
Write datas to the specified file
at line 211
static public Data
buildFromFile(string $file, boolean $strict = false, int $lengthMode = Data::TAGLEN)
Get a new instance of DataUri\Data from a file