public function FileBase::save in Forena Reports 7.5
Same name and namespace in other branches
- 8 src/File/FileBaseOld.php \Drupal\forena\File\FileBase::save()
Save a file into the report directory.
Parameters
unknown_type $filename:
unknown_type $data:
File
- src/
File/ FileBase.php, line 349 - FileBase.inc File toolbox for manipulating files contained tn the report directory.
Class
Namespace
Drupal\forena\FileCode
public function save($filename, $data) {
$path = $this->dir . '/' . $filename;
$this
->verifyDirectory($filename);
if (is_writable($path) || !file_exists($path) && is_writable(dirname($path))) {
file_put_contents($path, $data);
}
else {
Frx::error(t('Insufficient privileges to write file.'));
}
}