HumHub Documentation (unofficial)

Root extends PPS
in package

Class for creating Root PPS's for OLE containers.

Tags
author

Xavier Noguer xnoguer@php.net

Table of Contents

Constants

ALL_ONE_BITS  = (PHP_INT_SIZE > 4) ? 0xffffffff : -1

Properties

$_data  : string
The PPS's data (only used if it's not using a temporary file).
$children  : array<string|int, mixed>
Array of child PPS's (only used by Root and Dir PPS's).
$DirPps  : int
The index of it's first child if this is a Dir or Root PPS.
$Name  : string
The PPS name (in Unicode).
$NextPps  : int
The index of the next PPS.
$No  : int
The PPS index.
$ole  : OLE
Pointer to OLE container.
$PrevPps  : int
The index of the previous PPS.
$Size  : int
The size of the PPS's data (in bytes).
$startBlock  : int|null
Starting block (small or big) for this PPS's data inside the container.
$Time1st  : float|int
A timestamp.
$Time2nd  : float|int
A timestamp.
$Type  : int
The PPS type. Dir, Root or File.
$bigBlockSize  : int|null
$fileHandle  : resource
$smallBlockSize  : int|null

Methods

__construct()  : mixed
The constructor.
getDataLen()  : int
Returns the amount of data saved for this PPS.
getPpsWk()  : string
Returns a string with the PPS's WK (What is a WK?).
save()  : bool
Method for saving the whole OLE container (including files).
savePpsSetPnt()  : 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.
adjust2()  : float
Helper function for caculating a magic value for block sizes.
calcSize()  : array<string|int, float>
Calculate some numbers.
makeSmallData()  : string
get small data (PPS's with data smaller than \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL).
saveBbd()  : void
Saving Big Block Depot.
saveBigData()  : void
Saving big data (PPS's with data bigger than \PhpOffice\PhpSpreadsheet\Shared\OLE::OLE_DATA_SIZE_SMALL).
saveHeader()  : void
Save OLE header.
savePps()  : void
Saves all the PPS's WKs.

Constants

ALL_ONE_BITS

private mixed ALL_ONE_BITS = (PHP_INT_SIZE > 4) ? 0xffffffff : -1

Properties

$_data

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

public string $_data = ''

$children

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

public array<string|int, mixed> $children = []

$DirPps

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

public int $DirPps

$Name

The PPS name (in Unicode).

public string $Name

$NextPps

The index of the next PPS.

public int $NextPps

$No

The PPS index.

public int $No

$ole

Pointer to OLE container.

public OLE $ole

$PrevPps

The index of the previous PPS.

public int $PrevPps

$Size

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

public int $Size

$startBlock

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

public int|null $startBlock = null

$Time1st

A timestamp.

public float|int $Time1st

$Time2nd

A timestamp.

public float|int $Time2nd

$Type

The PPS type. Dir, Root or File.

public int $Type

$bigBlockSize

private int|null $bigBlockSize = null

$fileHandle

private resource $fileHandle

$smallBlockSize

private int|null $smallBlockSize = null

Methods

__construct()

The constructor.

public __construct(null|float|int $time_1st, null|float|int $time_2nd, array<string|int, File> $raChild) : mixed
Parameters
$time_1st : null|float|int

A timestamp

$time_2nd : null|float|int

A timestamp

$raChild : array<string|int, File>

getDataLen()

Returns the amount of data saved for this PPS.

public getDataLen() : int
Return values
int —

The amount of data (in bytes)

getPpsWk()

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

public getPpsWk() : string
Return values
string —

The binary string

save()

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

public save(resource $fileHandle) : bool

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
$fileHandle : resource

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

Return values
bool —

true on success

savePpsSetPnt()

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.

public static savePpsSetPnt(array<string|int, mixed> &$raList, mixed $to_save[, int $depth = 0 ]) : int
Parameters
$raList : array<string|int, mixed>

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

$to_save : mixed
$depth : int = 0
Return values
int —

The index for this PPS

adjust2()

Helper function for caculating a magic value for block sizes.

private static adjust2(int $i2) : float
Parameters
$i2 : int

The argument

Tags
see
save()
Return values
float

calcSize()

Calculate some numbers.

private calcSize(array<string|int, mixed> &$raList) : array<string|int, float>
Parameters
$raList : array<string|int, mixed>

Reference to an array of PPS's

Return values
array<string|int, float> —

The array of numbers

makeSmallData()

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

private makeSmallData(array<string|int, mixed> &$raList) : string
Parameters
$raList : array<string|int, mixed>

Reference to array of PPS's

Return values
string

saveBbd()

Saving Big Block Depot.

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

saveBigData()

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

private saveBigData(int $iStBlk, array<string|int, mixed> &$raList) : void
Parameters
$iStBlk : int
$raList : array<string|int, mixed>

Reference to array of PPS's

saveHeader()

Save OLE header.

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

savePps()

Saves all the PPS's WKs.

private savePps(array<string|int, mixed> &$raList) : void
Parameters
$raList : array<string|int, mixed>

Reference to an array with all PPS's


        
On this page

Search results