Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Using register_shutdown_function produces error

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Stephan18
Smarty n00b


Joined: 13 Dec 2015
Posts: 2

PostPosted: Sun Dec 13, 2015 8:13 pm    Post subject: Using register_shutdown_function produces error Reply with quote

Hello,

If you`re using an errorHandling with register_shutdown_function like this example:

Code:
register_shutdown_function(array($this, 'handleFatalError'));


And this:

Code:
public function handleFatalError() {
   $error = error_get_last();
   if (!$error) return;         

   throw new SystemException();
   exit;
}


it`s run into an error:
Code:
Oops, an error occurred!

Error
filemtime(): stat failed for /var/www/vhosts/**/**/affiliate/acp/templates/templates_c/*.file.options.tpl.php


Sure, i can ignore this error, but i handle all errors
* Parse Error
* Notes

Here`s an example how to fix it:
/smarty/sysplugins/smarty_resource.php on line 772:

Code:
$compiled->timestamp = @filemtime($compiled->filepath);


Replace it with this:

Code:
if (is_file($compiled->filepath)) {       
   $compiled->timestamp = filemtime($compiled->filepath);
               
}
else {
   $compiled->timestamp = 0;
         
}


Greetings from Germany
Back to top
View user's profile Send private message
Stephan18
Smarty n00b


Joined: 13 Dec 2015
Posts: 2

PostPosted: Sun Dec 13, 2015 8:26 pm    Post subject: Reply with quote

Ok, sorry my misstake.

This error comes with V19. In the actual build 28 its fixed.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs 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