Compare commits

...

2 Commits

Author SHA1 Message Date
Grégoire Pineau 1108382429 [ClassLoader] Throw an exception if the cache is not writeable 2017-01-09 15:44:50 +01:00
Fabien Potencier 2e19afbcc7 updated LICENSE year 2017-01-02 12:30:00 -08:00
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -275,7 +275,13 @@ REGEX;
*/
private static function writeCacheFile($file, $content)
{
$tmpFile = tempnam(dirname($file), basename($file));
$dir = dirname($file);
if (!is_writable($dir)) {
throw new \RuntimeException(sprintf('Cache directory "%s" is not writable.', $dir));
}
$tmpFile = tempnam($dir, basename($file));
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
@chmod($file, 0666 & ~umask());
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2004-2016 Fabien Potencier
Copyright (c) 2004-2017 Fabien Potencier
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal