Zend Framework

ZipArchive::getFromName() problem

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.1
  • Fix Version/s: 1.9.6
  • Component/s: Zend_Search_Lucene
  • Labels:
    None

Description

I've been putting together a search interface using Zend_Search_Lucene. I've more or less been following these instructions: http://framework.zend.com/manual/en/zend.search.lucene.html#zend.search.lucene.index-creation.docx-documents

I have php_zip enabled and am running php 5.2.9-1.

When I run code that looks like this:
$doc = Zend_Search_Lucene_Document_Docx::loadDocxFile($doc_filenameandpath);
$index->addDocument($doc);

I am getting the following warnings:

Warning: ZipArchive::getFromName() [ziparchive.getfromname]: Invalid or unitialized Zip object in D:\wamp\www\ZendFramework-1.9.1\library\Zend\Search\Lucene\Document\Docx.php on line 61

Warning: Invalid argument supplied for foreach() in D:\wamp\www\ZendFramework-1.9.1\library\Zend\Search\Lucene\Document\Docx.php on line 62

Warning: ZipArchive::getFromName() [ziparchive.getfromname]: Invalid or unitialized Zip object in D:\wamp\www\ZendFramework-1.9.1\library\Zend\Search\Lucene\Document\OpenXml.php on line 87

Warning: Invalid argument supplied for foreach() in D:\wamp\www\ZendFramework-1.9.1\library\Zend\Search\Lucene\Document\OpenXml.php on line 88

Warning: ZipArchive::close() [ziparchive.close]: Invalid or unitialized Zip object in D:\wamp\www\ZendFramework-1.9.1\library\Zend\Search\Lucene\Document\Docx.php on line 103

NB. The nearest reference I can find to a similar problem on the issue tracker is this one:
http://framework.zend.com/issues/browse/ZF-5730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
...but it doesn't really help much. I implemented the two patch files
standard/trunk/library/Zend/Search/Lucene/Document/Docx.php
standard/trunk/library/Zend/Search/Lucene/Document/Exception.php
but things got worse:
"Fatal error: Cannot redeclare class Zend_Search_Lucene_Document_OpenXml in D:\wamp\www\ZendFramework-1.9.1\library\Zend\Search\Lucene\Document\OpenXml.php on line 38"

Activity

Hide
Michael Casey added a comment -

Problem resolved.

I was attempting to index files of type .doc. Zend_Search_Lucene can only index files of type .docx.

Show
Michael Casey added a comment - Problem resolved. I was attempting to index files of type .doc. Zend_Search_Lucene can only index files of type .docx.
Hide
Alexander Veremyev added a comment -

Fixed. Correct exception is thrown now.

Show
Alexander Veremyev added a comment - Fixed. Correct exception is thrown now.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: