Method | Description | |
---|---|---|
__construct ( $file, |
ReadOnlyFile constructor | |
__destruct ( ) | Make sure we invoke $this->close() | |
close ( ) | Close the file handle. | |
getHash ( ) : string | Calculate a BLAKE2b hash of a file | |
getPos ( ) : integer | Where are we in the buffer? | |
getSize ( ) : integer | How big is this buffer? | |
readBytes ( integer $num, boolean $skipTests = false ) : string | Read from a stream; prevent partial reads (also uses run-time testing to prevent partial reads -- you can turn this off if you need performance and aren't concerned about race condition attacks, but this isn't a decision to make lightly!) | |
remainingBytes ( ) : integer | Get number of bytes remaining | |
reset ( integer $position ) : boolean | Set the current cursor position to the desired location | |
toctouTest ( ) : void | Run-time test to prevent TOCTOU attacks (race conditions) through verifying that the hash matches and the current cursor position/file size matches their values when the file was first opened. | |
writeBytes ( string $buf, integer $num = null ) : integer | This is a meaningless operation for a Read-Only File! |
public __construct ( $file, |
||
$file | ||
$key |
public remainingBytes ( ) : integer | ||
return | integer |
public toctouTest ( ) : void | ||
return | void |