Differences Between: [Versions 402 and 403]
1 <?php 2 3 declare(strict_types=1); 4 5 namespace OpenSpout\Writer\ODS\Manager; 6 7 use OpenSpout\Writer\Common\Entity\Sheet; 8 use OpenSpout\Writer\Common\Entity\Workbook; 9 use OpenSpout\Writer\Common\Manager\AbstractWorkbookManager; 10 use OpenSpout\Writer\Common\Manager\Style\StyleMerger; 11 use OpenSpout\Writer\ODS\Helper\FileSystemHelper; 12 use OpenSpout\Writer\ODS\Manager\Style\StyleManager; 13 use OpenSpout\Writer\ODS\Options; 14 15 /** 16 * @internal 17 * 18 * @property WorksheetManager $worksheetManager 19 * @property FileSystemHelper $fileSystemHelper 20 * @property StyleManager $styleManager 21 */ 22 final class WorkbookManager extends AbstractWorkbookManager 23 { 24 /** 25 * Maximum number of rows a ODS sheet can contain. 26 * 27 * @see https://ask.libreoffice.org/en/question/8631/upper-limit-to-number-of-rows-in-calc/ 28 */ 29 private static int $maxRowsPerWorksheet = 1048576; 30 31 public function __construct( 32 Workbook $workbook, 33 Options $options, 34 WorksheetManager $worksheetManager, 35 StyleManager $styleManager, 36 StyleMerger $styleMerger, 37 FileSystemHelper $fileSystemHelper 38 ) { 39 parent::__construct( 40 $workbook, 41 $options, 42 $worksheetManager, 43 $styleManager, 44 $styleMerger, 45 $fileSystemHelper 46 ); 47 } 48 49 /** 50 * @return int Maximum number of rows/columns a sheet can contain 51 */ 52 protected function getMaxRowsPerWorksheet(): int 53 { 54 return self::$maxRowsPerWorksheet; 55 } 56 57 /** 58 * Writes all the necessary files to disk and zip them together to create the final file. 59 * 60 * @param resource $finalFilePointer Pointer to the spreadsheet that will be created 61 */ 62 protected function writeAllFilesToDiskAndZipThem($finalFilePointer): void 63 { 64 $worksheets = $this->getWorksheets(); 65 $numWorksheets = \count($worksheets); 66 67 $this->fileSystemHelper 68 ->createContentFile($this->worksheetManager, $this->styleManager, $worksheets) 69 ->deleteWorksheetTempFolder() 70 ->createStylesFile($this->styleManager, $numWorksheets) 71 ->zipRootFolderAndCopyToStream($finalFilePointer) 72 ; 73 } 74 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body