Skip to content

Instantly share code, notes, and snippets.

@thejwalker
Last active September 22, 2015 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejwalker/fe4fd0d6700f5f3c2cd3 to your computer and use it in GitHub Desktop.
Save thejwalker/fe4fd0d6700f5f3c2cd3 to your computer and use it in GitHub Desktop.
PEAR - PHP Archive_Tar
// REQUIRE THE PEAR PACKAGE - https://pear.php.net/package/Archive_Tar/
require_once 'Archive/Tar.php';
// SETUP THE ARCHIVE OUTPUT
$tar_object = new Archive_Tar($outpath, true);
$tar_object->setErrorHandling(PEAR_ERROR_PRINT);
// TAR $file
if($tar_object->create(array($file))) {
/* DO STUFF */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment