Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

spl_autoload_register("myApp") before smarty autol

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
muby
Smarty n00b


Joined: 09 Aug 2010
Posts: 1

PostPosted: Mon Aug 09, 2010 11:42 pm    Post subject: spl_autoload_register("myApp") before smarty autol Reply with quote

Hi,

i'm new here, and not very fluent in english Smile

I make few test with Smarty3 : Rev: 3286 and i've got some problem with the autoload function.

Indeed, before i've got an __autoload() function, witch is not compatible with Smarty 3.

So I replace it with "spl_autoload_register("myApp") but if I call this function before including the file "Smarty.class.php" it doesn't work.

But if I place the include of "Smarty.class.php" before calling "spl_autoload_register("myApp"), it's ok.

Can anyone explain me why ?

Thanks you
Back to top
View user's profile Send private message
artz
Smarty n00b


Joined: 01 Oct 2009
Posts: 3

PostPosted: Sun Apr 10, 2011 4:27 pm    Post subject: same problem Reply with quote

Im having this problem too

registered my autoloader with spl_autoload_register(), but the page is unable to find Smarty_Internal_Data.class.php after.

Any solutions yet?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Apr 10, 2011 5:32 pm    Post subject: Reply with quote

I assume that your autoloader does not test if the file exists before it calls include.

It should call include only for existing files otherwise just return.
Back to top
View user's profile Send private message
saboya
Smarty Rookie


Joined: 24 Jun 2010
Posts: 6

PostPosted: Mon Apr 11, 2011 7:14 pm    Post subject: Reply with quote

Your autoloads should only do stuff that is pertinent to that autoloader. Smarty autoloader for instance probably checks if the class name starts with "Smarty" or something. You should do that with your autoloaders too.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP