// Added lock to class_index generation

This commit is contained in:
Damien Metzger committed 2013-03-14 11:00:23 +01:00
1 parent 7f21c3e62a
commit 44a0afa34b
1 file changed
+2 -2
+2 -2
View File
@@ -142,7 +142,7 @@ class Autoload
do do
{ {
$integrity_is_ok = false; $integrity_is_ok = false;
file_put_contents($filename, $content); file_put_contents($filename, $content, LOCK_EX);
if ($loop_protection++ > 10) if ($loop_protection++ > 10)
break; break;
@@ -154,7 +154,7 @@ class Autoload
if (!$integrity_is_ok) if (!$integrity_is_ok)
{ {
file_put_contents($filename, '<?php return array(); ?>'); file_put_contents($filename, '<?php return array(); ?>', LOCK_EX);
// Cannot use PrestaShopException in this context // Cannot use PrestaShopException in this context
die('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically'); die('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically');
} }