From 381e952aaf3bc4827894e8397915e86902d90867 Mon Sep 17 00:00:00 2001 From: ajshort Date: Sat, 16 Apr 2011 00:27:25 +1000 Subject: [PATCH] API CHANGE: Removed the unused Archive and TarballArchive classes. --- filesystem/Archive.php | 27 ----------- filesystem/TarballArchive.php | 87 ----------------------------------- 2 files changed, 114 deletions(-) delete mode 100644 filesystem/Archive.php delete mode 100644 filesystem/TarballArchive.php diff --git a/filesystem/Archive.php b/filesystem/Archive.php deleted file mode 100644 index cff3e66f2..000000000 --- a/filesystem/Archive.php +++ /dev/null @@ -1,27 +0,0 @@ - \ No newline at end of file diff --git a/filesystem/TarballArchive.php b/filesystem/TarballArchive.php deleted file mode 100644 index 49e9475cf..000000000 --- a/filesystem/TarballArchive.php +++ /dev/null @@ -1,87 +0,0 @@ -filename = $filename; - - if(substr($filename, strlen($filename) - strlen('.gz')) == '.gz' || - substr($filename, strlen($filename) - strlen('.tgz')) == '.tgz') { - $this->compressionModifiers = 'z'; - } else if(substr($filename, strlen($filename) - strlen('.bz2')) == '.bz2') { - $compressionModifiers = 'j'; - } - } - - function listing() { - // Call tar on the command line to get the info we need - $base = BASE_PATH; - $command = "tar -tv{$this->compressionModifiers}f $base/$this->filename"; - $consoleList = `$command`; - - $listing = array(); - // Seperate into an array of lines - $listItems = explode("\n", $consoleList); - - foreach($listItems as $listItem) { - // The path is the last thing on the line - $fullpath = substr($listItem, strrpos($listItem, ' ') + 1); - $path = explode('/', $fullpath); - $item = array(); - - // The first part of the line is the permissions - the first character will be d if it is a directory - $item['type'] = (substr($listItem, 0, 1) == 'd') ? 'directory' : 'file'; - if($item['type'] == 'directory') { - $item['listing'] = array(); - // If it's a directory, the path will have a slash on the end, so get rid of it. - array_pop($path); - } - - // The name of the file/directory is the last item on the path - $name = array_pop($path); - if($name == '') { - continue; - } - - $item['path'] = implode('/', $path); - - // Put the item in the right place - $dest = &$listing; - foreach($path as $folder) { - // If the directory doesn't exist, create it - if(!isset($dest[$folder])) { - $dest[$folder] = array(); - $dest[$folder]['listing'] = array(); - $dest[$folder]['type'] = 'directory'; - } - $dest = &$dest[$folder]['listing']; - } - - // If this is a directory and it's listing has already been created, copy the the listing - if($item['type'] == 'directory' && isset($dest[$name]['listing'])) { - $item['listing'] = $dest[$name]['listing']; - } - $dest[$name] = $item; - } - - - return $listing; - } - - function extractTo($destination, $entries = null) { - if(!isset($entries)) { - $command = "tar -xv{$this->compressionModifiers}f ../$this->filename --directory $destination"; - $output = `$command`; - } - } - -} - -?> \ No newline at end of file