public function FrxFile::save in Forena Reports 7.4
Save a file into the report directory.
Parameters
unknown_type $filename:
unknown_type $data:
File
- ./
FrxFile.inc, line 347 - FrxFile.inc File toolbox for manipulating files contained tn the report directory.
Class
- FrxFile
- @file FrxFile.inc File toolbox for manipulating files contained tn the report directory.
Code
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.'));
}
}