⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.170
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
tech
/
www
/
script
/
vendor
/
samdark
/
sitemap
/
View File Name :
TempFileGZIPWriter.php
<?php namespace samdark\sitemap; /** * Flushes buffer into temporary stream and compresses stream into a file on finish */ class TempFileGZIPWriter implements WriterInterface { /** * @var string Name of target file */ private $filename; /** * @var ressource for php://temp stream */ private $tempFile; /** * @param string $filename target file */ public function __construct($filename) { $this->filename = $filename; $this->tempFile = fopen('php://temp/', 'wb'); } /** * Store data in a temporary stream/file * * @param string $data */ public function append($data) { assert($this->tempFile !== null); fwrite($this->tempFile, $data); } /** * Deflate buffered data */ public function finish() { assert($this->tempFile !== null); $file = fopen('compress.zlib://' . $this->filename, 'wb'); rewind($this->tempFile); stream_copy_to_stream($this->tempFile, $file); fclose($file); fclose($this->tempFile); $this->tempFile = null; } }