2007-08-24 01:07:58 +02:00
|
|
|
<?php
|
|
|
|
|
2008-01-08 07:37:50 +01:00
|
|
|
/**
|
|
|
|
* @package sapphire
|
|
|
|
* @subpackage filesystem
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class for handling archives.
|
|
|
|
* To implement a specific archive system, create a subclass of this abstract class, and amend the implementation of Archive::open().
|
|
|
|
*/
|
2007-08-24 01:07:58 +02:00
|
|
|
abstract class Archive extends Object {
|
2008-01-08 07:37:50 +01:00
|
|
|
/**
|
|
|
|
* Return an Archive object for the given file.
|
|
|
|
*/
|
2007-08-24 01:07:58 +02:00
|
|
|
static function open($filename) {
|
|
|
|
if(substr($filename, strlen($filename) - strlen('.tar.gz')) == '.tar.gz' ||
|
|
|
|
substr($filename, strlen($filename) - strlen('.tar.bz2')) == '.tar.bz2' ||
|
|
|
|
substr($filename, strlen($filename) - strlen('.tar')) == '.tar') {
|
|
|
|
return new TarballArchive($filename);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function extractTo($destination, $entries = null) {
|
|
|
|
}
|
|
|
|
|
|
|
|
function listing($path) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|