ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
OLE_PPS_File Class Reference
+ Inheritance diagram for OLE_PPS_File:
+ Collaboration diagram for OLE_PPS_File:

Public Member Functions

 OLE_PPS_File ($name)
 The constructor. More...
 
 setTempDir ($dir)
 Sets the temp dir used for storing the OLE file. More...
 
 init ()
 Initialization method. More...
 
 append ($data)
 Append data to PPS. More...
 
 getStream ()
 Returns a stream for reading this file using fread() etc. More...
 
- Public Member Functions inherited from OLE_PPS
 OLE_PPS ($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
 The constructor. More...
 
 _DataLen ()
 Returns the amount of data saved for this PPS. More...
 
 _getPpsWk ()
 Returns a string with the PPS's WK (What is a WK?) More...
 
 _savePpsSetPnt (&$pps_array)
 Updates index and pointers to previous, next and children PPS's for this PPS. More...
 
- Public Member Functions inherited from PEAR
 PEAR ($error_class=null)
 Constructor. More...
 
 _PEAR ()
 Destructor (the emulated type of...). More...
 
getStaticProperty ($class, $var)
 If you have a class that's mostly/entirely static, and you need static properties, you can use this method to simulate them. More...
 
 registerShutdownFunc ($func, $args=array())
 Use this function to register a shutdown method for static classes. More...
 
 isError ($data, $code=null)
 Tell whether a value is a PEAR error. More...
 
 setErrorHandling ($mode=null, $options=null)
 Sets how errors generated by this object should be handled. More...
 
 expectError ($code=' *')
 This method is used to tell which errors you expect to get. More...
 
 popExpect ()
 This method pops one element off the expected error codes stack. More...
 
 _checkDelExpect ($error_code)
 This method checks unsets an error code if available. More...
 
 delExpect ($error_code)
 This method deletes all occurences of the specified element from the expected error codes stack. More...
 
raiseError ($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
 This method is a wrapper that returns an instance of the configured error class with this object's default error handling applied. More...
 
throwError ($message=null, $code=null, $userinfo=null)
 Simpler form of raiseError with fewer options. More...
 
 staticPushErrorHandling ($mode, $options=null)
 
 staticPopErrorHandling ()
 
 pushErrorHandling ($mode, $options=null)
 Push a new error handler on top of the error handler options stack. More...
 
 popErrorHandling ()
 Pop the last error handler used. More...
 
 loadExtension ($ext)
 OS independant PHP extension load. More...
 

Data Fields

 $_tmp_dir
 
- Data Fields inherited from OLE_PPS
 $No
 
 $Name
 
 $Type
 
 $PrevPps
 
 $NextPps
 
 $DirPps
 
 $Time1st
 
 $Time2nd
 
 $_StartBlock
 
 $Size
 
 $_data
 
 $children = array()
 
 $ole
 
- Data Fields inherited from PEAR
 $_debug = false
 
 $_default_error_mode = null
 
 $_default_error_options = null
 
 $_default_error_handler = ''
 
 $_error_class = 'PEAR_Error'
 
 $_expected_errors = array()
 

Detailed Description

Definition at line 33 of file File.php.

Member Function Documentation

◆ append()

OLE_PPS_File::append (   $data)

Append data to PPS.

public

Parameters
string$dataThe data to append

Definition at line 107 of file File.php.

References $data.

108  {
109  if ($this->_PPS_FILE) {
110  fwrite($this->_PPS_FILE, $data);
111  } else {
112  $this->_data .= $data;
113  }
114  }

◆ getStream()

OLE_PPS_File::getStream ( )

Returns a stream for reading this file using fread() etc.

Returns
resource a read-only stream

Definition at line 120 of file File.php.

121  {
122  $this->ole->getStream($this);
123  }

◆ init()

OLE_PPS_File::init ( )

Initialization method.

Has to be called right after OLE_PPS_File().

public

Returns
mixed true on success. PEAR_Error on failure

Definition at line 86 of file File.php.

References PEAR\raiseError().

87  {
88  $this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_File");
89  $fh = @fopen($this->_tmp_filename, "w+b");
90  if ($fh == false) {
91  return $this->raiseError("Can't create temporary file");
92  }
93  $this->_PPS_FILE = $fh;
94  if ($this->_PPS_FILE) {
95  fseek($this->_PPS_FILE, 0);
96  }
97 
98  return true;
99  }
& raiseError($message=null, $code=null, $mode=null, $options=null, $userinfo=null, $error_class=null, $skipmsg=false)
This method is a wrapper that returns an instance of the configured error class with this object's de...
Definition: PEAR.php:524
+ Here is the call graph for this function:

◆ OLE_PPS_File()

OLE_PPS_File::OLE_PPS_File (   $name)

The constructor.

public

Parameters
string$nameThe name of the file (in Unicode)
See also
OLE::Asc2Ucs()

Definition at line 48 of file File.php.

References OLE_PPS\OLE_PPS(), OLE_PPS_TYPE_FILE, and System\tmpdir().

49  {
50  $this->_tmp_dir = System::tmpdir();
51  $this->OLE_PPS(
52  null,
53  $name,
55  null,
56  null,
57  null,
58  null,
59  null,
60  '',
61  array());
62  }
tmpdir()
Get the path of the temporal directory set in the system by looking in its environments variables...
Definition: System.php:454
const OLE_PPS_TYPE_FILE
Definition: OLE.php:28
OLE_PPS($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
The constructor.
Definition: PPS.php:128
+ Here is the call graph for this function:

◆ setTempDir()

OLE_PPS_File::setTempDir (   $dir)

Sets the temp dir used for storing the OLE file.

public

Parameters
string$dirThe dir to be used as temp dir
Returns
true if given dir is valid, false otherwise

Definition at line 71 of file File.php.

72  {
73  if (is_dir($dir)) {
74  $this->_tmp_dir = $dir;
75  return true;
76  }
77  return false;
78  }

Field Documentation

◆ $_tmp_dir

OLE_PPS_File::$_tmp_dir

Definition at line 39 of file File.php.


The documentation for this class was generated from the following file: