Piwik\ReportRenderer::getOutputPath PHP Method

getOutputPath() protected static method

Return $filename with temp directory and delete file
protected static getOutputPath ( $filename ) : string
$filename
return string path of file in temp directory
    protected static function getOutputPath($filename)
    {
        $outputFilename = StaticContainer::get('path.tmp') . '/assets/' . $filename;
        @chmod($outputFilename, 0600);
        if (file_exists($outputFilename)) {
            @unlink($outputFilename);
        }
        return $outputFilename;
    }

Usage Example

Example #1
0
 public function sendToDisk($filename)
 {
     $filename = ReportRenderer::makeFilenameWithExtension($filename, self::PDF_CONTENT_TYPE);
     $outputFilename = ReportRenderer::getOutputPath($filename);
     $this->TCPDF->Output($outputFilename, 'F');
     return $outputFilename;
 }