You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4php-user@logging.apache.org by Michael Sole <ms...@gold-mobile.com> on 2011/09/08 21:31:25 UTC

Can't find autoload

We have moved the new version of our application from develop to our QA
servers. We are now getting this error:

 

Warning: log4php: It looks like your code is using an __autoload()
function. log4php uses spl_autoload_register() which will bypass your
__autoload() function and may break autoloading.
in/vdomain/bm/bmqa.goldmo.com/html/blastmanager/classes/log4php/Logger.p
hp on line 22

 

We had previously used autoload but removed it and we are now using
spl_autoload. In development it works fine but in QA it throws this
error. I grepped for autoload but could not find any instance in any
file. Is there anyway to determine what is cause log4php to throw this
error?

 

I know this is an abstract question but I am a bit stumped.

 

Mike

 

_______________

Michael F. Sole
msole@gold-mobile.com

Office: 732.632.8801, ext. 261
Mobile: 516.592.3683

Fax: 732.632.3599

Gold Mobile
www.gold-mobile.com <http://www.gold-mobile.com/>   

Mobile Health Tech Group
www.mobilehealthtech.md <http://www.mobilehealthtech.md/> 

This e-mail and any files transmitted are intended solely for the use of
the individual or entity to whom they are addressed, and for the use of
Gold Mobile.  Any other use is strictly prohibited.

 


Re: Can't find autoload

Posted by Ivan Habunek <iv...@gmail.com>.
On 8 September 2011 21:31, Michael Sole <ms...@gold-mobile.com> wrote:
> We had previously used autoload but removed it and we are now using
> spl_autoload. In development it works fine but in QA it throws this error. I
> grepped for autoload but could not find any instance in any file. Is there
> anyway to determine what is cause log4php to throw this error?
>
> I know this is an abstract question but I am a bit stumped.

Hi Mike,

That is a strange problem.

This check was a request from one of our users [1]. It should not
trigger the warning if you use spl_autoload.

The check works like this (at Logger.php:21):
if (function_exists('__autoload')) {
    trigger_error("log4php: It looks like your code is using an
__autoload() function. log4php uses spl_autoload_register() which will
bypass your __autoload() function and may break autoloading.",
E_USER_WARNING);
}

Basically, if there is an __autoload method defined at the moment you
include log4php you should get this warning.

Is it possible that some extra code is loaded on your QA environment
which is not in dev?

You can try running something like:
<?php
var_dump(function_exists('__autoload'));
include 'my/code.php';
var_dump(function_exists('__autoload'));
?>

If __autoload defined within your code, the first var_dump will return
flase, and the second will return true.

Alternatively, put some var_dumps at critical locations within your
code (before and after includes).

I'm not sure what else to suggest at this point...

Regards,
--
Ivan

[1] https://issues.apache.org/jira/browse/LOG4PHP-129