ZipInterface.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. *
  8. * @copyright GPL License 2008 - Julien Pauli - Cyril PIERRE de GEYER - Anaska (http://www.anaska.com)
  9. * @license https://www.gnu.org/copyleft/gpl.html GPL License
  10. * @version 1.3
  11. */
  12. interface ZipInterface
  13. {
  14. /**
  15. * Open a Zip archive
  16. *
  17. * @param string $filename the name of the archive to open
  18. * @return true if openning has succeeded
  19. */
  20. public function open($filename);
  21. /**
  22. * Retrieve the content of a file within the archive from its name
  23. *
  24. * @param string $name the name of the file to extract
  25. * @return the content of the file in a string
  26. */
  27. public function getFromName($name);
  28. /**
  29. * Add a file within the archive from a string
  30. *
  31. * @param string $localname the local path to the file in the archive
  32. * @param string $contents the content of the file
  33. * @return true if the file has been successful added
  34. */
  35. public function addFromString($localname, $contents);
  36. /**
  37. * Add a file within the archive from a file
  38. *
  39. * @param string $filename the path to the file we want to add
  40. * @param string $localname the local path to the file in the archive
  41. * @return true if the file has been successful added
  42. */
  43. public function addFile($filename, $localname = null);
  44. /**
  45. * Close the Zip archive
  46. * @return true
  47. */
  48. public function close();
  49. }
  50. ?>