Skip to content

Commit

Permalink
Improve Excel reader performance and compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeboer committed Jun 18, 2014
1 parent 3074a11 commit 1f58609
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Ddeboer/DataImport/Reader/ExcelReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class ExcelReader implements ReaderInterface
*/
public function __construct(\SplFileObject $file, $headerRowNumber = null, $activeSheet = null)
{
$excel = \PHPExcel_IOFactory::load($file->getPathname());
$reader = \PHPExcel_IOFactory::createReaderForFile($file->getPathName());
$reader->setReadDataOnly(true);
$excel = $reader->load($file->getPathname());

if (null !== $activeSheet) {
$excel->setActiveSheetIndex($activeSheet);
Expand Down

0 comments on commit 1f58609

Please sign in to comment.