diff --git a/bin/cache_tokens_with_prices.php b/bin/cache_tokens_with_prices.php index efa96948..01cd4cdd 100644 --- a/bin/cache_tokens_with_prices.php +++ b/bin/cache_tokens_with_prices.php @@ -53,7 +53,9 @@ } $confPrices .= '];'. "\n"; if($numTokens > MIN_TOKENS_NUM){ - file_put_contents(dirname(__FILE__) . '/../service/config.prices.php', $confPrices); + $file = dirname(__FILE__) . '/../service/config.prices.php'; + file_put_contents($file . '.tmp', $confPrices); + rename($file . '.tmp', $file); } } }catch(\Exception $e){