Re: Quickform registerElement : include_once Fatal Error

From: Date: Mon, 28 Aug 2006 14:27:37 +0000
Subject: Re: Quickform registerElement : include_once Fatal Error
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-25001@lists.php.net to get a copy of this message
On 8/27/06, Noel da Costa <noel.dacosta@magharl.co.uk> wrote:
Hi there, I'm working with PEAR QuickForm.. I've defined my own custom element type, which has been written as a class extension to the Quickform element 'textarea' I've got the class stored in my docroot and I'm including it via this..
        require_once realpath('.').'/FCKeditor/HTML_Quickform_fckeditor.php';
...which works fine.. however, when I try to add the element to my quickform I get this error..
        FATAL [/usr/lib/php/HTML/QuickForm.php:566] _loadelement(HTML/
QuickForm/fckeditor.php): failed to open stream: No such file or directory ... line 566 is this:
        include_once($includeFile);
...which is PHP trying to find the element class from where Quickform expects to see it and failing... However (big however!!)... include_once is supposed to produce a warning, not a FATAL error!!
That is odd.
what's going on?.. .this is PHP v4.4.1 and QuickForm 3.2.5 The strange thing is I've used this include method before successfully (altho it was PHP4.3.10 and QuickForm 3.2.4p11)
However, what this really means is that you're not registering your element correctly. If you register your element right then you won't have this problem. Note: I also don't think using realpath('.') to include is a good idea. It's error prone and probably part of your problem. Put the directory this file is in in your include_path and include it relatively. -- Justin Patrin

« previous php.pear.general (#25001) next »