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

Bug in Smarty when used with vfsStream and where to fix.

 
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
jaycode
Smarty n00b


Joined: 15 Jan 2015
Posts: 2

PostPosted: Thu Jan 15, 2015 4:17 pm    Post subject: Bug in Smarty when used with vfsStream and where to fix. Reply with quote

When using vfsStream for PHP Unit testing with smarty, loading a template will cause this error:

PHPUnit_Util_ErrorHandler::handleError(2, 'fopen(vfs:\\roo...', 'D:\htdocs\...', 42, Array)

To fix this, below is the hack:

smarty_internal_resource_file.php line 30:

$source->filepath = str_replace(':\\\\', '://', $source->filepath);

Please include this change in future smarty version.
Back to top
View user's profile Send private message
jaycode
Smarty n00b


Joined: 15 Jan 2015
Posts: 2

PostPosted: Thu Jan 15, 2015 4:19 pm    Post subject: Reply with quote

This only happen in Windows, by the way, and caused by DIRECTORY_SEPARATOR in Windows using \ instead of /.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jan 15, 2015 4:22 pm    Post subject: Reply with quote

Use forward slashes as directory separators.
No need for any hacks.
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