|
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 |
voxel Smarty n00b
Joined: 29 Dec 2011 Posts: 3
|
Posted: Thu Dec 29, 2011 12:37 pm Post subject: Smarty-3.1.5 - smarty_internal_write_file.php - Damaged File |
|
|
Hello,
In some cases we had a problem when we have a lot of traffic and many Templates have to be compiled at the same time. They where partly overwitten. Instead of the following(Line 41):
Code: |
$_tmp_file = $_dirpath . DS . uniqid('wrt');
|
You should do something like this:
Code: |
$_tmp_file = $_dirpath . DS . uniqid('wrt', true);
|
Or even better:
Code: |
$_tmp_file = $_dirpath . DS . uniqid('wrt', true).md5($_filepath);
|
Or just lock the File.
Thanks |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Thu Dec 29, 2011 1:31 pm Post subject: |
|
|
I added the more_entropy argument, seeing that this is required for cygwin anyways. (wonder who's using php via cygwin, though…)
It will be included in Smarty 3.1.8
File Locking is not possible, as smarty could be writing to FS that don't support file locking at all (NFS for example). _________________ Twitter |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Thu Dec 29, 2011 1:55 pm Post subject: |
|
|
You might also be interested in $compile_locking and $cache_locking
they should prevent smarty from doing the exact same job in multiple processes (even accross multiple servers). _________________ Twitter |
|
Back to top |
|
voxel Smarty n00b
Joined: 29 Dec 2011 Posts: 3
|
Posted: Thu Dec 29, 2011 2:05 pm Post subject: |
|
|
compile_locking is active.
cache_locking is NOT active as we dont use the cache.
Still we sometimes had the Problem of corrupt files.
(we added the more Entropy to fix that Problem) |
|
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
|