Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/OLE/PPS/Root.php
public function _saveBbd($iSbdSize, $iBsize, $iPpsCnt)
    {
        $FILE = $this->fileHandle;
        // Calculate Basic Setting
        $iBbCnt = $this->bigBlockSize / OLE::OLE_LONG_INT_SIZE;
        $i1stBdL = ($this->bigBlockSize - 0x4C) / OLE::OLE_LONG_INT_SIZE;

        $iBdExL = 0;
        $iAll = $iBsize + $iPpsCnt + $iSbdSize;
        $iAllW = $iAll;
        $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0);
        $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0);
        // Calculate BD count
        if ($iBdCnt > $i1stBdL) {
            while (1) {
                ++$iBdExL;
                ++$iAllW;
                $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0);
                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0);
                if ($iBdCnt <= ($iBdExL * $iBbCnt + $i1stBdL)) {
                    break;
                }
            }
        }

        // Making BD
        // Set for SBD
        if ($iSbdSize > 0) {
            for ($i = 0; $i < ($iSbdSize - 1); ++$i) {
                fwrite($FILE, pack('V', $i + 1));
            }
            fwrite($FILE, pack('V', -2));
        }
        // Set for B
        for ($i = 0; $i < ($iBsize - 1); ++$i) {
            fwrite($FILE, pack('V', $i + $iSbdSize + 1));
        }
        fwrite($FILE, pack('V', -2));

        // Set for PPS
        for ($i = 0; $i < ($iPpsCnt - 1); ++$i) {
            fwrite($FILE, pack('V', $i + $iSbdSize + $iBsize + 1));
        }
        fwrite($FILE, pack('V', -2));
        // Set for BBD itself ( 0xFFFFFFFD : BBD)
        for ($i = 0; $i < $iBdCnt; ++$i) {
            fwrite($FILE, pack('V', 0xFFFFFFFD));
        }
        // Set for ExtraBDList
        for ($i = 0; $i < $iBdExL; ++$i) {
            fwrite($FILE, pack('V', 0xFFFFFFFC));
        }
        // Adjust for Block
        if (($iAllW + $iBdCnt) % $iBbCnt) {
            $iBlock = ($iBbCnt - (($iAllW + $iBdCnt) % $iBbCnt));
            for ($i = 0; $i < $iBlock; ++$i) {
                fwrite($FILE, pack('V', -1));
            }
        }
        // Extra BDList
        if ($iBdCnt > $i1stBdL) {
            $iN = 0;
            $iNb = 0;
            for ($i = $i1stBdL; $i < $iBdCnt; $i++, ++$iN) {
                if ($iN >= ($iBbCnt - 1)) {
                    $iN = 0;
                    ++$iNb;
                    fwrite($FILE, pack('V', $iAll + $iBdCnt + $iNb));
                }
                fwrite($FILE, pack('V', $iBsize + $iSbdSize + $iPpsCnt + $i));
            }
            if (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)) {
                $iB = ($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1));
                for ($i = 0; $i < $iB; ++$i) {
                    fwrite($FILE, pack('V', -1));
                }
            }
            fwrite($FILE, pack('V', -2));
        }
    }
public function _saveBbd($iSbdSize, $iBsize, $iPpsCnt)
    {
        $FILE = $this->fileHandle;
        // Calculate Basic Setting
        $iBbCnt = $this->bigBlockSize / OLE::OLE_LONG_INT_SIZE;
        $i1stBdL = ($this->bigBlockSize - 0x4C) / OLE::OLE_LONG_INT_SIZE;

        $iBdExL = 0;
        $iAll = $iBsize + $iPpsCnt + $iSbdSize;
        $iAllW = $iAll;
        $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0);
        $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0);
        // Calculate BD count
        if ($iBdCnt > $i1stBdL) {
            while (1) {
                ++$iBdExL;
                ++$iAllW;
                $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt) ? 1 : 0);
                $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW + $iBdCntW) % $iBbCnt) ? 1 : 0);
                if ($iBdCnt <= ($iBdExL * $iBbCnt + $i1stBdL)) {
                    break;
                }
            }
        }

        // Making BD
        // Set for SBD
        if ($iSbdSize > 0) {
            for ($i = 0; $i < ($iSbdSize - 1); ++$i) {
                fwrite($FILE, pack('V', $i + 1));
            }
            fwrite($FILE, pack('V', -2));
        }
        // Set for B
        for ($i = 0; $i < ($iBsize - 1); ++$i) {
            fwrite($FILE, pack('V', $i + $iSbdSize + 1));
        }
        fwrite($FILE, pack('V', -2));

        // Set for PPS
        for ($i = 0; $i < ($iPpsCnt - 1); ++$i) {
            fwrite($FILE, pack('V', $i + $iSbdSize + $iBsize + 1));
        }
        fwrite($FILE, pack('V', -2));
        // Set for BBD itself ( 0xFFFFFFFD : BBD)
        for ($i = 0; $i < $iBdCnt; ++$i) {
            fwrite($FILE, pack('V', 0xFFFFFFFD));
        }
        // Set for ExtraBDList
        for ($i = 0; $i < $iBdExL; ++$i) {
            fwrite($FILE, pack('V', 0xFFFFFFFC));
        }
        // Adjust for Block
        if (($iAllW + $iBdCnt) % $iBbCnt) {
            $iBlock = ($iBbCnt - (($iAllW + $iBdCnt) % $iBbCnt));
            for ($i = 0; $i < $iBlock; ++$i) {
                fwrite($FILE, pack('V', -1));
            }
        }
        // Extra BDList
        if ($iBdCnt > $i1stBdL) {
            $iN = 0;
            $iNb = 0;
            for ($i = $i1stBdL; $i < $iBdCnt; $i++, ++$iN) {
                if ($iN >= ($iBbCnt - 1)) {
                    $iN = 0;
                    ++$iNb;
                    fwrite($FILE, pack('V', $iAll + $iBdCnt + $iNb));
                }
                fwrite($FILE, pack('V', $iBsize + $iSbdSize + $iPpsCnt + $i));
            }
            if (($iBdCnt - $i1stBdL) % ($iBbCnt - 1)) {
                $iB = ($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1));
                for ($i = 0; $i < $iB; ++$i) {
                    fwrite($FILE, pack('V', -1));
                }
            }
            fwrite($FILE, pack('V', -2));
        }
    }
