Example #1
0
 /**
  * Adds a string of data as a specific file inside the zip.
  *
  * @param string $zip_path File path inside the zip to store the data in for example /mydir/myfile.txt.
  * @param string $data Data to store inside the file.
  * @param string $comment Optional comment to add to the file inside the zip.
  */
 function addData($zip_path, $data, $comment = "")
 {
     $zip_path = preg_replace('/^\\//', '', $zip_path);
     $this->deleteFile($zip_path);
     $entry = new Moxiecode_ZipEntry($this);
     $entry->setPath($zip_path);
     $entry->setData($data);
     $entry->setComment($comment);
     $this->buildPath($entry->getPath());
     $this->addEntry($entry);
 }