You are here

function _feeds_xls_initialise_phpexcel in Feeds XLS 7

Get a PHPExcel cache object. This gets the most efficient cache object that this environment is capable of using.

2 calls to _feeds_xls_initialise_phpexcel()
feeds_xls_download_template_helper in ./feeds_xls.template.inc
feeds_xls_redirect_to_populated_file in ./feeds_xls.template.inc
Finish function for populate data.

File

./feeds_xls.template.inc, line 42

Code

function _feeds_xls_initialise_phpexcel($save_memory = FALSE) {

  // Load the library.
  feeds_xls_load_phpexcel();

  // We use the IGBinary cache method, as it is the quickest. If we run in to
  // memory issues, then the SQLite3 function is far more efficient with memory.
  if ($save_memory) {
    $cache_method = PHPExcel_CachedObjectStorageFactory::cache_to_sqlite3;
  }
  else {
    $cache_method = PHPExcel_CachedObjectStorageFactory::cache_igbinary;
  }
  if (!PHPExcel_Settings::setCacheStorageMethod($cache_method)) {
    $cache_method = PHPExcel_CachedObjectStorageFactory::cache_to_phpTemp;
    PHPExcel_Settings::setCacheStorageMethod($cache_method);
  }
  watchdog('feeds_xls', 'PHPExcel set to use %cache_method cache', array(
    '%cache_method' => $cache_method,
  ), WATCHDOG_INFO);
}