{"action":"created","issue":{"url":"https://api.github.com/repos/box/spout/issues/119","labels_url":"https://api.github.com/repos/box/spout/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/box/spout/issues/119/comments","events_url":"https://api.github.com/repos/box/spout/issues/119/events","html_url":"https://github.com/box/spout/issues/119","id":109045103,"number":119,"title":"ZipHelper close hits max execution time","user":{"login":"axelvnk","id":6803540,"avatar_url":"https://avatars.githubusercontent.com/u/6803540?v=3","gravatar_id":"","url":"https://api.github.com/users/axelvnk","html_url":"https://github.com/axelvnk","followers_url":"https://api.github.com/users/axelvnk/followers","following_url":"https://api.github.com/users/axelvnk/following{/other_user}","gists_url":"https://api.github.com/users/axelvnk/gists{/gist_id}","starred_url":"https://api.github.com/users/axelvnk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axelvnk/subscriptions","organizations_url":"https://api.github.com/users/axelvnk/orgs","repos_url":"https://api.github.com/users/axelvnk/repos","events_url":"https://api.github.com/users/axelvnk/events{/privacy}","received_events_url":"https://api.github.com/users/axelvnk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-30T09:00:22Z","updated_at":"2015-09-30T09:28:04Z","closed_at":null,"body":"First of all, great library! So thanks! :) \r\n\r\nI'm reading a CSV with about 25k lines and at the same time writing it into an Excel file. \r\n\r\n``````\r\n        /** @var Reader $csvReader */\r\n        $csvReader = ReaderFactory::create(Type::CSV);\r\n        $csvReader->setFieldDelimiter($delimiter);\r\n        $csvReader->open($fileName);\r\n\r\n        /** @var Writer $excelWriter */\r\n        $excelWriter = WriterFactory::create(Type::XLSX);\r\n        $tmpExportFile = tempnam(\"/tmp\", \"export\");\r\n        $excelWriter->openToFile($tmpExportFile);\r\n\r\n        foreach ($csvReader->getSheetIterator() as $sheet) {\r\n            foreach ($sheet->getRowIterator() as $row) {\r\n                $excelWriter->addRow($row);\r\n            }\r\n        }\r\n\r\n        $csvReader->close();\r\n        $excelWriter->close();\r\n````````\r\n\r\nHowever, it actually gets to closing the writer. I'm not sure how this library works internally (i guess with tmp files).\r\n\r\n<img width=\"940\" alt=\"screen shot 2015-09-30 at 10 57 59\" src=\"https://cloud.githubusercontent.com/assets/6803540/10188767/4ee24a7e-6762-11e5-9fa6-359932b3c906.png\">\r\n\r\nAny idea how I can process this without increasing the max execution time in php?"},"comment":{"url":"https://api.github.com/repos/box/spout/issues/comments/144337396","html_url":"https://github.com/box/spout/issues/119#issuecomment-144337396","issue_url":"https://api.github.com/repos/box/spout/issues/119","id":144337396,"user":{"login":"adrilo","id":7086917,"avatar_url":"https://avatars.githubusercontent.com/u/7086917?v=3","gravatar_id":"","url":"https://api.github.com/users/adrilo","html_url":"https://github.com/adrilo","followers_url":"https://api.github.com/users/adrilo/followers","following_url":"https://api.github.com/users/adrilo/following{/other_user}","gists_url":"https://api.github.com/users/adrilo/gists{/gist_id}","starred_url":"https://api.github.com/users/adrilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrilo/subscriptions","organizations_url":"https://api.github.com/users/adrilo/orgs","repos_url":"https://api.github.com/users/adrilo/repos","events_url":"https://api.github.com/users/adrilo/events{/privacy}","received_events_url":"https://api.github.com/users/adrilo/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T09:28:04Z","updated_at":"2015-09-30T09:28:04Z","body":"Thanks @axelvnk !\r\n\r\nContrary to CSV where you can add easily add data to an existing CSV file (and therefore split the 25k lines into five 5k lines, hence reducing the execution time by 5 for each batch), it's not possible to add data to an existing XLSX file.\r\nXLSX files are basicaly a bunch of XML files describing the data, zipped together. Unfortunately, I don't have a solution to write that much rows into a XLSX file. By nature, writing a lot of rows will take time.\r\n\r\nSpout, by default, optimizes the writing process. So unless you explicitely used shared strings instead of inline strings (https://github.com/box/spout#strings-storage-xlsx-writer), there's not much you can't do without increasing the max execution time."}}