123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?php
- class OLE_PPS_File extends OLE_PPS
- {
-
- var $_tmp_dir;
-
- function OLE_PPS_File($name)
- {
- $this->_tmp_dir = '';
- $this->OLE_PPS(
- null,
- $name,
- OLE_PPS_TYPE_FILE,
- null,
- null,
- null,
- null,
- null,
- '',
- array());
- }
-
- function setTempDir($dir)
- {
- if (is_dir($dir)) {
- $this->_tmp_dir = $dir;
- return true;
- }
- return false;
- }
-
- function init()
- {
- $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
- $fh = @fopen($this->_tmp_filename, "w+b");
- if ($fh == false) {
- return $this->raiseError("Can't create temporary file");
- }
- $this->_PPS_FILE = $fh;
- if ($this->_PPS_FILE) {
- fseek($this->_PPS_FILE, 0);
- }
- return true;
- }
-
- function append($data)
- {
- if ($this->_PPS_FILE) {
- fwrite($this->_PPS_FILE, $data);
- } else {
- $this->_data .= $data;
- }
- }
-
- function getStream()
- {
- $this->ole->getStream($this);
- }
- }
- ?>
|