Como determinar o final do arquivo usando a biblioteca PHPExcel no chunk loo

Usando a biblioteca PHPExcel, estou tentando iterar mais de 1500 linhas, cada linha tem cerca de 25 coluna

Estou usando esse código (retirado de @PHPExcel fica com 256, 512 e também 1024 MB de RAM):

/**  Create a new Reader of the type defined in $inputFileType  **/
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
/**  Define how many rows we want to read for each "chunk"  **/ 
$chunkSize = 20;
/**  Create a new Instance of our Read Filter  **/ 
$chunkFilter = new chunkReadFilter(); 
/**  Tell the Reader that we want to use the Read Filter that we've Instantiated  **/ 
$objReader->setReadFilter($chunkFilter); 

/**  Loop to read our worksheet in "chunk size" blocks  **/ 
/**  $startRow is set to 2 initially because we always read the headings in row #1  **/
for ($startRow = 2; $startRow <= 65536; $startRow += $chunkSize) { 
    /**  Tell the Read Filter, the limits on which rows we want to read this iteration        **/ 
$chunkFilter->setRows($startRow,$chunkSize); 
/**  Load only the rows that match our filter from $inputFileName to a PHPExcel Object  **/ 
$objPHPExcel = $objReader->load($inputFileName); 
//    Do some processing here 

//    Free up some of the memory 
$objPHPExcel->disconnectWorksheets(); 
unset($objPHPExcel); 

}

Eu quero processar quantas linhas tiverem dados. Tentei usar o método getHighestRow () do objeto Worksheet, mas ele continuava retornando A1

Também tentei verificar se a próxima linha recuperada estava vazia, escrevendo esta pequena função:

function _emptyRow($row) {
    $empty=true;

    foreach($row as $r) {
    if ($r!='') {
        $empty = false;
        }
    }

    return $empty;

}

Então, se _emptyRow () eu voubreak fora do laço . Isso não funcionou para mi

Alguém pode sugerir uma maneira de recuperar apenas todos os registros que possuem dados? Quando eu executo isso, embora apenas cerca de 1500 linhas tenham dados, ele chega a cerca de 23.000 antes do tempo limite (com set_time_limit (240));

questionAnswers(4)

yourAnswerToTheQuestion