• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

classes/OLE/PPS/File.php

Go to the documentation of this file.
00001 <?php
00002 /* vim: set expandtab tabstop=4 shiftwidth=4: */
00003 // +----------------------------------------------------------------------+
00004 // | PHP Version 4                                                        |
00005 // +----------------------------------------------------------------------+
00006 // | Copyright (c) 1997-2002 The PHP Group                                |
00007 // +----------------------------------------------------------------------+
00008 // | This source file is subject to version 2.02 of the PHP license,      |
00009 // | that is bundled with this package in the file LICENSE, and is        |
00010 // | available at through the world-wide-web at                           |
00011 // | http://www.php.net/license/2_02.txt.                                 |
00012 // | If you did not receive a copy of the PHP license and are unable to   |
00013 // | obtain it through the world-wide-web, please send a note to          |
00014 // | license@php.net so we can mail you a copy immediately.               |
00015 // +----------------------------------------------------------------------+
00016 // | Author: Xavier Noguer <xnoguer@php.net>                              |
00017 // | Based on OLE::Storage_Lite by Kawai, Takanori                        |
00018 // +----------------------------------------------------------------------+
00019 //
00020 // $Id: File.php 4249 2004-06-16 14:14:02Z hschottm $
00021 
00022 
00023 require_once ('classes/OLE/PPS.php');
00024 
00032 class OLE_PPS_File extends OLE_PPS
00033 {
00038     var $_tmp_dir;
00039 
00047     function OLE_PPS_File($name)
00048     {
00049         $this->_tmp_dir = '';
00050         $this->OLE_PPS(
00051             null, 
00052             $name,
00053             OLE_PPS_TYPE_FILE,
00054             null,
00055             null,
00056             null,
00057             null,
00058             null,
00059             '',
00060             array());
00061     }
00062 
00070     function setTempDir($dir)
00071     {
00072         if (is_dir($dir)) {
00073             $this->_tmp_dir = $dir;
00074             return true;
00075         }
00076         return false;
00077     }
00078 
00085     function init()
00086     {
00087         $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
00088         $fh = @fopen($this->_tmp_filename, "w+b");
00089         if ($fh == false) {
00090             return $this->raiseError("Can't create temporary file");
00091         }
00092         $this->_PPS_FILE = $fh;
00093         if ($this->_PPS_FILE) {
00094             fseek($this->_PPS_FILE, 0);
00095         }
00096     }
00097     
00104     function append($data)
00105     {
00106         if ($this->_PPS_FILE) {
00107             fwrite($this->_PPS_FILE, $data);
00108         }
00109         else {
00110             $this->_data .= $data;
00111         }
00112     }
00113 }
00114 ?>

Generated on Fri Dec 13 2013 13:52:08 for ILIAS Release_3_7_x_branch .rev 46817 by  doxygen 1.7.1