public function dump($data,
$file_extension) { $path = 'assets://' .
$file_extension;
// Prefix filename to prevent blocking by firewalls which reject files
// starting with "ad*".
$filename =
$file_extension . '_' . Crypt::
hashBase64($data) . '.' .
$file_extension;
$uri =
$path . '/' .
$filename;
return $this->
dumpToUri($data,
$file_extension,
$uri);
} /**
* {@inheritdoc}
*/
public function dumpToUri(string
$data, string
$file_extension, string
$uri): string
{ $path = 'assets://' .
$file_extension;
// Create the CSS or JS file.
$this->fileSystem->
prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY
);
try { if (!
file_exists($uri) && !
$this->fileSystem->
saveData($data,
$uri, FileSystemInterface::EXISTS_REPLACE
)) {