/** * {@inheritdoc} */ public function startCall($method, array $params = null, array $env = null) { if ($this->enabled && $this->logger) { if (is_array($params)) { foreach ($params as $index => $param) { if (!is_string($params[$index])) { continue; } // non utf-8 strings break json encoding if (!preg_match('#[\\p{L}\\p{N} ]#u', $params[$index])) { $params[$index] = self::BINARY_DATA_VALUE; continue; } // detect if the too long string must be shorten if (function_exists('mb_detect_encoding') && false !== ($encoding = mb_detect_encoding($params[$index]))) { if (self::MAX_STRING_LENGTH < mb_strlen($params[$index], $encoding)) { $params[$index] = mb_substr($params[$index], 0, self::MAX_STRING_LENGTH - 6, $encoding) . ' [...]'; continue; } } else { if (self::MAX_STRING_LENGTH < strlen($params[$index])) { $params[$index] = substr($params[$index], 0, self::MAX_STRING_LENGTH - 6) . ' [...]'; continue; } } } } $this->logger->info($method, array('params' => $params, 'env' => $env)); } }
/** * {@inheritDocs} */ public function getUrlInformation() { $contentDocuments = $this->fetchSitemapDocuments(); $urlInformationList = array(); foreach ($contentDocuments as $document) { if (null != $this->publishWorkflowChecker && !$this->publishWorkflowChecker->isGranted(array(PublishWorkflowChecker::VIEW_ATTRIBUTE), $document)) { continue; } try { $urlInformationList[] = $this->computeUrlInformationFromSitemapDocument($document); } catch (\Exception $e) { $this->logger->info($e->getMessage()); } } return $urlInformationList; }