2013-05-01 16:33:23 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class TmpFile {
|
|
|
|
var $handler;
|
|
|
|
var $size;
|
|
|
|
|
2015-08-15 15:04:21 +00:00
|
|
|
function __construct() {
|
2013-05-01 16:33:23 +00:00
|
|
|
$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);
|
|
|
|
}
|
2013-05-02 01:28:04 +00:00
|
|
|
|
2013-05-01 16:33:23 +00:00
|
|
|
}
|