Zend_Validate_Hostname trying to load non-existent class

6 messages Options
Embed this post
Permalink
Ryan Boyd-3

Zend_Validate_Hostname trying to load non-existent class

Reply Threaded More More options
Print post
Permalink
Hi Nico,

That class name is dynamically created and I'm not sure why the code is taking that path.

What version (svn rev or download) are you using?  Looking at the latest copy from svn, that code in Zend_Validate_Hostname is actually inside a do {} while (false); block.

Cheers,
-Ryan



On Wed, Jun 11, 2008 at 9:18 AM, nico dotti <[hidden email]> wrote:
Hello all,

I just joined and I thought I had sent this out already but I guess
not. I get an error when trying to run the Calendar example. I don't
even see the Zend/Validate/Hostname/Com.php in the framework so I'm
baffled:

fopen(Zend/Validate/Hostname/Com.php) [<a
href='function.fopen'>function.fopen</a>]: failed to open stream: No
such file or directory
Error Type:   E_WARNING

Rendered Page:   Click here to view contents able to be rendered

Source File:   /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php
   Line:   160

Line 155:         * @param string   $filename
Line 156:         * @return boolean
Line 157:         */
Line 158:        public static function isReadable($filename)
Line 159:        {
Line 160:            if (!$fh = @fopen($filename, 'r', true)) {
Line 161:                return false;
Line 162:            }
Line 163:
Line 164:            return true;
Line 165:        }


Call Stack:

#0 (): QcodoHandleError()
#1 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php(160): fopen()
#2 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Validate/Hostname.php(336):
Zend_Loader::isReadable()
#3 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(354):
Zend_Validate_Hostname->isValid()
#4 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(185):
Zend_Uri_Http->validateHost()
#5 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(96):
Zend_Uri_Http->valid()
#6 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri.php(117):
Zend_Uri_Http->__construct()
#7 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Http/Client.php(223):
Zend_Uri::factory()
#8 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Gdata/ClientLogin.php(96):
Zend_Http_Client->setUri()
#9 /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(202):
Zend_Gdata_ClientLogin::getHttpClient()
#10 /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(827):
getClientLoginHttpClient()

Thanks for any attempt to give me info.

nico dotti

Re: Zend_Validate_Hostname trying to load non-existent class

Reply Threaded More More options
Print post
Permalink
Thanks Ryan,

Perhaps I'll have to do a checkout from the svn, I'm using what I
thought was the stable release posted from the downloads section
version 1.5. Zend Framework 1.5.2  2008-05-15. Wow, that would be a
trip if I had to use the repository version to get it working, I would
think the repository version would be more 'bleeding edge' and not bug
fixes ;) I know, it's open source LOL.
I did get the functionality working with cURL so I may be going that route.

Thanks again though for your reply Ryan.

Nico

On Wed, Jun 11, 2008 at 11:39 AM, Ryan Boyd <[hidden email]> wrote:

> Hi Nico,
> That class name is dynamically created and I'm not sure why the code is
> taking that path.
> What version (svn rev or download) are you using?  Looking at the latest
> copy from svn, that code in Zend_Validate_Hostname is actually inside a do
> {} while (false); block.
> Cheers,
> -Ryan
>
>
> On Wed, Jun 11, 2008 at 9:18 AM, nico dotti <[hidden email]> wrote:
>>
>> Hello all,
>>
>> I just joined and I thought I had sent this out already but I guess
>> not. I get an error when trying to run the Calendar example. I don't
>> even see the Zend/Validate/Hostname/Com.php in the framework so I'm
>> baffled:
>>
>> fopen(Zend/Validate/Hostname/Com.php) [<a
>> href='function.fopen'>function.fopen</a>]: failed to open stream: No
>> such file or directory
>> Error Type:   E_WARNING
>>
>> Rendered Page:   Click here to view contents able to be rendered
>>
>> Source File:   /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php
>>    Line:   160
>>
>> Line 155:         * @param string   $filename
>> Line 156:         * @return boolean
>> Line 157:         */
>> Line 158:        public static function isReadable($filename)
>> Line 159:        {
>> Line 160:            if (!$fh = @fopen($filename, 'r', true)) {
>> Line 161:                return false;
>> Line 162:            }
>> Line 163:
>> Line 164:            return true;
>> Line 165:        }
>>
>>
>> Call Stack:
>>
>> #0 (): QcodoHandleError()
>> #1 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php(160):
>> fopen()
>> #2
>> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Validate/Hostname.php(336):
>> Zend_Loader::isReadable()
>> #3 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(354):
>> Zend_Validate_Hostname->isValid()
>> #4 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(185):
>> Zend_Uri_Http->validateHost()
>> #5 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(96):
>> Zend_Uri_Http->valid()
>> #6 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri.php(117):
>> Zend_Uri_Http->__construct()
>> #7 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Http/Client.php(223):
>> Zend_Uri::factory()
>> #8
>> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Gdata/ClientLogin.php(96):
>> Zend_Http_Client->setUri()
>> #9
>> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(202):
>> Zend_Gdata_ClientLogin::getHttpClient()
>> #10
>> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(827):
>> getClientLoginHttpClient()
>>
>> Thanks for any attempt to give me info.
>
>
Ryan Boyd-3

