GZFile
GZFile
Properties
level
private int $level
encoding
private int $encoding
handle
private mixed $handle
Methods
__construct
public __construct({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$file | mixed | |
$manager | Manager |
setCompressionLevel
Sets the level of compression.
public setCompressionLevel({Array})
Can be given as 0 for no compression up to 9 for maximum compression.
If -1 is used, the default compression of the zlib library is used which is 6.
Parameters
Parameter | Type | Description |
---|---|---|
$level | int |
getCompressionLevel
Returns the current compression level setting.
public getCompressionLevel({Array})
Can be a value of 0 for no compression up to 9 for maximum compression.
If the value is -1, the default compression of the zlib library is being used, which is 6.
setEncoding
Set the current encoding for compress.
public setEncoding({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$encoding | int |
getEncoding
Returns the current gzencode encoding.
public getEncoding({Array})
open
Open gz-file.
public open({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$mode | string |
close
Close an open gz-file pointer.
public close({Array})
read
Binary-safe gz-file read.
public read({Array})
File::read() reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met:
- length bytes have been read
- EOF (end of file) is reached
- a packet becomes available or the socket timeout occurs (for network streams)
- if the stream is read buffered and it does not represent a plain file, at most one read of up to a number of bytes equal to the chunk size (usually 8192) is made; depending on the previously buffered data, the size of the returned data may be larger than the chunk size.
Parameters
Parameter | Type | Description |
---|---|---|
$length | int | up to length number of bytes read |
write
Binary-safe gz-file write.
public write({Array})
File::write() writes the contents of string to the file stream pointed to by handle.
Parameters
Parameter | Type | Description |
---|---|---|
$string | string | the string that is to be written |
$length | int | If the length argument is given, writing will stop after length bytes have been written or the end |
of string is reached, whichever comes first.
Note that if the length argument is given, then the magic_quotes_runtime configuration option
will be ignored and no slashes will be stripped from string. |
getc
Returns a character from the file pointer.
public getc({Array})
gets
Returns a line from the file pointer.
public gets({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$length | int |
getss
Returns a line from the file pointer and strips HTML tags.
public getss({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$allowable_tags | string |
seek
Seeks to a position in the file.
public seek({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$offset | int | The offset. To move to a position before the end-of-file, you need to pass a negative value in offset and set whence to SEEK_END. |
$whence | int | whence values are: |
SEEK_SET - Set position equal to offset bytes.
SEEK_CUR - Set position to current location plus offset.
SEEK_END - Set position to end-of-file plus offset. |
tell
Returns the current position of the file read/write pointer.
public tell({Array})
rewind
Rewind the position of a file pointer.
public rewind({Array})
Sets the file position indicator for handle to the beginning of the file stream.
eof
Tests for end-of-file on a file pointer.
public eof({Array})
get_contents
Returns the current contents of the file.
public get_contents({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$offset | int | |
$maxlen | NULL |
putContents
Put contents directly writes data to the storage manager without storing it in the file object itself.
public putContents({Array})
NOTE: This function is called internally to save data that has been updated in the file object.
Parameters
Parameter | Type | Description |
---|---|---|
$data | string | |
$overwrite | bool |
saveAs
Saves this file objects content to another file name.
public saveAs({Array})
Parameters
Parameter | Type | Description |
---|---|---|
$filename | string | The filename to save as |
$overwrite | bool | Boolean flag to indicate that the destination should be overwritten if it exists |
Generated by Hazaar API Doc Generator