public function eZSIBlockFunction($functionName = 'si-block') { $this->FunctionName = $functionName; // block type : ESI or SSI $this->SIBlockHandler = eZSIBlockFunction::loadSIBlockHandler(); // file handling $this->SIFileHandler = eZSIBlockFunction::loadSIFileHandler(); }
function removeFileIfNeeded($expiredBlock, $db) { $ini = eZINI::instance('ezsi.ini'); $deleteSIBlockOnFailure = $ini->variable('CronjobSettings', 'DeleteSIBlockOnFailure'); $fileHandler = eZSIBlockFunction::loadSIFileHandler(); if ($deleteSIBlockOnFailure == 'enabled') { $sql = "DELETE FROM ezsi_files WHERE namehash = '" . $expiredBlock['namehash'] . "'"; if ($db->query($sql)) { $pathInfo = pathinfo($expiredBlock['filepath']); if (!$fileHandler->removeFile($pathInfo['dirname'], $pathInfo['basename'])) { eZDebug::writeError('Removing of SI block ' . $expiredBlock['filepath'] . ' failed'); } } else { eZDebug::writeError('Unable to remove the SI block row ' . $expiredBlock['namehash'] . ' from the database'); } } }
private function processTTLIsValidFunction($ttl) { $eZSIBlock = new eZSIBlockFunction(); $key = 'dummykey'; $functionParameters = $this->buildFunctionParameters($key, $ttl); return $eZSIBlock->ttlIsValid($this->templateResource, $this->textElements, $this->functionChildren, $functionParameters, $this->functionPlacement, $this->rootNamespace, $this->currentNamespace); }