Lazy Loader for Cell Data

Topics: Developer Forum
Oct 14, 2010 at 12:19 AM



On some pages there are mentions for a "lazy loader" in PHPExcel and after an unsuccessfull search, I wonder if it is a lazy-loader for cell data or just a nice name for the application init routine.

Is there a smart loader for the cells of xlsx files and may you tell me the class or global settings name? The source documentation does not say so or maybe it is not called "lazy" or similar...


Thanks and kind regards


Oct 14, 2010 at 7:37 AM
Edited Oct 14, 2010 at 7:38 AM

The "Lazy Loader" is the class loader, that only loads the PHPExcel code that is actaully required by your script at the point when it is actually needed. This is not configurable in any way, it simply happens, and is controlled through the PHPExcel_Autoloader class in Autoloader.php.

There is no smart loader for cells: the closest you'll find is the "cell caching" mechanism, which allows the cell objects maintained by PHPExcel to be held outside of PHP's memory, reducing the overall memory footprint required for holding workbook data. This can be configured through PHPExcel_Settings::setCacheStorageMethod() which uses the PHPExcel_CachedObjectStorageFactory class. This is detailed in section 4.2.1 of the developer documentation.

Oct 15, 2010 at 9:24 AM

Thanks, Mark, for this fast reply and information.


May I add one more question on this topic:

Is there a way to run faster if I am going to append some data. E.g. I do not want to change or read the rows 1-10000, but start from 10001 for pushing content into a xlsx sheet. I did not find an alternative o the typical .load() function.


Thanks again

Oct 15, 2010 at 9:29 AM


No there isn't. PHPExcel doesn't have any mechanism that allows data to be appended to a workbook file without accessing the other content in that file.