Source for file PPS.php
Documentation is available at PPS.php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// +----------------------------------------------------------------------+
// | Copyright (c) 1997-2002 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Xavier Noguer <xnoguer@php.net> |
// | Based on OLE::Storage_Lite by Kawai, Takanori |
// +----------------------------------------------------------------------+
// $Id: PPS.php 322771 2012-01-26 01:24:20Z clockwerx $
* Class for creating PPS's for OLE containers
* @author Xavier Noguer <xnoguer@php.net>
* The PPS name (in Unicode)
* The PPS type. Dir, Root or File
* The index of the previous PPS
* The index of the next PPS
* The index of it's first child if this is a Dir or Root PPS
* Starting block (small or big) for this PPS's data inside the container
* The size of the PPS's data (in bytes)
* The PPS's data (only used if it's not using a temporary file)
* Array of child PPS's (only used by Root and Dir PPS's)
* Pointer to OLE container
* @param integer $No The PPS index
* @param string $name The PPS name
* @param integer $type The PPS type. Dir, Root or File
* @param integer $prev The index of the previous PPS
* @param integer $next The index of the next PPS
* @param integer $dir The index of it's first child if this is a Dir or Root PPS
* @param integer $time_1st A timestamp
* @param integer $time_2nd A timestamp
* @param string $data The (usually binary) source data of the PPS
* @param array $children Array containing children PPS for this PPS
function OLE_PPS($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
* Returns the amount of data saved for this PPS
* @return integer The amount of data (in bytes)
if (!isset ($this->_data)) {
if (isset ($this->_PPS_FILE)) {
fseek($this->_PPS_FILE, 0 );
$stats = fstat($this->_PPS_FILE);
* Returns a string with the PPS's WK (What is a WK?)
* @return string The binary string
for ($i = 0; $i < (64 - strlen($this->Name)); $i++ ) {
. pack("c", 0x00 ) //UK // 68
. "\x00\x09\x02\x00" // 84
. "\x00\x00\x00\x00" // 88
. "\xc0\x00\x00\x00" // 92
. "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
. "\x00\x00\x00\x00" // 100
. pack("V", isset ($this->_StartBlock)?
$this->_StartBlock:0 ) // 120
* Updates index and pointers to previous, next and children PPS's for this
* PPS. I don't think it'll work with Dir PPS's.
* @param array &$pps_array Reference to the array of PPS's for the whole OLE
* @return integer The index for this PPS
static function _savePpsSetPnt (&$raList, $to_save, $depth = 0 )
elseif ( count($to_save) == 1 ) {
// If the first entry, it's the root... Don't clone it!
$raList[$cnt] = ( $depth == 0 ) ? $to_save[0 ] : clone $to_save[0 ];
$raList[$cnt]->No = $cnt;
$raList[$cnt]->PrevPps = 0xFFFFFFFF;
$raList[$cnt]->NextPps = 0xFFFFFFFF;
$raList[$cnt]->DirPps = self ::_savePpsSetPnt ($raList, @$raList[$cnt]->children , $depth++ );
// If the first entry, it's the root... Don't clone it!
$raList[$cnt] = ( $depth == 0 ) ? $to_save[$iPos] : clone $to_save[$iPos];
$raList[$cnt]->No = $cnt;
$raList[$cnt]->PrevPps = self ::_savePpsSetPnt ($raList, $aPrev, $depth++ );
$raList[$cnt]->NextPps = self ::_savePpsSetPnt ($raList, $aNext, $depth++ );
$raList[$cnt]->DirPps = self ::_savePpsSetPnt ($raList, @$raList[$cnt]->children , $depth++ );
Documentation generated on Mon, 11 Mar 2019 15:47:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|