public putContent ( string $path, string $content ) | ||
$path | string | |
$content | string |
public function putContent($path, $content)
{
$isStream = strpos($path, 'php://') !== false;
if (!$isStream) {
if (file_exists($path) && is_dir($path)) {
throw new FileNotWritableException($path);
}
if (!is_writable(dirname($path))) {
throw new FileNotWritableException($path);
}
}
file_put_contents($path, $content);
}
/** * Defined by ReportInterface. * * @see ReportInterface::finish() */ public function finish() { $this->writer->endElement(); $this->writer->endDocument(); $this->fileSystem->putContent($this->filename, $this->writer->outputMemory()); }