Pimcore\Model\Asset::getTemporaryFile PHP Méthode

getTemporaryFile() public méthode

returns the path to a temp file
public getTemporaryFile ( ) : string
Résultat string
    public function getTemporaryFile()
    {
        $destinationPath = PIMCORE_SYSTEM_TEMP_DIRECTORY . "/asset-temporary/asset_" . $this->getId() . "_" . md5(microtime()) . "__" . $this->getFilename();
        if (!is_dir(dirname($destinationPath))) {
            File::mkdir(dirname($destinationPath));
        }
        $src = $this->getStream();
        $dest = fopen($destinationPath, "w+", false, File::getContext());
        stream_copy_to_stream($src, $dest);
        fclose($dest);
        @chmod($destinationPath, File::getDefaultMode());
        return $destinationPath;
    }