Browse files

Constructor for OpenPGP_LiteralDataPacket

  • Loading branch information...
1 parent 8265522 commit c1f699f9295015a31676cdbd068871ad374db880 @singpolyma singpolyma committed with bendiken Apr 1, 2010
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/openpgp.php
View
9 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();

0 comments on commit c1f699f

Please sign in to comment.