Re: Zend_Validate_Hostname trying to load non-existent class

Reply Threaded More More options
Print post
Permalink


On Wed, Jun 11, 2008 at 12:07 PM, nico dotti <[hidden email]> wrote:
Thanks Ryan,

Perhaps I'll have to do a checkout from the svn, I'm using what I
thought was the stable release posted from the downloads section
version 1.5. Zend Framework 1.5.2  2008-05-15. Wow, that would be a
trip if I had to use the repository version to get it working, I would
think the repository version would be more 'bleeding edge' and not bug
fixes ;) I know, it's open source LOL.
I did get the functionality working with cURL so I may be going that route.

Hi Nico,

Sorry if I implied that you have to use SVN -- you shouldn't have to.  Your presumptions are exactly correct (svn is for bleeding edge, releases should be for stable usage).

Having the version info helps me look at the specific version to see why you could be hitting this.

I'll write back soon with what I find.

Cheers,
-Ryan
 


Thanks again though for your reply Ryan.

Nico

On Wed, Jun 11, 2008 at 11:39 AM, Ryan Boyd <[hidden email]> wrote:
> Hi Nico,
> That class name is dynamically created and I'm not sure why the code is
> taking that path.
> What version (svn rev or download) are you using?  Looking at the latest
> copy from svn, that code in Zend_Validate_Hostname is actually inside a do
> {} while (false); block.
> Cheers,
> -Ryan
>
>
> On Wed, Jun 11, 2008 at 9:18 AM, nico dotti <[hidden email]> wrote:
>>
>> Hello all,
>>
>> I just joined and I thought I had sent this out already but I guess
>> not. I get an error when trying to run the Calendar example. I don't
>> even see the Zend/Validate/Hostname/Com.php in the framework so I'm
>> baffled:
>>
>> fopen(Zend/Validate/Hostname/Com.php) [<a
>> href='function.fopen'>function.fopen</a>]: failed to open stream: No
>> such file or directory
>> Error Type:   E_WARNING
>>
>> Rendered Page:   Click here to view contents able to be rendered
>>
>> Source File:   /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php
>>    Line:   160
>>
>> Line 155:         * @param string   $filename
>> Line 156:         * @return boolean
>> Line 157:         */
>> Line 158:        public static function isReadable($filename)
>> Line 159:        {
>> Line 160:            if (!$fh = @fopen($filename, 'r', true)) {
>> Line 161:                return false;
>> Line 162:            }
>> Line 163:
>> Line 164:            return true;
>> Line 165:        }
>>
>>
>> Call Stack:
>>
>> #0 (): QcodoHandleError()
>> #1 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php(160):
>> fopen()
>> #2
>> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Validate/Hostname.php(336):
>> Zend_Loader::isReadable()
>> #3 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(354):
>> Zend_Validate_Hostname->isValid()
>> #4 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(185):
>> Zend_Uri_Http->validateHost()
>> #5 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(96):
>> Zend_Uri_Http->valid()
>> #6 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri.php(117):
>> Zend_Uri_Http->__construct()
>> #7 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Http/Client.php(223):
>> Zend_Uri::factory()
>> #8
>> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Gdata/ClientLogin.php(96):
>> Zend_Http_Client->setUri()
>> #9
>> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(202):
>> Zend_Gdata_ClientLogin::getHttpClient()
>> #10
>> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(827):
>> getClientLoginHttpClient()
>>
>> Thanks for any attempt to give me info.
>
>

