Contao\ZipWriter::__construct PHP Method

__construct() public method

Create a new zip archive
public __construct ( string $strFile )
$strFile string The file path
    public function __construct($strFile)
    {
        $this->strFile = $strFile;
        // Create temporary file
        if (($this->strTemp = tempnam(TL_ROOT . '/' . self::TEMPORARY_FOLDER, 'zip')) == false) {
            throw new \Exception("Cannot create temporary file");
        }
        // Open temporary file
        if (($this->resFile = @fopen($this->strTemp, 'wb')) == false) {
            throw new \Exception("Cannot open temporary file");
        }
    }