Esempio n. 1
0
 protected function clear()
 {
     if (App\Files::isReadable($this->log_file)) {
         return App\Files::put($this->log_file, '');
     }
     return false;
 }
Esempio n. 2
0
 protected function download($_path)
 {
     if (!App\Files::isReadable($_path)) {
         xplog('Unable to read file "' . $_path . '" when trying to download', __METHOD__);
         return '';
     }
     $file_size = filesize($_path);
     $file_contents = App\Files::get($_path);
     $file_name = basename($_path);
     header("Content-length: " . $file_size);
     header('Content-Type: application/octet-stream');
     header('Content-Disposition: attachment; filename="' . $file_name . '"');
     return $file_contents;
 }