protected static function AssetWriter::write

1 call to AssetWriter::write()
AssetWriter::writeAsset in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php, line 97

Class

AssetWriter
Writes assets to the filesystem.

Namespace

Assetic

Code

protected static function write($path, $contents) {
  if (!is_dir($dir = dirname($path)) && false === @mkdir($dir, 0777, true)) {
    throw new \RuntimeException('Unable to create directory ' . $dir);
  }
  if (false === @file_put_contents($path, $contents)) {
    throw new \RuntimeException('Unable to write file ' . $path);
  }
}