Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CacheWarmer.php

function CacheWarmer::writeCacheFile

File

vendor/symfony/http-kernel/CacheWarmer/CacheWarmer.php, line 21

Class

CacheWarmer
Abstract cache warmer that knows how to write a file to the cache.

Namespace

Symfony\Component\HttpKernel\CacheWarmer

Code

protected function writeCacheFile(string $file, $content) : void {
    $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));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal