ZipInterface.php.svn-base 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Interface for Zip libraries used in odtPHP
  4. * You need PHP 5.2 at least
  5. * You need Zip Extension or PclZip library
  6. * Encoding : ISO-8859-1
  7. * Last commit by $Author: neveldo $
  8. * Date - $Date: 2009-05-29 10:05:11 +0200 (ven., 29 mai 2009) $
  9. * SVN Revision - $Rev: 28 $
  10. * Id : $Id: odf.php 28 2009-05-29 08:05:11Z neveldo $
  11. *
  12. * @copyright GPL License 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
  13. * @license http://www.gnu.org/copyleft/gpl.html GPL License
  14. * @version 1.3
  15. */
  16. interface ZipInterface
  17. {
  18. /**
  19. * Open a Zip archive
  20. *
  21. * @param string $filename the name of the archive to open
  22. * @return true if openning has succeeded
  23. */
  24. public function open($filename);
  25. /**
  26. * Retrieve the content of a file within the archive from its name
  27. *
  28. * @param string $name the name of the file to extract
  29. * @return the content of the file in a string
  30. */
  31. public function getFromName($name);
  32. /**
  33. * Add a file within the archive from a string
  34. *
  35. * @param string $localname the local path to the file in the archive
  36. * @param string $contents the content of the file
  37. * @return true if the file has been successful added
  38. */
  39. public function addFromString($localname, $contents);
  40. /**
  41. * Add a file within the archive from a file
  42. *
  43. * @param string $filename the path to the file we want to add
  44. * @param string $localname the local path to the file in the archive
  45. * @return true if the file has been successful added
  46. */
  47. public function addFile($filename, $localname = null);
  48. /**
  49. * Close the Zip archive
  50. * @return true
  51. */
  52. public function close();
  53. }
  54. ?>