logo       

manual extract_to_file.php,1.9,1.10: msg#00059

Subject: manual extract_to_file.php,1.9,1.10
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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe