【发布时间】:2013-01-16 13:30:19
【问题描述】:
由于内存问题(不断耗尽),我基本上试图启用单元缓存,它是一个相当大的电子表格。从我读过的内容来看,在线单元缓存是一个很好的方法
根据我在网上找到的示例,它看起来像这样
stackoverflow - fix memory error
$oExcel = new PHPExcel();
$cacheMethod = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
$cacheSettings = array( 'memoryCacheSize' => '512MB');
PHPExcel_Settings::setCacheStorageMethod($cacheMethod,$cacheSettings);
上面的问题是我没有用设置设置excel对象吗?
$oExcel->setCacheStorageMethod($cacheMethod,$cacheSettings); // this returns method not found error
我认为我只是初始化错了吗?
【问题讨论】:
-
所以文档说
setCacheStorageMethod是静态的? -
无法在文档中找到对它的引用。然而发现这是讨论。 phpexcel.codeplex.com/discussions/234530
-
Here you can find similar question with quite extensive answer 包括 setCacheStorageMethod 的工作示例。希望对您有所帮助!
-
对于文档,我的意思是无论您在哪里阅读
PHPExcel_Settings::setCacheStorageMethod($cacheMethod,$cacheSettings);位。它显示为PHPExcel_Settings类的静态方法,而不是PHPExcel类的常规方法。
标签: php caching memory-leaks phpexcel