Constructor for OpenPGP_LiteralDataPacket

This commit is contained in:
Stephen Paul Weber 2010-03-31 17:15:11 -05:00
parent 8265522323
commit 6e8dc4799f
1 changed files with 9 additions and 0 deletions

View File

@ -920,6 +920,15 @@ class OpenPGP_MarkerPacket extends OpenPGP_Packet {
*/
class OpenPGP_LiteralDataPacket extends OpenPGP_Packet {
public $format, $filename, $timestamp;
function __construct($data=NULL, $opt=array()) {
parent::__construct();
$this->data = $data;
$this->format = $opt['format'] ? $opt['format'] : 'b';
$this->filename = $opt['filename'] ? $opt['filename'] : 'data';
$this->timestamp = $opt['timestamp'] ? $opt['timestamp'] : time();
}
function read() {
$this->size = $this->length - 1 - 4;
$this->format = $this->read_byte();