Ryan Boyd-3

Re: Zend_Validate_Hostname trying to load non-existent class

Reply Threaded More More options
Print post
Permalink
Hi Nico,

Okay, I've looked into this a bit further.

It looks like something in your code is overriding the error handling, so even though Zend/Loader.php:160 is intentionally suppressing any errors that occur, the code is ignoring that suppression.

What's happening here:
The Zend_Validate_Hostname code is capable of having per-top-level-domain validation.  It looks like this is primarily intended for international domain names, so there is no separate logic for '.com' extensions.  The Zend_Validate_Hostname code is checking to see whether a file with the name Zend/Validate/Hostname/Com.php is readable by calling Zend_Loader::isReadable($filename), which is in turn checking whether fopen succeeds.  For a vanilla PHP script/install, this will return false and move forward with execution because the '@' suppresses any errors from occurring.  However, something in your script is actually overriding the error handling and causing that error to be thrown -- even though the suppression operator was used.

This PHP manual page has more information on error suppression:
http://us.php.net/operators.errorcontrol

Cheers,
-Ryan




On Wed, Jun 11, 2008 at 12:12 PM, Ryan Boyd <[hidden email]> wrote:


On Wed, Jun 11, 2008 at 12:07 PM, nico dotti <[hidden email]> wrote:
Thanks Ryan,

Perhaps I'll have to do a checkout from the svn, I'm using what I
thought was the stable release posted from the downloads section
version 1.5. Zend Framework 1.5.2  2008-05-15. Wow, that would be a
trip if I had to use the repository version to get it working, I would
think the repository version would be more 'bleeding edge' and not bug
fixes ;) I know, it's open source LOL.
I did get the functionality working with cURL so I may be going that route.

Hi Nico,

Sorry if I implied that you have to use SVN -- you shouldn't have to.  Your presumptions are exactly correct (svn is for bleeding edge, releases should be for stable usage).

Having the version info helps me look at the specific version to see why you could be hitting this.

I'll write back soon with what I find.

Cheers,
-Ryan
 


Thanks again though for your reply Ryan.

Nico

On Wed, Jun 11, 2008 at 11:39 AM, Ryan Boyd <[hidden email]> wrote:
> Hi Nico,
> That class name is dynamically created and I'm not sure why the code is
> taking that path.
> What version (svn rev or download) are you using?  Looking at the latest
> copy from svn, that code in Zend_Validate_Hostname is actually inside a do
> {} while (false); block.
> Cheers,
> -Ryan
>
>
> On Wed, Jun 11, 2008 at 9:18 AM, nico dotti <[hidden email]> wrote:
>>
>> Hello all,
>>
>> I just joined and I thought I had sent this out already but I guess
>> not. I get an error when trying to run the Calendar example. I don't
>> even see the Zend/Validate/Hostname/Com.php in the framework so I'm
>> baffled:
>>
>> fopen(Zend/Validate/Hostname/Com.php) [<a
>> href='function.fopen'>function.fopen</a>]: failed to open stream: No
>> such file or directory
>> Error Type:   E_WARNING
>>
>> Rendered Page:   Click here to view contents able to be rendered
>>
>> Source File:   /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php
>>    Line:   160
>>
>> Line 155:         * @param string   $filename
>> Line 156:         * @return boolean
>> Line 157:         */
>> Line 158:        public static function isReadable($filename)
>> Line 159:        {
>> Line 160:            if (!$fh = @fopen($filename, 'r', true)) {
>> Line 161:                return false;
>> Line 162:            }
>> Line 163:
>> Line 164:            return true;
>> Line 165:        }
>>
>>
>> Call Stack:
>>
>> #0 (): QcodoHandleError()
>> #1 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php(160):
>> fopen()
>> #2
>> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Validate/Hostname.php(336):
>> Zend_Loader::isReadable()
>> #3 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(354):
>> Zend_Validate_Hostname->isValid()
>> #4 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(185):
>> Zend_Uri_Http->validateHost()
>> #5 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(96):
>> Zend_Uri_Http->valid()
>> #6 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri.php(117):
>> Zend_Uri_Http->__construct()
>> #7 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Http/Client.php(223):
>> Zend_Uri::factory()
>> #8
>> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Gdata/ClientLogin.php(96):
>> Zend_Http_Client->setUri()
>> #9
>> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(202):
>> Zend_Gdata_ClientLogin::getHttpClient()
>> #10
>> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(827):
>> getClientLoginHttpClient()
>>
>> Thanks for any attempt to give me info.
>
>


