本文整理汇总了PHP中PHPExcel_Calculation::_calculationCacheEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Calculation::_calculationCacheEnabled方法的具体用法?PHP PHPExcel_Calculation::_calculationCacheEnabled怎么用?PHP PHPExcel_Calculation::_calculationCacheEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPExcel_Calculation
的用法示例。
在下文中一共展示了PHPExcel_Calculation::_calculationCacheEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calculateFormula
/**
* Calculate the value of a formula
*
* @param string $formula Formula to parse
* @return mixed
* @throws Exception
*/
public function calculateFormula($formula, $cellID = null, PHPExcel_Cell $pCell = null)
{
// Initialise the logging settings
$this->formulaError = null;
$this->debugLog = $this->debugLogStack = array();
// Disable calculation cacheing because it only applies to cell calculations, not straight formulae
// But don't actually flush any cache
$resetCache = $this->getCalculationCacheEnabled();
self::$_calculationCacheEnabled = false;
// Execute the calculation
try {
$result = self::_unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell));
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
// Reset calculation cacheing to its previous state
self::$_calculationCacheEnabled = $resetCache;
return $result;
}