| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Shared classes and interfaces for the archiver system.
|
| 7 |
*/
|
| 8 |
|
| 9 |
/**
|
| 10 |
* Common interface for all Archiver classes.
|
| 11 |
*/
|
| 12 |
interface ArchiverInterface {
|
| 13 |
|
| 14 |
/**
|
| 15 |
* Contructor for a new archiver instance.
|
| 16 |
*
|
| 17 |
* @param $file_path
|
| 18 |
* The full system path of the archive to manipulate. Only local files
|
| 19 |
* are supported. If the file does not yet exist, it will be created if
|
| 20 |
* appropriate.
|
| 21 |
*/
|
| 22 |
public function __construct($file_path);
|
| 23 |
|
| 24 |
/**
|
| 25 |
* Add the specified file or directory to the archive.
|
| 26 |
*
|
| 27 |
* @param $file_path
|
| 28 |
* The full system path of the file or directory to add. Only local files
|
| 29 |
* and directories are supported.
|
| 30 |
* @return
|
| 31 |
* The called object.
|
| 32 |
*/
|
| 33 |
public function add($file_path);
|
| 34 |
|
| 35 |
/**
|
| 36 |
* Remove the specified file from the archive.
|
| 37 |
*
|
| 38 |
* @param $path
|
| 39 |
* The file name relative to the root of the archive to remove.
|
| 40 |
* @return
|
| 41 |
* The called object.
|
| 42 |
*/
|
| 43 |
public function remove($path);
|
| 44 |
|
| 45 |
/**
|
| 46 |
* Extract multiple files in the archive to the specified path.
|
| 47 |
*
|
| 48 |
* @param $path
|
| 49 |
* A full system path of the directory to which to extract files.
|
| 50 |
* @param $files
|
| 51 |
* Optionally specify a list of files to be extracted. Files are
|
| 52 |
* relative to the root of the archive. If not specified, all files
|
| 53 |
* in the archive will be extracted
|
| 54 |
* @return
|
| 55 |
* The called object.
|
| 56 |
*/
|
| 57 |
public function extract($path, Array $files = array());
|
| 58 |
|
| 59 |
/**
|
| 60 |
* List all files in the archive.
|
| 61 |
*
|
| 62 |
* @return
|
| 63 |
* An array of file names relative to the root of the archive, or
|
| 64 |
* an iteratable object that resolves to such a list.
|
| 65 |
*/
|
| 66 |
public function listContents();
|
| 67 |
}
|
| 68 |
|