/** * Store the given I2CE_MagicDataNode into APC * @param I2CE_MagicDataNode $node * @returns boolean. True on sucess */ public function store($node) { $save_data = array('type' => $node->getType()); if ($node->is_scalar()) { $save_data['value'] = $node->getSaveValue(); } else { $save_data['value'] = null; } $children = $node->getKeys(null, true); if (count($children) > 0) { $save_data['children'] = $children; } else { $save_data['children'] = null; } if (!$this->memcached->set($this->getKey($node), $save_data, self::TIMEOUT)) { I2CE_MagicDataNode::raiseError("Error saving to Memcached " . $node->getPath() . " Type: " . $node->getType() . " Children: " . print_r($save_data['children'], true) . " Message: " . $this->memcached->getResultMessage() . " Stats: " . print_r($this->memcached->getStats(), true) . " Value: " . $save_data['value']); return false; } else { return true; } }
/** * Adds the report limit node to its content node * @param DOMNode $contentNode * @param DOMNode $limitnode * @param I2CE_MagicDataNode $limitConfig */ protected function displayReportLimit($contentNode, $limitNode, $limitConfig) { if (!($limitContainer = $this->template->appendFileByNode('display_report_limit.html', '//*[@name="limit_container"][1]', $contentNode))) { I2CE::raiseError("Could not load display_report_limit.html"); return false; } if (!$limitConfig->is_scalar('header')) { $header = $limitConfig->getName(); } else { $header = $limitConfig->header; } $this->template->setDisplayDataImmediate('header', $header, $limitContainer); if (!($inputNode = $this->template->getElementByName('limit', 0, $limitContainer)) instanceof DOMElement) { I2CE::raiseError("Could not get limit node in display_report_limit.html"); return false; } $inputNode->appendChild($limitNode); return true; }