You are here

private static function ClassCollectionLoader::writeCacheFile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/class-loader/ClassCollectionLoader.php \Symfony\Component\ClassLoader\ClassCollectionLoader::writeCacheFile()

Writes a cache file.

Parameters

string $file Filename:

string $content Temporary file content:

Throws

\RuntimeException when a cache file cannot be written

1 call to ClassCollectionLoader::writeCacheFile()
ClassCollectionLoader::load in vendor/symfony/class-loader/ClassCollectionLoader.php
Loads a list of classes and caches them in one big file.

File

vendor/symfony/class-loader/ClassCollectionLoader.php, line 230

Class

ClassCollectionLoader
ClassCollectionLoader.

Namespace

Symfony\Component\ClassLoader

Code

private static function writeCacheFile($file, $content) {
  $tmpFile = tempnam(dirname($file), basename($file));
  if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
    @chmod($file, 0666 & ~umask());
    return;
  }
  throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file));
}