nico dotti

Re: Zend_Validate_Hostname trying to load non-existent class

Reply Threaded More More options
Print post
Permalink
Hello Ryan, perhaps it's because I'm using QCodo and it is definitely
doing error handling (I see the qcodo blue'ish purple template when I
get my errors).

FWIW, here's the errors 'qcodo' header output (not http header of course):
Error in PHP Script
/rlevin//test/gdata_tests/testZend.php PHP Version: 5.2.6;  Zend
Engine Version: 2.2.0;  Qcodo Version: 0.3.21 (Qcodo Beta 3)
Application: Apache/2.2.8 (Unix) PHP/5.2.6;  Server Name: mappily.aeriodev.com
HTTP User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14)
Gecko/20080404 Firefox/2.0.0.14

Also, here's some more information I get when running the qcodo codegen:
Qcodo Development Framework 0.3.21 (Qcodo Beta 3)
Code Generator PHP Version: 5.2.6;  Zend Engine Version: 2.2.0;
Qcodo Version: 0.3.21 (Qcodo Beta 3)
Application: Apache/2.2.8 (Unix) PHP/5.2.6;  Server Name: mappily.aeriodev.com
Code Generated: Wednesday, June 11 2008, 2:37:31 PM

My boss is in love with qcodo so I'm pretty much stuck using this (not
to complain, I like a lot of aspects of it too). However, this isn't
the first 'snafu' I've run into with this. Qcodo's framework actually
calls start_session and other 'control-freakish' like things. I seem
to remember needing to lower the error reporting levels to get PEAR
HTTP request to work and QCodo wouldn't let me. Oh well. The good news
is I'm pretty far along with doing this with cURL raw http and
probably learning more that way (though I'd really love to not have to
do all of the parsing and error handling myself)

Thanks again Ryan.

Nico

On Wed, Jun 11, 2008 at 12:50 PM, Ryan Boyd <[hidden email]> wrote:

> Hi Nico,
>
> Okay, I've looked into this a bit further.
>
> It looks like something in your code is overriding the error handling, so
> even though Zend/Loader.php:160 is intentionally suppressing any errors that
> occur, the code is ignoring that suppression.
>
> What's happening here:
> The Zend_Validate_Hostname code is capable of having per-top-level-domain
> validation.  It looks like this is primarily intended for international
> domain names, so there is no separate logic for '.com' extensions.  The
> Zend_Validate_Hostname code is checking to see whether a file with the name
> Zend/Validate/Hostname/Com.php is readable by calling
> Zend_Loader::isReadable($filename), which is in turn checking whether fopen
> succeeds.  For a vanilla PHP script/install, this will return false and move
> forward with execution because the '@' suppresses any errors from
> occurring.  However, something in your script is actually overriding the
> error handling and causing that error to be thrown -- even though the
> suppression operator was used.
>
> This PHP manual page has more information on error suppression:
> http://us.php.net/operators.errorcontrol
>
> Cheers,
> -Ryan
>
>
>
>
> On Wed, Jun 11, 2008 at 12:12 PM, Ryan Boyd <[hidden email]> wrote:
>>
>>
>> On Wed, Jun 11, 2008 at 12:07 PM, nico dotti <[hidden email]> wrote:
>>>
>>> Thanks Ryan,
>>>
>>> Perhaps I'll have to do a checkout from the svn, I'm using what I
>>> thought was the stable release posted from the downloads section
>>> version 1.5. Zend Framework 1.5.2  2008-05-15. Wow, that would be a
>>> trip if I had to use the repository version to get it working, I would
>>> think the repository version would be more 'bleeding edge' and not bug
>>> fixes ;) I know, it's open source LOL.
>>> I did get the functionality working with cURL so I may be going that
>>> route.
>>
>> Hi Nico,
>>
>> Sorry if I implied that you have to use SVN -- you shouldn't have to.
>> Your presumptions are exactly correct (svn is for bleeding edge, releases
>> should be for stable usage).
>>
>> Having the version info helps me look at the specific version to see why
>> you could be hitting this.
>>
>> I'll write back soon with what I find.
>>
>> Cheers,
>> -Ryan
>>
>>>
>>>
>>> Thanks again though for your reply Ryan.
>>>
>>> Nico
>>>
>>> On Wed, Jun 11, 2008 at 11:39 AM, Ryan Boyd <[hidden email]> wrote:
>>> > Hi Nico,
>>> > That class name is dynamically created and I'm not sure why the code is
>>> > taking that path.
>>> > What version (svn rev or download) are you using?  Looking at the
>>> > latest
>>> > copy from svn, that code in Zend_Validate_Hostname is actually inside a
>>> > do
>>> > {} while (false); block.
>>> > Cheers,
>>> > -Ryan
>>> >
>>> >
>>> > On Wed, Jun 11, 2008 at 9:18 AM, nico dotti <[hidden email]>
>>> > wrote:
>>> >>
>>> >> Hello all,
>>> >>
>>> >> I just joined and I thought I had sent this out already but I guess
>>> >> not. I get an error when trying to run the Calendar example. I don't
>>> >> even see the Zend/Validate/Hostname/Com.php in the framework so I'm
>>> >> baffled:
>>> >>
>>> >> fopen(Zend/Validate/Hostname/Com.php) [<a
>>> >> href='function.fopen'>function.fopen</a>]: failed to open stream: No
>>> >> such file or directory
>>> >> Error Type:   E_WARNING
>>> >>
>>> >> Rendered Page:   Click here to view contents able to be rendered
>>> >>
>>> >> Source File:
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php
>>> >>    Line:   160
>>> >>
>>> >> Line 155:         * @param string   $filename
>>> >> Line 156:         * @return boolean
>>> >> Line 157:         */
>>> >> Line 158:        public static function isReadable($filename)
>>> >> Line 159:        {
>>> >> Line 160:            if (!$fh = @fopen($filename, 'r', true)) {
>>> >> Line 161:                return false;
>>> >> Line 162:            }
>>> >> Line 163:
>>> >> Line 164:            return true;
>>> >> Line 165:        }
>>> >>
>>> >>
>>> >> Call Stack:
>>> >>
>>> >> #0 (): QcodoHandleError()
>>> >> #1 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php(160):
>>> >> fopen()
>>> >> #2
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Validate/Hostname.php(336):
>>> >> Zend_Loader::isReadable()
>>> >> #3 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(354):
>>> >> Zend_Validate_Hostname->isValid()
>>> >> #4 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(185):
>>> >> Zend_Uri_Http->validateHost()
>>> >> #5 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(96):
>>> >> Zend_Uri_Http->valid()
>>> >> #6 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri.php(117):
>>> >> Zend_Uri_Http->__construct()
>>> >> #7
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Http/Client.php(223):
>>> >> Zend_Uri::factory()
>>> >> #8
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Gdata/ClientLogin.php(96):
>>> >> Zend_Http_Client->setUri()
>>> >> #9
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(202):
>>> >> Zend_Gdata_ClientLogin::getHttpClient()
>>> >> #10
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(827):
>>> >> getClientLoginHttpClient()
>>> >>
>>> >> Thanks for any attempt to give me info.
>>> >
>>> >
>>
>
>
Ryan Boyd-3

