php-ext-xlswriter
php-ext-xlswriter copied to clipboard
fix: 内存模式下,设置单个单元格内容格式,内存模式会失效,导致内存不断堆叠溢出
$config = ['path' => '/'];
$excel = new \Vtiful\Kernel\Excel($config);
$fileObject = $excel->constMemory('test.xlsx', '内存占用', false);
for ($index = 0; $index < 10000; $index++) {
for ($column = 0; $column < 300; $column++) {
$mem = self::getMemoryUsage('MemRealUsage');
$mem = $mem / (1024 * 1024);
$fileObject->insertText($index+1, $column, floatval($mem), 'Max$#,##0.00;Max$-#,##0.00');
var_dump($mem);
}
}
$filePath = $fileObject->output();
$fileObject->close();
Hello, have you resolved this issue?
@viest
The extended and dependent versions I am using are as follows. I actively called the close method to destroy resources, but the server content remains consistent and is being added
@viest