\PhpOffice\PhpSpreadsheet\Shared\OLE\PPSRoot

Class for creating Root PPS's for OLE containers.

Summary

Methods
Properties
Constants
__construct()
getDataLen()
getPpsWk()
savePpsSetPnt()
save()
$No
$Name
$Type
$PrevPps
$NextPps
$DirPps
$Time1st
$Time2nd
$startBlock
$Size
$_data
$children
$ole
No constants found
No protected methods found
No protected properties found
N/A
calcSize()
adjust2()
saveHeader()
saveBigData()
makeSmallData()
savePps()
saveBbd()
$fileHandle
$smallBlockSize
$bigBlockSize
N/A

Properties

$No

$No : int

The PPS index.

Type

int

$Name

$Name : string

The PPS name (in Unicode).

Type

string

$Type

$Type : int

The PPS type. Dir, Root or File.

Type

int

$PrevPps

$PrevPps : int

The index of the previous PPS.

Type

int

$NextPps

$NextPps : int

The index of the next PPS.

Type

int

$DirPps

$DirPps : int

The index of it's first child if this is a Dir or Root PPS.

Type

int

$Time1st

$Time1st : int

A timestamp.

Type

int

$Time2nd

$Time2nd : int

A timestamp.

Type

int

$startBlock

$startBlock : int

Starting block (small or big) for this PPS's data inside the container.

Type

int

$Size

$Size : int

The size of the PPS's data (in bytes).

Type

int

$_data

$_data : string

The PPS's data (only used if it's not using a temporary file).

Type

string

$children

$children : array

Array of child PPS's (only used by Root and Dir PPS's).

Type

array

$ole

$ole : \PhpOffice\PhpSpreadsheet\Shared\OLE

Pointer to OLE container.

Type

OLE

$fileHandle

$fileHandle : resource

Type

resource

$smallBlockSize

$smallBlockSize : int

Type

int

$bigBlockSize

$bigBlockSize : int

Type

int

Methods

__construct()

__construct(int  $time_1st, int  $time_2nd, \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File[]  $raChild) : mixed

The constructor.

Parameters

int $time_1st

A timestamp

int $time_2nd

A timestamp

\PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File[] $raChild

Returns

mixed —

getDataLen()

getDataLen() : int

Returns the amount of data saved for this PPS.

Returns

int —

The amount of data (in bytes)

getPpsWk()

getPpsWk() : string

Returns a string with the PPS's WK (What is a WK?).

Returns

string —

The binary string

savePpsSetPnt()

savePpsSetPnt(array  $raList, mixed  $to_save, mixed  $depth) : int

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.

Parameters

array $raList

Reference to the array of PPS's for the whole OLE container

mixed $to_save
mixed $depth

Returns

int —

The index for this PPS

save()

save(resource  $fileHandle) : bool

Method for saving the whole OLE container (including files).

In fact, if called with an empty argument (or '-'), it saves to a temporary file and then outputs it's contents to stdout. If a resource pointer to a stream created by fopen() is passed it will be used, but you have to close such stream by yourself.

Parameters

resource $fileHandle

the name of the file or stream where to save the OLE container

Returns

bool —

true on success

calcSize()

calcSize(array  $raList) : float[]

Calculate some numbers.

Parameters

array $raList

Reference to an array of PPS's

Returns

float[] —

The array of numbers

adjust2()

adjust2(int  $i2) : float

Helper function for caculating a magic value for block sizes.

Parameters

int $i2

The argument

Returns

float —

saveHeader()

saveHeader(int  $iSBDcnt, int  $iBBcnt, int  $iPPScnt) : void

Save OLE header.

Parameters

int $iSBDcnt
int $iBBcnt
int $iPPScnt

saveBigData()

saveBigData(int  $iStBlk, array  $raList) : void

Saving big data (PPS's with data bigger than \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL).

Parameters

int $iStBlk
array $raList

Reference to array of PPS's

makeSmallData()

makeSmallData(array  $raList) : string

get small data (PPS's with data smaller than \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL).

Parameters

array $raList

Reference to array of PPS's

Returns

string —

savePps()

savePps(array  $raList) : void

Saves all the PPS's WKs.

Parameters

array $raList

Reference to an array with all PPS's

saveBbd()

saveBbd(int  $iSbdSize, int  $iBsize, int  $iPpsCnt) : void

Saving Big Block Depot.

Parameters

int $iSbdSize
int $iBsize
int $iPpsCnt