From 6e8dc4799f2f04a5cba696c4941929c5ec4464c8 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 31 Mar 2010 17:15:11 -0500 Subject: [PATCH] Constructor for OpenPGP_LiteralDataPacket --- lib/openpgp.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/openpgp.php b/lib/openpgp.php index 308c80a..fbbf333 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -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();