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

Using register_shutdown_function produces error

 
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 -> 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:   
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 -> 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