Files
adminer/adminer/include/tmpfile.inc.php
2025-03-28 12:45:02 +01:00

23 lines
416 B
PHP

<?php
namespace Adminer;
class TmpFile {
private resource $handler;
/** @visibility protected(set) */ public int $size;
function __construct() {
$this->handler = tmpfile();
}
function write(string $contents): void {
$this->size += strlen($contents);
fwrite($this->handler, $contents);
}
function send(): void {
fseek($this->handler, 0);
fpassthru($this->handler);
fclose($this->handler);
}
}