Exceptions
Exception
Symfony\Component\ErrorHandler\Error\ OutOfMemoryError
$this->storeCurrentCell();
}
$column = 0;
$row = '';
sscanf($cellCoordinate, '%[A-Z]%d', $column, $row);
$this->index[$cellCoordinate] = (--$row * self::MAX_COLUMN_ID) + Coordinate::columnIndexFromString((string) $column);
$this->currentCoordinate = $cellCoordinate;
$this->currentCell = $cell;
$this->currentCellIsDirty = true;
in
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
->
add
(line 1401)
*/
public function createNewCell($coordinate): Cell
{
[$column, $row, $columnString] = Coordinate::indexesFromString($coordinate);
$cell = new Cell(null, DataType::TYPE_NULL, $this);
$this->cellCollection->add($coordinate, $cell);
// Coordinates
if ($column > $this->cachedHighestColumn) {
$this->cachedHighestColumn = $column;
}
in
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
->
createNewCell
(line 1289)
/** @var Worksheet $sheet */
[$sheet, $finalCoordinate] = $this->getWorksheetAndCoordinate($cellAddress);
$cell = $sheet->cellCollection->get($finalCoordinate);
return $cell ?? $sheet->createNewCell($finalCoordinate);
}
/**
* Get the correct Worksheet and coordinate from a coordinate that may
* contains reference to another sheet or a named range.
in
vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
->
getCell
(line 3019)
$this->getCell($currentColumn . $startRow)->setValue($cellValue);
}
} else {
if ($cellValue != $nullValue) {
// Set cell value
$this->getCell($currentColumn . $startRow)->setValue($cellValue);
}
}
++$currentColumn;
}
++$startRow;
$sheet->getStyle($cols . '2:' . $cols . (count($dataset) + 1))->applyFromArray($styleBorder);
$cols++;
}
}
$sheet->fromArray($dataset, null, 'A2');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="' . substr($publikasi->getJudul(), 0, 30) . '.' . $tipe . '"');
if ($tipe == 'xlsx') {
in
vendor/symfony/http-kernel/HttpKernel.php
->
downloadExcel
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Debug::enable();
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
<?php
use App\Kernel;
use Symfony\Component\Dotenv\Dotenv;
use Symfony\Component\ErrorHandler\Debug;
Stack Trace
OutOfMemoryError
|
---|
Symfony\Component\ErrorHandler\Error\OutOfMemoryError: Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10485760 bytes) at vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php:395 at PhpOffice\PhpSpreadsheet\Collection\Cells->add() (vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php:1401) at PhpOffice\PhpSpreadsheet\Worksheet\Worksheet->createNewCell() (vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php:1289) at PhpOffice\PhpSpreadsheet\Worksheet\Worksheet->getCell() (vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php:3019) at PhpOffice\PhpSpreadsheet\Worksheet\Worksheet->fromArray() (src/Controller/Frontend/DatasetController.php:363) at App\Controller\Frontend\DatasetController->downloadExcel() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at App\Kernel->handle() (public/index.php:20) at {main}() |