/** * Constructor * * @access public * @param integer $time_1st A timestamp * @param integer $time_2nd A timestamp */ function OLE_PPS_Root($time_1st, $time_2nd, $raChild) { $_ole = new OLE(); $_sys = new System(); $this->_tmp_dir = $_sys->tmpdir(); $this->OLE_PPS(null, $_ole->Asc2Ucs('Root Entry'), OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); }
/** * Constructor * * @access public * @param integer $time_1st A timestamp * @param integer $time_2nd A timestamp */ function OLE_PPS_Root($time_1st, $time_2nd, $raChild) { $this->_tmp_dir = ''; $this->OLE_PPS( null, OLE::Asc2Ucs('Root Entry'), OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); }
/** * Constructor * * @access public * @param integer $time_1st A timestamp * @param integer $time_2nd A timestamp */ function __construct($time_1st, $time_2nd, $raChild) { $this->_tmp_dir = System::tmpdir(); parent::__construct( null, OLE::Asc2Ucs('Root Entry'), OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); }
/** * Store the workbook in an OLE container * * @access private * @return mixed true on success. PEAR_Error on failure */ function _storeOLEFile() { if ($this->_BIFF_version == 0x600) { $OLE = new OLE_PPS_File(OLE::Asc2Ucs('Workbook')); } else { $OLE = new OLE_PPS_File(OLE::Asc2Ucs('Book')); } if ($this->_tmp_dir != '') { $OLE->setTempDir($this->_tmp_dir); } $res = $OLE->init(); if ($this->isError($res)) { return $this->raiseError("OLE Error: " . $res->getMessage()); } $OLE->append($this->_data); $total_worksheets = count($this->_worksheets); for ($i = 0; $i < $total_worksheets; $i++) { while ($tmp = $this->_worksheets[$i]->getData()) { $OLE->append($tmp); } } $root = new OLE_PPS_Root(time(), time(), array($OLE)); if ($this->_tmp_dir != '') { $root->setTempDir($this->_tmp_dir); } $res = $root->save($this->_filename); if ($this->isError($res)) { return $this->raiseError("OLE Error: " . $res->getMessage()); } return true; }
/** * Store the workbook in an OLE container * * @access private * @return mixed true on success. PEAR_Error on failure */ protected function storeOLEFile() { if ($this->BIFF_version == 0x600) { $OLE = new OLE_PPS_File(OLE::Asc2Ucs('Workbook')); } else { $OLE = new OLE_PPS_File(OLE::Asc2Ucs('Book')); } if ($this->temporaryDirectory != '') { $OLE->setTempDir($this->temporaryDirectory); } $res = $OLE->init(); if ($this->isError($res)) { return $this->raiseError('OLE Error: ' . $res->getMessage()); } $OLE->append($this->data); $total_worksheets = count($this->workSheet); for ($i = 0; $i < $total_worksheets; ++$i) { while ($tmp = $this->workSheet[$i]->getData()) { $OLE->append($tmp); } } $root = new OLE_PPS_Root(time(), time(), array($OLE)); if ($this->temporaryDirectory != '') { $root->setTempDir($this->temporaryDirectory); } $res = $root->save($this->fileName); if ($this->isError($res)) { return $this->raiseError('OLE Error: ' . $res->getMessage()); } return true; }