public function _saveBbd ( $ iSbdSize , $ iBsize , $ iPpsCnt ) { $ FILE = $ this -> fileHandle ; // Calculate Basic Setting $ iBbCnt = $ this -> bigBlockSize / OLE :: OLE_LONG_INT_SIZE ; $ i1stBdL = ( $ this -> bigBlockSize - 0x4C ) / OLE :: OLE_LONG_INT_SIZE ; $ iBdExL = 0 ; $ iAll = $ iBsize + $ iPpsCnt + $ iSbdSize ; $ iAllW = $ iAll ; $ iBdCntW = floor ( $ iAllW / $ iBbCnt ) + ( ( $ iAllW % $ iBbCnt ) ? 1 : 0 ) ; $ iBdCnt = floor ( ( $ iAll + $ iBdCntW ) / $ iBbCnt ) + ( ( ( $ iAllW + $ iBdCntW ) % $ iBbCnt ) ? 1 : 0 ) ; // Calculate BD count if ( $ iBdCnt > $ i1stBdL ) { while ( 1 ) { ++ $ iBdExL ; ++ $ iAllW ; $ iBdCntW = floor ( $ iAllW / $ iBbCnt ) + ( ( $ iAllW % $ iBbCnt ) ? 1 : 0 ) ; $ iBdCnt = floor ( ( $ iAllW + $ iBdCntW ) / $ iBbCnt ) + ( ( ( $ iAllW + $ iBdCntW ) % $ iBbCnt ) ? 1 : 0 ) ; if ( $ iBdCnt <= ( $ iBdExL * $ iBbCnt + $ i1stBdL ) ) { break ; } } } // Making BD // Set for SBD if ( $ iSbdSize > 0 ) { for ( $ i = 0 ; $ i < ( $ iSbdSize - 1 ) ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , $ i + 1 ) ) ; } fwrite ( $ FILE , pack ( 'V' , - 2 ) ) ; } // Set for B for ( $ i = 0 ; $ i < ( $ iBsize - 1 ) ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , $ i + $ iSbdSize + 1 ) ) ; } fwrite ( $ FILE , pack ( 'V' , - 2 ) ) ; // Set for PPS for ( $ i = 0 ; $ i < ( $ iPpsCnt - 1 ) ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , $ i + $ iSbdSize + $ iBsize + 1 ) ) ; } fwrite ( $ FILE , pack ( 'V' , - 2 ) ) ; // Set for BBD itself ( 0xFFFFFFFD : BBD) for ( $ i = 0 ; $ i < $ iBdCnt ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , 0xFFFFFFFD ) ) ; } // Set for ExtraBDList for ( $ i = 0 ; $ i < $ iBdExL ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , 0xFFFFFFFC ) ) ; } // Adjust for Block if ( ( $ iAllW + $ iBdCnt ) % $ iBbCnt ) { $ iBlock = ( $ iBbCnt - ( ( $ iAllW + $ iBdCnt ) % $ iBbCnt ) ) ; for ( $ i = 0 ; $ i < $ iBlock ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , - 1 ) ) ; } } // Extra BDList if ( $ iBdCnt > $ i1stBdL ) { $ iN = 0 ; $ iNb = 0 ; for ( $ i = $ i1stBdL ; $ i < $ iBdCnt ; $ i ++ , ++ $ iN ) { if ( $ iN >= ( $ iBbCnt - 1 ) ) { $ iN = 0 ; ++ $ iNb ; fwrite ( $ FILE , pack ( 'V' , $ iAll + $ iBdCnt + $ iNb ) ) ; } fwrite ( $ FILE , pack ( 'V' , $ iBsize + $ iSbdSize + $ iPpsCnt + $ i ) ) ; } if ( ( $ iBdCnt - $ i1stBdL ) % ( $ iBbCnt - 1 ) ) { $ iB = ( $ iBbCnt - 1 ) - ( ( $ iBdCnt - $ i1stBdL ) % ( $ iBbCnt - 1 ) ) ; for ( $ i = 0 ; $ i < $ iB ; ++ $ i ) { fwrite ( $ FILE , pack ( 'V' , - 1 ) ) ; } } fwrite ( $ FILE , pack ( 'V' , - 2 ) ) ; } }
Saving Big Block Depot.

@param int $iSbdSize
@param int $iBsize
@param int $iPpsCnt
Saving Big Block Depot .