|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
muby Smarty n00b
Joined: 09 Aug 2010 Posts: 1
|
Posted: Mon Aug 09, 2010 11:42 pm Post subject: spl_autoload_register("myApp") before smarty autol |
|
|
Hi,
i'm new here, and not very fluent in english
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 |
|
artz Smarty n00b
Joined: 01 Oct 2009 Posts: 3
|
Posted: Sun Apr 10, 2011 4:27 pm Post subject: same problem |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Apr 10, 2011 5:32 pm Post subject: |
|
|
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 |
|
saboya Smarty Rookie
Joined: 24 Jun 2010 Posts: 6
|
Posted: Mon Apr 11, 2011 7:14 pm Post subject: |
|
|
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 |
|
|
|
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
|