Re: [fw-general] loading non-ZF classes using autoloader

2008-01-09 Thread Matthew Weier O'Phinney
-- Ken Petri [EMAIL PROTECTED] wrote
(on Tuesday, 08 January 2008, 09:54 PM -0800):
 I would like to use DOMPDF with Zend Framework. DOMPDF has its own autoloader
 (called DOMPDF_autoload) that loads necessary class files so the user can
 instantiate the main DOMPDF class (called, yes, you guessed it, DOMPDF). 
 
 I have the DOMPDF files in a directory called library at the root of my ZF
 application tree. 
 
 I am able to use require_once to load the configuration file for DOMPDF--the
 config file is found and no errors occur. However, when I try to new a
 DOMPDF instance, ZF complains that Class 'DOMPDF' was not found in my
 controller. 
 
 I believe that to make DOMPDF work, I need to use the DOMPDF autoloader, but
 I can't figure out how to do this within ZF. 
 
 FYI, in my index.php bootstrap file, I am using
 Zend_Loader::registerAutoload() so that I don't have to manually load ZF
 classes before using them.
 
 Any help is greatly appreciated. Thank you!

I can't be certain, as I don't know the DOMPDF code, but you should be
able to load it as an additional spl_autoload handler:

require_once 'Zend/Loader.php';
require_once 'path/to/file/containing/DOMPDF_autoload...';
Zend_Loader::registerAutoload();
spl_autoload_register('DOMPDF_autoload');

spl_autoload() is an improvement over __autoload() precisely for
situations like this, where you need to mix and match libraries that
have their own autoloading logic, and is why we adopted it in ZF.

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


[fw-general] Zend_Search_Lucene_Search_QueryLexer: E_NOTICE on invalid query

2008-01-09 Thread Stefan Oestreicher

Hi,

lucene raises a notice if the following invalid query is supplied to the
parser: dgdsdsg#+ü\ 

This happens in the QueryLexer on line 477 (addLexemeChar) where an element
of $this-_queryString is accessed with $this-_queryStringPosition as key
without checking if that key is a valid index.

best regards,

Stefan Oestreicher
 
--
Dr. Maté GmbH
Stefan Oestreicher / Entwicklung
[EMAIL PROTECTED]
http://www.netdoktor.at
Tel Buero: + 43 1 405 55 75 24
Fax Buero: + 43 1 405 55 75 55
Alser Str. 4 1090 Wien Altes AKH Hof 1 1.6.6



[fw-general] little bug in url view helper

2008-01-09 Thread Gunter Sammet
Hi all:
Been banging my head with this one. Some of my code broke after the
last update to then current CVS. Ended up being changes to the url
view helper. If you pass in parameters as null, they should be removed
by the assemble method (undocumented feature but I assume it's
intended). however, recent changes to urlencode the urlOptions broke
this behaviour. the php function urlencode returns an empty string. So
the route-assemble method doesn't know anymore that it was null. I
suggest the following fix:

if ($encode) {
foreach ($urlOptions as $key = $option) {
if(null === $option){
$urlOptions[$key] = $option;
}else{
$urlOptions[$key] = urlencode($option);
}
}
}

Unless there is an issue with unencoded null values (which I can't
picture), this should solve the issue without causing any
compatibility issues.

Anybody out there that can commit this fix?
Thanks,

Gunter