Permalink
Browse files

add method getContent to Entry class

  • Loading branch information...
1 parent f5fc8e2 commit 30ddcca8c48b6b509446c16170ea46dacfd3c499 @Gemorroj committed Sep 3, 2012
Showing with 19 additions and 2 deletions.
  1. +1 −1 Archive/7z.php
  2. +18 −1 Archive/7z/Entry.php
View
@@ -220,7 +220,7 @@ public function getEntries()
$list = array();
foreach ($this->_parseEntries($out) as $v) {
- $list[] = new Archive_7z_Entry($v);
+ $list[] = new Archive_7z_Entry($this, $v);
}
return $list;
View
@@ -22,12 +22,19 @@ class Archive_7z_Entry
private $_method;
private $_block;
+ /**
+ * @var Archive_7z
+ */
+ private $_archive;
+
/**
+ * @param Archive_7z $archive
* @param array $data
*/
- public function __construct(array $data)
+ public function __construct(Archive_7z $archive, array $data)
{
+ $this->_archive = $archive;
$this->_parseEntry($data);
}
@@ -101,6 +108,16 @@ public function isDirectory()
}
+ /**
+ * @throws Archive_7z_Exception
+ * @return string
+ */
+ public function getContent()
+ {
+ return $this->_archive->getContent($this->_path);
+ }
+
+
public function getAttributes()
{
return $this->_attributes;

0 comments on commit 30ddcca

Please sign in to comment.