Forum

JiFile for Joomla!

JIFile
JiFile is a component for Joomla! that allows you to index file contents (PDF, DOC, etc..) to perform searches in them.

Learn more...  Demo

JoomPhoto Mobile

JPhotoMobile
JoomPhoto Mobile is a component for Joomla! that allows you to share the photos from your Android device to your site Joomla.

Learn more...  Demo

iFile Framework

IFile
IFile is an open source framework written entirely in PHP, allows the indexing of textual content of a document (DOC, PDF, EXCEL, etc.) and a quick search within them.

Learn more...  Demo

Easy Language

EasyLanguage
Easy Language is a plugin for easy and immediate management of multilingual texts in every possible area of joomla, articles, components, modules, metadata, template, other components(example K2) etc.

Learn more...

Article Book Effect

Article Book Effect
View Joomla articles with the effect turns the page of a book. This plugin will display the contents of an article in Joomla as a real book or magazine, using all the benefits of HTML5

Learn more...  Demo

 

Passport photo

Passport photo
The most popular Android app that allows you to print photos cards for your documents with your Android smartphone, in a simple and intuitive way.

Learn more...

 

Crazy Shadow

Crazy Shadow
Crazy Shadow is the 3D fast-paced and fun puzzle Android game! Try to rotate and drag shapes in the position of their shadows without fail! Solve in succession all combinations of levels of the game.

Learn more...

 

Admin Countdown

Admin Countdown
Module for Joomla! 2.5 and 3.x displays in the administration part of the site, a timer with countdown of the time remaining in your session.

Learn more...  Demo

 
Welcome, Guest
Username: Password: Remember me

TOPIC: Syntax error e Uninitialized string offset

Syntax error e Uninitialized string offset 02 Jan 2012 11:37 #46

  • trullox
  • trullox's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
ciao,
quando avvio l' indicizzazione dei miei file, ottengo diversi PHP Parse Error e PHP Notice.
In particolare le seguenti due tipologie:
PHP Parse error:  syntax error, unexpected '$' in /var/www/html/ifile/ifile/IFile_Indexing_Mysqli.php(1170) : eval()'d code on line 1
PHP Stack trace:
PHP   1. {main}() /var/www/html/ifile/indicizza.php:0
PHP   2. IFile_Indexing_Abstract->addDocument() /var/www/html/ifile/indicizza.php:89
PHP   3. IFile_Indexing_Mysqli->__addDocument() /var/www/html/ifile/ifile/IFile_Indexing_Abstract.php:168
PHP   4. IFile_Indexing_Mysqli->input_mysqli() /var/www/html/ifile/ifile/IFile_Indexing_Mysqli.php:186
PHP Notice:  Uninitialized string offset:  512 in /var/www/html/ifile/ifile/adapter/helpers/class.doc2txt.php on line 61
PHP Stack trace:
PHP   1. {main}() /var/www/html/ifile/indicizza.php:0
PHP   2. IFile_Indexing_Abstract->addDocument() /var/www/html/ifile/indicizza.php:89
PHP   3. IFile_Indexing_Abstract->__createDocumentFromFile() /var/www/html/ifile/ifile/IFile_Indexing_Abstract.php:131
PHP   4. Adapter_Search_Lucene_Document_DOC->loadParserFile() /var/www/html/ifile/ifile/IFile_Indexing_Abstract.php:289
PHP   5. Adapter_Search_Lucene_Document_DOC->parse() /var/www/html/ifile/ifile/adapter/Adapter_Search_Lucene_Document_DOC.php:45
PHP   6. PHPWordLib->LoadFile() /var/www/html/ifile/ifile/adapter/Adapter_Search_Lucene_Document_DOC.php:67
PHP   7. PHPWordLib->CheckWordFormat() /var/www/html/ifile/ifile/adapter/helpers/class.doc2txt.php:53
ovviamente non sono errori gravi e l'indicizzazione non si ferma, ma da cosa possono dipendere?

grazie
Andrea
The administrator has disabled public write access.

Re: Syntax error e Uninitialized string offset 02 Jan 2012 12:23 #47

  • Giampaolo
  • Giampaolo's Avatar
  • OFFLINE
  • Administrator
  • Posts: 465
  • Thank you received: 43
Ciao Andrea,
Per il primo errore, il problema riguarda il processo per la creazione delle variabili di bind delle query.

Ad oggi è ancora presente l'utilizzo della eval() (ma è un punto su cui stiamo lavorando, a breve dovremmo eliminare la chiamata alla funzione "eval()", che è molto potente, utile, ma che potrebbe portare problemi se utilizzata male).

Quando cerca si creare dinamicamente le variabili di bind qualche nome potrebbe dargli problemi e quindi non riesce a costruire correttamente la variabile, potresti se riesci a stampare a video il nome della variabile che cerca di creare per capire quale potrebbe essere il problema.
Comunque anche se non ti dovesse interrompere il processo di indicizzazion, fai attenzione a questo punto (sul file in cui si verifica il problema) se realmente ti ha scritto correttamente il record nel DB.

Il secondo problema, rigurda la classe per la parserizzazione dei DOC.
La classe cerca di recuperare il carattere presente nella posizione 512 per verificare se è un file di tipo DOC (vedi il file class.doc2txt.php alla linea 61).

Probabilmente la stringa recuperata (il contenuto del file) non ha valore di offset per la posizione 512 e quindi PHP ti avvisa con un notice dato che una stringa in PHP si può pensare anche come un array di caratteri.
La classe dovrebbe comunque ritornare un errore di file non in formato DOC.

Una soluzione per evitare ciò potrebbe essere quella di inserire prima un controllo sull'esistenza del offset 512 (anche per gli offset dei controlli successivi), oppure si può integrare la @ per tutte le righe della funzione di controllo per evitare che vengano presentati a video questi Notice.

Probabilmente nella prossima versione andremo a sistemare anche questa piccola anomalia.

Come sempre grazie per il tuo supporto.
If you like, if it was useful, consider a donation, Thanks
Se vuoi, se ti siamo stati utili, considera una donazione, Grazie
Help us by voting our extensions on Joomla.org:
JiFile
JoomPhoto Mobile
Easy Language
The administrator has disabled public write access.