Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Upgrade to Smarty 3.1.16 ..do I need to make files lowercase

 
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
abadger
Smarty n00b


Joined: 25 Jan 2014
Posts: 1

PostPosted: Sat Jan 25, 2014 8:06 am    Post subject: Upgrade to Smarty 3.1.16 ..do I need to make files lowercase Reply with quote

Advice needed on upgrade to 3.1.16 .. have trouble understanding how to change my current autoloader ....currently get errors like:-

[25-Jan-2014 15:08:58 Europe/London] PHP Fatal error: require_once(): Failed opening required 'Smarty_Internal_TemplateCompilerBase.php'


and my loader looks like...

function autoload_class($class_name)
{
$file = $class_name. '.php';
require_once($file);
}

spl_autoload_register('autoload_class');
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sat Jan 25, 2014 6:42 pm    Post subject: Reply with quote

Smarty does register it's own autoloader. Your autoloader is not compatible to multiple loaders. It should test if the file exits.

Code:
function autoload_class($class_name)
{
  $file = $class_name. '.php';
  if  (file_exits($file)) {
     require_once($file);
  }
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Installation and Setup 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