Menu

#5 Save ODS using ZipArchive class

open
nobody
None
5
2009-12-15
2009-12-15
No

The way used to generate the ODS (executing a 'zip' command against a temporary directory ) seems a bit risky and very platform dependant.
I have changed it to use PHP'z ZipArchive class (included in zip enables PHP 5.2.0 and superior. Also available as extension for older PHP ).

Discussion

  • Jim A. Fieser

    Jim A. Fieser - 2009-12-29

    I am interested in this new development. Where would I download your recent modifications?

     
  • Jim A. Fieser

    Jim A. Fieser - 2009-12-29

    Oh, I see the diff now. Nevermind

     
  • Jim A. Fieser

    Jim A. Fieser - 2009-12-30

    This works very well for saveOds. The parseOds function continues to use the tmp file and a UID directory.

     
  • Igor Blanco González

    Whoops! I don't use it so I didn't pay attention to parseOds, try this:

    function parseOds($file) {
    $zip = new ZipArchive();
    $ok = $zip->open($file);
    if (false == $ok) {
    return false;
    }
    $content = $zip->getFromName('content.xml');
    $obj = new ods();
    $obj->parse($content);
    return $obj;
    }

    Let me now if it works in order to rebuild the diff.

     
  • Igor Blanco González

    saveOds and parseOds modified

     
  • Igor Blanco González

    It seems it works, I have changed the patch.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.