Update of /cvsroot/mantisbt/manual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32187
Modified Files:
extract_to_file.php
Log Message:
Exporting manual to disk will also create a ZIP file in that same directory.
Index: extract_to_file.php
===================================================================
RCS file: /cvsroot/mantisbt/manual/extract_to_file.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- extract_to_file.php 15 Feb 2005 19:22:43 -0000 1.9
+++ extract_to_file.php 15 Feb 2005 19:44:41 -0000 1.10
@@ -1,4 +1,5 @@
<?php require( "core.php" ); ?>
+<?php include( "zip.php" ); ?>
<?php
# GLOBAL OVERRIDES, don't touch unless you know what you are doing.
# Affects the way wiki-style links are generated.
@@ -19,6 +20,9 @@
exit;
}
+ # generate zip to save on disk for offline downloads
+ $zip = new zipfile();
+
echo '<pre>';
echo "Generating to '$g_manual_save_dir'...<br />";
@@ -35,6 +39,11 @@
flush();
$content = get_item_content( $item_id );
+
+ # add to zip
+ $zip->addFile( $content,'manual/'.$filename, time() );
+
+ # write file to disk
$fp = fopen( $g_manual_save_dir.$filename, 'wb' );
fwrite( $fp, $content );
fclose( $fp );
@@ -43,12 +52,28 @@
# copy over the .css file
echo '... manual.css<br />';
copy( 'manual.css', $g_manual_save_dir.'manual.css' );
+ $item_count++;
+
+ # add .css to zip
+ $fp = fopen( 'manual.css', 'rb' );
+ $content = implode( '', file('manual.css') );
+ $zip->addFile( $content,'manual/manual.css',time() );
# copy over the image file
echo '... mantis_logo.gif<br />';
copy( 'images/mantis_logo.gif', $g_manual_save_dir.'mantis_logo.gif' );
$item_count++;
+ # add .gif to zip
+ $fp = fopen( 'images/mantis_logo.gif', 'rb' );
+ $content = implode( '', file('images/mantis_logo.gif') );
+ $zip->addFile( $content,'manual/mantis_logo.gif',time() );
+
+ # save zip file in same dir as manual
+ $fp = fopen( $g_manual_save_dir.'manual.zip', 'wb' );
+ fwrite( $fp, $zip->file());
+ fclose( $fp );
+
echo "$item_count file(s) generated successfully.<br />";
echo '</pre>';
?>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|