From: Marc MAURICE Date: Fri, 3 Jun 2011 16:40:20 +0000 (+0200) Subject: Added the tar plugin X-Git-Tag: v1.5~6 X-Git-Url: http://positon.org/gitweb/?p=bizou.git;a=commitdiff_plain;h=7be4394f07c61f3d32d9e77b220b0c39cf89c0da Added the tar plugin --- diff --git a/plugins/tar/after_content.php b/plugins/tar/after_content.php new file mode 100644 index 0000000..8629df6 --- /dev/null +++ b/plugins/tar/after_content.php @@ -0,0 +1,5 @@ + +
+">Download all files in this directory +
+ diff --git a/plugins/tar/tar.php b/plugins/tar/tar.php new file mode 100644 index 0000000..9395e41 --- /dev/null +++ b/plugins/tar/tar.php @@ -0,0 +1,45 @@ +&1"); +preg_match('/^Total bytes written: ([0-9]+) /', $out, $matches); +$totalsize = $matches[1]; + +#$out = exec("du -c $filesarg"); +#preg_match('/^([0-9]+).*total$/', $out, $matches); +#$totalsize = $matches[1] * 1024; + +#var_dump($totalsize); + +#var_dump("tar --no-recursion -c $filesarg"); +#die(); + +header("Content-Length: $totalsize"); +header('Content-Type: application/x-tar'); +header('Content-Disposition: attachment; filename="'.basename($realDir).'.tar"'); + +passthru("tar --no-recursion -c $filesarg"); + +?> diff --git a/template.php b/template.php index 90ca799..34443c2 100644 --- a/template.php +++ b/template.php @@ -74,6 +74,8 @@ a {
">
+ +

Generated by Bizou