Re: Zend_Validate_Hostname trying to load non-existent class

Reply Threaded More More options
Print post
Permalink
Hi Nico,

So, PHP allows you to set your own error handler. I guess that's what's going on here.

set_error_handler allows you to set a handler, and returns the old handler:
http://us.php.net/set_error_handler

Here's an idea:
Call $oldErrorHandler = set_error_handler('myErrorHandler')

Have myErrorHandler just contain a simple check to see if error_reporting()==0.  If so, return.  If not, then call_user_func('oldErrorHandler', $errno, ...) with all the arguments passed to you.

When the ZF code is done executing, you can call set_error_handler($oldErrorHandler)

I think that should solve it, and hopefully in less than 10 lines of code.

I'll have to read up on QCodo.

Cheers,
-Ryan

On Wed, Jun 11, 2008 at 3:27 PM, nico dotti <[hidden email]> wrote:
Hello Ryan, perhaps it's because I'm using QCodo and it is definitely
doing error handling (I see the qcodo blue'ish purple template when I
get my errors).

FWIW, here's the errors 'qcodo' header output (not http header of course):
Error in PHP Script
/rlevin//test/gdata_tests/testZend.php  PHP Version: 5.2.6;  Zend
Engine Version: 2.2.0;  Qcodo Version: 0.3.21 (Qcodo Beta 3)
Application: Apache/2.2.8 (Unix) PHP/5.2.6;  Server Name: mappily.aeriodev.com
HTTP User Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14)
Gecko/20080404 Firefox/2.0.0.14

Also, here's some more information I get when running the qcodo codegen:
Qcodo Development Framework 0.3.21 (Qcodo Beta 3)
Code Generator  PHP Version: 5.2.6;  Zend Engine Version: 2.2.0;
Qcodo Version: 0.3.21 (Qcodo Beta 3)
Application: Apache/2.2.8 (Unix) PHP/5.2.6;  Server Name: mappily.aeriodev.com
Code Generated: Wednesday, June 11 2008, 2:37:31 PM

My boss is in love with qcodo so I'm pretty much stuck using this (not
to complain, I like a lot of aspects of it too). However, this isn't
the first 'snafu' I've run into with this. Qcodo's framework actually
calls start_session and other 'control-freakish' like things. I seem
to remember needing to lower the error reporting levels to get PEAR
HTTP request to work and QCodo wouldn't let me. Oh well. The good news
is I'm pretty far along with doing this with cURL raw http and
probably learning more that way (though I'd really love to not have to
do all of the parsing and error handling myself)

Thanks again Ryan.

Nico

