help with autoload

This is a discussion on help with autoload within the PHP General forums, part of the PHP Programming Forums category; I have a project the someone else wrote and that I can't get to work. It uses a rather ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-24-2008
Jonathan Mast
 
Posts: n/a
Default help with autoload

I have a project the someone else wrote and that I can't get to work.

It uses a rather large library of classes that are not apparently getting
loaded by the provided __autoload() function.

I'm not very well versed in PHP and one of the first things I did was see if
in fact the __autoload function was being called. I place some print
statements in it and got no result. But I don't know if that is because it
is not really calling that function or perhaps the print outs are out of
scope and won't be catched by the browser, I don't know.

thanks,

PHP: 5.1
TOMCAT: 5.5
Windows XP

Reply With Quote
  #2 (permalink)  
Old 03-25-2008
Carlton Whitehead
 
Posts: n/a
Default Re: [PHP] help with autoload

Jonathan Mast wrote:
> I have a project the someone else wrote and that I can't get to work.
>
> It uses a rather large library of classes that are not apparently getting
> loaded by the provided __autoload() function.
>
> I'm not very well versed in PHP and one of the first things I did was see if
> in fact the __autoload function was being called. I place some print
> statements in it and got no result. But I don't know if that is because it
> is not really calling that function or perhaps the print outs are out of
> scope and won't be catched by the browser, I don't know.
>
> thanks,
>
> PHP: 5.1
> TOMCAT: 5.5
> Windows XP
>
>


Hi Jonathan,

Almost certainly the __autoload function is not being called by the
parent script. Make sure the parent script that is being run (based on
the URL in your browser) did an "include" or "require" against the
script containing the autoload function definition. Also make sure the
path used for it is correct. It's really hard to say without looking at
the code and filesystem.

Just for kicks I made a test case to see if print works from inside the
__autoload function, and it did.

Regards,
Carlton Whitehead
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:20 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0