mirror of
https://github.com/vrana/adminer.git
synced 2026-02-04 05:40:00 +01:00
23 lines
382 B
PHP
23 lines
382 B
PHP
<?php
|
|
namespace Adminer;
|
|
|
|
class TmpFile {
|
|
private $handler;
|
|
public $size; ///< @visibility protected(set)
|
|
|
|
function __construct() {
|
|
$this->handler = tmpfile();
|
|
}
|
|
|
|
function write($contents) {
|
|
$this->size += strlen($contents);
|
|
fwrite($this->handler, $contents);
|
|
}
|
|
|
|
function send() {
|
|
fseek($this->handler, 0);
|
|
fpassthru($this->handler);
|
|
fclose($this->handler);
|
|
}
|
|
}
|