From: Michael M Slusarz Date: Thu, 19 Feb 2009 06:48:18 +0000 (-0700) Subject: Use Gnumeric for Excel conversion X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d05ffa259570307bbf1f651fcbd65303d7adf6cb;p=horde.git Use Gnumeric for Excel conversion --- diff --git a/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php b/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php index 28e9c511f..c57df8ccd 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php +++ b/framework/Mime/lib/Horde/Mime/Viewer/msexcel.php @@ -39,20 +39,17 @@ class Horde_Mime_Viewer_msexcel extends Horde_Mime_Viewer_Driver return array(); } - $data = ''; $tmp_xls = Horde::getTempFile('horde_msexcel'); + $tmp_out = Horde::getTempFile('horde_msexcel'); file_put_contents($tmp_xls, $this->_mimepart->getContents()); + $args = ' -E Gnumeric_Excel:excel_dsf -T Gnumeric_html:html40 ' . $tmp_xls . ' ' . $tmp_out; - $fh = popen($this->_conf['location'] . " -nh $tmp_xls 2>&1", 'r'); - while (($rc = fgets($fh, 8192))) { - $data .= $rc; - } - pclose($fh); + exec($this->_conf['location'] . $args); return array( $this->_mimepart->getMimeId() => array( - 'data' => $data, + 'data' => file_get_contents($tmp_out), 'status' => array(), 'type' => 'text/html; charset=' . NLS::getCharset() ) diff --git a/framework/Mime/package.xml b/framework/Mime/package.xml index ff06f03ed..fcd8d3a22 100644 --- a/framework/Mime/package.xml +++ b/framework/Mime/package.xml @@ -31,7 +31,9 @@ http://pear.php.net/dtd/package-2.0.xsd"> alpha LGPL - * Add support for decoding IDN (RFC 3490) names (Request #5836). + * Use Gnumeric to display MS Excel documents. + * Use AbiWord to display MS Word documents (Request #8011). + * Add support for decoding IDN (RFC 3490) names (Request #5836). * Initial package.