On Wed, Jun 11, 2008 at 12:50 PM, Ryan Boyd <[hidden email]> wrote:
> Hi Nico,
>
> Okay, I've looked into this a bit further.
>
> It looks like something in your code is overriding the error handling, so
> even though Zend/Loader.php:160 is intentionally suppressing any errors that
> occur, the code is ignoring that suppression.
>
> What's happening here:
> The Zend_Validate_Hostname code is capable of having per-top-level-domain
> validation.  It looks like this is primarily intended for international
> domain names, so there is no separate logic for '.com' extensions.  The
> Zend_Validate_Hostname code is checking to see whether a file with the name
> Zend/Validate/Hostname/Com.php is readable by calling
> Zend_Loader::isReadable($filename), which is in turn checking whether fopen
> succeeds.  For a vanilla PHP script/install, this will return false and move
> forward with execution because the '@' suppresses any errors from
> occurring.  However, something in your script is actually overriding the
> error handling and causing that error to be thrown -- even though the
> suppression operator was used.
>
> This PHP manual page has more information on error suppression:
> http://us.php.net/operators.errorcontrol
>
> Cheers,
> -Ryan
>
>
>
>
> On Wed, Jun 11, 2008 at 12:12 PM, Ryan Boyd <[hidden email]> wrote:
>>
>>
>> On Wed, Jun 11, 2008 at 12:07 PM, nico dotti <[hidden email]> wrote:
>>>
>>> Thanks Ryan,
>>>
>>> Perhaps I'll have to do a checkout from the svn, I'm using what I
>>> thought was the stable release posted from the downloads section
>>> version 1.5. Zend Framework 1.5.2  2008-05-15. Wow, that would be a
>>> trip if I had to use the repository version to get it working, I would
>>> think the repository version would be more 'bleeding edge' and not bug
>>> fixes ;) I know, it's open source LOL.
>>> I did get the functionality working with cURL so I may be going that
>>> route.
>>
>> Hi Nico,
>>
>> Sorry if I implied that you have to use SVN -- you shouldn't have to.
>> Your presumptions are exactly correct (svn is for bleeding edge, releases
>> should be for stable usage).
>>
>> Having the version info helps me look at the specific version to see why
>> you could be hitting this.
>>
>> I'll write back soon with what I find.
>>
>> Cheers,
>> -Ryan
>>
>>>
>>>
>>> Thanks again though for your reply Ryan.
>>>
>>> Nico
>>>
>>> On Wed, Jun 11, 2008 at 11:39 AM, Ryan Boyd <[hidden email]> wrote:
>>> > Hi Nico,
>>> > That class name is dynamically created and I'm not sure why the code is
>>> > taking that path.
>>> > What version (svn rev or download) are you using?  Looking at the
>>> > latest
>>> > copy from svn, that code in Zend_Validate_Hostname is actually inside a
>>> > do
>>> > {} while (false); block.
>>> > Cheers,
>>> > -Ryan
>>> >
>>> >
>>> > On Wed, Jun 11, 2008 at 9:18 AM, nico dotti <[hidden email]>
>>> > wrote:
>>> >>
>>> >> Hello all,
>>> >>
>>> >> I just joined and I thought I had sent this out already but I guess
>>> >> not. I get an error when trying to run the Calendar example. I don't
>>> >> even see the Zend/Validate/Hostname/Com.php in the framework so I'm
>>> >> baffled:
>>> >>
>>> >> fopen(Zend/Validate/Hostname/Com.php) [<a
>>> >> href='function.fopen'>function.fopen</a>]: failed to open stream: No
>>> >> such file or directory
>>> >> Error Type:   E_WARNING
>>> >>
>>> >> Rendered Page:   Click here to view contents able to be rendered
>>> >>
>>> >> Source File:
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php
>>> >>    Line:   160
>>> >>
>>> >> Line 155:         * @param string   $filename
>>> >> Line 156:         * @return boolean
>>> >> Line 157:         */
>>> >> Line 158:        public static function isReadable($filename)
>>> >> Line 159:        {
>>> >> Line 160:            if (!$fh = @fopen($filename, 'r', true)) {
>>> >> Line 161:                return false;
>>> >> Line 162:            }
>>> >> Line 163:
>>> >> Line 164:            return true;
>>> >> Line 165:        }
>>> >>
>>> >>
>>> >> Call Stack:
>>> >>
>>> >> #0 (): QcodoHandleError()
>>> >> #1 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Loader.php(160):
>>> >> fopen()
>>> >> #2
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Validate/Hostname.php(336):
>>> >> Zend_Loader::isReadable()
>>> >> #3 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(354):
>>> >> Zend_Validate_Hostname->isValid()
>>> >> #4 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(185):
>>> >> Zend_Uri_Http->validateHost()
>>> >> #5 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri/Http.php(96):
>>> >> Zend_Uri_Http->valid()
>>> >> #6 /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Uri.php(117):
>>> >> Zend_Uri_Http->__construct()
>>> >> #7
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Http/Client.php(223):
>>> >> Zend_Uri::factory()
>>> >> #8
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/lib/Zend/Gdata/ClientLogin.php(96):
>>> >> Zend_Http_Client->setUri()
>>> >> #9
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(202):
>>> >> Zend_Gdata_ClientLogin::getHttpClient()
>>> >> #10
>>> >>
>>> >> /usr/local/apache/htdocs/mappily/rlevin/test/gdata_tests/Calendar.php(827):
>>> >> getClientLoginHttpClient()
>>> >>
>>> >> Thanks for any attempt to give me info.
>>> >
>>> >
>>
>
>