mirror of
https://github.com/vrana/adminer.git
synced 2026-02-22 22:51:03 +01:00
23 lines
416 B
PHP
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);
|
|
}
|
|
}
|