本文整理汇总了PHP中TYPO3\Flow\Log\SystemLoggerInterface::log方法的典型用法代码示例。如果您正苦于以下问题:PHP SystemLoggerInterface::log方法的具体用法?PHP SystemLoggerInterface::log怎么用?PHP SystemLoggerInterface::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Log\SystemLoggerInterface
的用法示例。
在下文中一共展示了SystemLoggerInterface::log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrentUserNode
/**
* @return NodeInterface
*/
public function getCurrentUserNode()
{
try {
return $this->profileService->getCurrentPartyProfile();
} catch (\Exception $exception) {
$this->systemLogger->log('Profile node could not be fetched: ' . $exception->getMessage(), LOG_CRIT);
}
}
示例2: getCachedMatchResults
/**
* Checks the cache for the route path given in the Request and returns the result
*
* @param Request $httpRequest
* @return array|boolean the cached route values or FALSE if no cache entry was found
*/
public function getCachedMatchResults(Request $httpRequest)
{
$cachedResult = $this->routeCache->get($this->buildRouteCacheIdentifier($httpRequest));
if ($cachedResult !== FALSE) {
$this->systemLogger->log(sprintf('Router route(): A cached Route with the cache identifier "%s" matched the path "%s".', $this->buildRouteCacheIdentifier($httpRequest), $httpRequest->getRelativePath()), LOG_DEBUG);
}
return $cachedResult;
}
示例3: processReceiverGroup
private function processReceiverGroup(ReceiverGroup $receiverGroup, $language = NULL)
{
$cacheFileName = $receiverGroup->getCacheFileName($language);
$jqProcess = escapeshellarg('cat ' . escapeshellcmd($receiverGroup->getReceiverSource()->getSourceFileName()) . ' | jq -c ' . escapeshellarg($this->convertFilterIntoJqExpression($receiverGroup->getFilter($language))) . ' > ' . escapeshellcmd($cacheFileName) . ' ; wc -l < ' . escapeshellcmd($cacheFileName) . ' > ' . escapeshellcmd($cacheFileName . '.lines'));
$finalProcess = 'nohup /bin/bash -c ' . $jqProcess . ' &';
$this->systemLogger->log('Starting process: ' . $finalProcess);
$proc = new Process($finalProcess);
$proc->start();
}
示例4: initializeSession
/**
* Before advice for all methods annotated with "@Flow\Session(autoStart=true)".
* Those methods will trigger a session initialization if a session does not exist
* yet.
*
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point
* @return void
* @fixme The pointcut expression below does not consider the options of the session annotation – needs adjustments in the AOP framework
* @Flow\Before("methodAnnotatedWith(TYPO3\Flow\Annotations\Session)")
*/
public function initializeSession(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
if ($this->session->isStarted() === TRUE) {
return;
}
$objectName = $this->objectManager->getObjectNameByClassName(get_class($joinPoint->getProxy()));
$methodName = $joinPoint->getMethodName();
$this->systemLogger->log(sprintf('Session initialization triggered by %s->%s.', $objectName, $methodName), LOG_DEBUG);
$this->session->start();
}
示例5: shutdownObject
/**
* Flush caches according to the previously registered node changes.
*
* @return void
*/
public function shutdownObject()
{
if ($this->tagsToFlush !== array()) {
foreach ($this->tagsToFlush as $tag => $logMessage) {
$affectedEntries = $this->contentCache->flushByTag($tag);
if ($affectedEntries > 0) {
$this->systemLogger->log(sprintf('Content cache: Removed %s entries %s', $affectedEntries, $logMessage), LOG_DEBUG);
}
}
}
}
示例6: removeAttendeeAction
/**
* @param string $event
* @param string $person
*
* @return void
*/
public function removeAttendeeAction($event, $person = '')
{
try {
$context = $this->contextFactory->create([]);
$person = $this->getPersonProfile($person, $context);
$event = $context->getNodeByIdentifier($event);
$this->eventService->removeAttendeeFromEvent($event, $person);
} catch (\Exception $exception) {
$this->systemLogger->log($exception->getMessage(), LOG_ALERT);
}
$this->addFlashMessage('Je bent afgemeld');
$this->redirectToUri('/agenda');
}
示例7: pingAction
/**
* @return void
*/
public function pingAction()
{
$this->systemLogger->log("FOO" . $this->apiKey);
$apiKey = $this->request->getHttpRequest()->getHeader('X-Api-Key');
$this->systemLogger->log($apiKey);
if ($apiKey === $this->apiKey) {
$this->response->setStatus(204);
$this->response->send();
} else {
$this->response->setStatus(403, 'Invalid Authentication');
$this->response->send();
}
return false;
}
示例8: initializeValue
/**
* @param string $value
* @throws Exception
* @throws \TYPO3\Flow\Resource\Exception
* @throws \TYPO3\Flow\Utility\Exception
*/
protected function initializeValue($value)
{
if (!is_array($value)) {
throw new Exception('Value must be an array, with source URI (sourceUri) and filename (filename)', 1425981082);
}
if (!isset($value['sourceUri'])) {
throw new Exception('Missing source URI', 1425981083);
}
$sourceUri = trim($value['sourceUri']);
if (!isset($value['filename'])) {
throw new Exception('Missing filename URI', 1425981084);
}
$filename = trim($value['filename']);
$overrideFilename = isset($value['overrideFilename']) ? trim($value['overrideFilename']) : $filename;
if (!isset($this->options['downloadDirectory'])) {
throw new Exception('Missing download directory data type option', 1425981085);
}
Files::createDirectoryRecursively($this->options['downloadDirectory']);
$temporaryFileAndPathname = trim($this->options['downloadDirectory'] . $filename);
$this->download($sourceUri, $temporaryFileAndPathname);
$sha1Hash = sha1_file($temporaryFileAndPathname);
# Try to add file extenstion if missing
if (!$this->downloadCache->has($sha1Hash)) {
$fileExtension = pathinfo($temporaryFileAndPathname, PATHINFO_EXTENSION);
if (trim($fileExtension) === '') {
$mimeTypeGuesser = new MimeTypeGuesser();
$mimeType = $mimeTypeGuesser->guess($temporaryFileAndPathname);
$this->logger->log(sprintf('Try to guess mime type for "%s" (%s), result: %s', $sourceUri, $filename, $mimeType), LOG_DEBUG);
$fileExtension = MediaTypes::getFilenameExtensionFromMediaType($mimeType);
if ($fileExtension !== '') {
$oldTemporaryDestination = $temporaryFileAndPathname;
$temporaryDestination = $temporaryFileAndPathname . '.' . $fileExtension;
copy($oldTemporaryDestination, $temporaryDestination);
$this->logger->log(sprintf('Rename "%s" to "%s"', $oldTemporaryDestination, $temporaryDestination), LOG_DEBUG);
}
}
}
$resource = $this->resourceManager->getResourceBySha1($sha1Hash);
if ($resource === NULL) {
$resource = $this->resourceManager->importResource($temporaryFileAndPathname);
if ($filename !== $overrideFilename) {
$resource->setFilename($overrideFilename);
}
}
$this->temporaryFileAndPathname = $temporaryFileAndPathname;
$this->downloadCache->set($sha1Hash, ['sha1Hash' => $sha1Hash, 'filename' => $filename, 'sourceUri' => $sourceUri, 'temporaryFileAndPathname' => $temporaryFileAndPathname]);
$this->value = $resource;
}
示例9: logDeprecation
/**
* Log a deprecation message once
*
* @return void
*/
protected function logDeprecation()
{
if (!static::$loggedDeprecation) {
static::$loggedDeprecation = true;
$this->logger->log('TYPO3.Media is configured to simulate the deprecated Neos 1.2 behaviour. Please check the setting "TYPO3.Media.behaviourFlag".', LOG_DEBUG);
}
}
示例10: renumberIndexesInLevel
/**
* Renumbers the indexes of all nodes directly below the node specified by the
* given path.
*
* Note that renumbering must happen in-memory and can't be optimized by a clever
* query executed directly by the database because sorting indexes of new or
* modified nodes need to be considered.
*
* @param string $parentPath Path to the parent node
* @return void
* @throws Exception\NodeException
*/
protected function renumberIndexesInLevel($parentPath)
{
$this->systemLogger->log(sprintf('Renumbering nodes in level below %s.', $parentPath), LOG_INFO);
/** @var \Doctrine\ORM\Query $query */
$query = $this->entityManager->createQuery('SELECT n FROM TYPO3\\TYPO3CR\\Domain\\Model\\NodeData n WHERE n.parentPathHash = :parentPathHash ORDER BY n.index ASC');
$query->setParameter('parentPathHash', md5($parentPath));
$nodesOnLevel = array();
/** @var $node NodeData */
foreach ($query->getResult() as $node) {
$nodesOnLevel[$node->getIndex()] = $node;
}
/** @var $node NodeData */
foreach ($this->addedNodes as $node) {
if ($node->getParentPath() === $parentPath) {
$index = $node->getIndex();
if (isset($nodesOnLevel[$index])) {
throw new Exception\NodeException(sprintf('Index conflict for nodes %s and %s: both have index %s', $nodesOnLevel[$index]->getPath(), $node->getPath(), $index), 1317140401);
}
$nodesOnLevel[$index] = $node;
}
}
// We need to sort the nodes now, to take unpersisted node orderings into account.
// This fixes bug #34291
ksort($nodesOnLevel);
$newIndex = 100;
foreach ($nodesOnLevel as $node) {
if ($newIndex > self::INDEX_MAXIMUM) {
throw new Exception\NodeException(sprintf('Reached maximum node index of %s while setting index of node %s.', $newIndex, $node->getPath()), 1317140402);
}
$node->setIndex($newIndex);
$newIndex += 100;
}
}
示例11: assignNodes
/**
* @param array $nodes
*/
public function assignNodes(array $nodes)
{
$data = array();
foreach ($nodes as $node) {
if ($node->getPath() !== '/') {
$q = new FlowQuery(array($node));
$closestDocumentNode = $q->closest('[instanceof TYPO3.Neos:Document]')->get(0);
if ($closestDocumentNode !== NULL) {
$data[] = array('nodeContextPath' => $node->getContextPath(), 'documentNodeContextPath' => $closestDocumentNode->getContextPath());
} else {
$this->systemLogger->log('You have a node that is no longer connected to a parent. Path: ' . $node->getPath() . ' (Identifier: ' . $node->getIdentifier() . ')');
}
}
}
$this->assign('value', array('data' => $data, 'success' => TRUE));
}
示例12: getResponseFromCache
/**
* @Flow\Around("setting(Ttree.Embedly.logApiRequest) && within(Ttree\Embedly\Embedly) && method(public .*->(oembed|preview|objectify|extract|services)())")
* @param JoinPointInterface $joinPoint The current join point
* @return mixed
*/
public function getResponseFromCache(JoinPointInterface $joinPoint)
{
$proxy = $joinPoint->getProxy();
$key = ObjectAccess::getProperty($proxy, 'key');
$params = $joinPoint->getMethodArgument('params');
$cacheKey = md5($joinPoint->getClassName() . $joinPoint->getMethodName() . $key . json_encode($params));
if ($this->responseCache->has($cacheKey)) {
$this->systemLogger->log(sprintf(' cache hit Embedly::%s', $joinPoint->getMethodName()), LOG_DEBUG);
return $this->responseCache->get($cacheKey);
} else {
$this->systemLogger->log(sprintf(' cache miss Embedly::%s', $joinPoint->getMethodName()), LOG_DEBUG);
}
$response = $joinPoint->getAdviceChain()->proceed($joinPoint);
$this->responseCache->set($cacheKey, $response);
return $response;
}
示例13: definePrettyPreRedirectTemplate
/**
* Defines template if configured for provider.
*
* @param string $providerName
*
* @return bool TRUE if some configuration found, FALSE if no configuration defined for given provider.
*/
private function definePrettyPreRedirectTemplate($providerName)
{
$prettyPreRedirectPage = $this->configurationManager->getConfiguration(\TYPO3\Flow\Configuration\ConfigurationManager::CONFIGURATION_TYPE_SETTINGS, 'TYPO3.Flow.security.authentication.providers.' . $providerName . '.providerOptions.Miscellaneous.prettyPreRedirectPage');
if (empty($prettyPreRedirectPage)) {
return false;
}
$log = '';
if (isset($prettyPreRedirectPage['layoutRootPath']) && method_exists($this->view, 'setLayoutRootPath')) {
$this->view->setLayoutRootPath($prettyPreRedirectPage['layoutRootPath']);
} elseif (isset($prettyPreRedirectPage['layoutRootPath']) && !method_exists($this->view, 'setLayoutRootPath')) {
$log .= sprintf('Pretty pre redirect page for "%s" provider can not be used, because you use custom teplating engine and this does not know method setLayoutRootPath().', $providerName);
}
if (isset($prettyPreRedirectPage['partialRootPath']) && method_exists($this->view, 'setPartialRootPath')) {
$this->view->setPartialRootPath($prettyPreRedirectPage['partialRootPath']);
} elseif (isset($prettyPreRedirectPage['partialRootPath']) && !method_exists($this->view, 'setPartialRootPath')) {
$log .= sprintf('Pretty pre redirect page for "%s" provider can not be used, because you use custom teplating engine and this does not know method setPartialRootPath().', $providerName);
}
if (isset($prettyPreRedirectPage['templatePathAndFilename']) && method_exists($this->view, 'setTemplatePathAndFilename')) {
$this->view->setTemplatePathAndFilename($prettyPreRedirectPage['templatePathAndFilename']);
} elseif (isset($prettyPreRedirectPage['templatePathAndFilename']) && !method_exists($this->view, 'setTemplatePathAndFilename')) {
$log .= sprintf('Pretty pre redirect page for "%s" provider can not be used, because you use custom teplating engine and this does not know method setTemplatePathAndFilename().', $providerName);
}
if (!empty($log)) {
$this->systemLogger->log($log, LOG_ERR);
}
$this->view->assignMultiple($prettyPreRedirectPage);
return true;
}
示例14: applyClassFilterConfiguration
/**
* Filters the classnames available for object management by filter expressions that either include or exclude classes.
*
* @param array $classNames All classnames per package
* @param array $filterConfiguration The filter configuration to apply
* @param string $includeOrExclude if this is an "include" or "exclude" filter
* @return array the remaining class
* @throws \TYPO3\Flow\Configuration\Exception\InvalidConfigurationTypeException
*/
protected function applyClassFilterConfiguration($classNames, $filterConfiguration, $includeOrExclude = 'include')
{
if (!in_array($includeOrExclude, array('include', 'exclude'))) {
throw new \InvalidArgumentException('The argument $includeOrExclude must be one of "include" or "exclude", the given value was not allowed.', 1423726253);
}
foreach ($filterConfiguration as $packageKey => $filterExpressions) {
if (!array_key_exists($packageKey, $classNames)) {
$this->systemLogger->log('The package "' . $packageKey . '" specified in the setting "TYPO3.Flow.object.' . $includeOrExclude . 'Classes" was either excluded or is not loaded.', LOG_DEBUG);
continue;
}
if (!is_array($filterExpressions)) {
throw new \TYPO3\Flow\Configuration\Exception\InvalidConfigurationTypeException('The value given for setting "TYPO3.Flow.object.' . $includeOrExclude . 'Classes.\'' . $packageKey . '\'" is invalid. It should be an array of expressions. Check the syntax in the YAML file.', 1422357272);
}
$classesForPackageUnderInspection = $classNames[$packageKey];
$classNames[$packageKey] = array();
foreach ($filterExpressions as $filterExpression) {
$classesForPackageUnderInspection = array_filter($classesForPackageUnderInspection, function ($className) use($filterExpression, $includeOrExclude) {
$match = preg_match('/' . $filterExpression . '/', $className);
return $includeOrExclude === 'include' ? $match === 1 : $match !== 1;
});
if ($includeOrExclude === 'include') {
$classNames[$packageKey] = array_merge($classNames[$packageKey], $classesForPackageUnderInspection);
$classesForPackageUnderInspection = $classNames[$packageKey];
} else {
$classNames[$packageKey] = $classesForPackageUnderInspection;
}
}
if ($classNames[$packageKey] === array()) {
unset($classNames[$packageKey]);
}
}
return $classNames;
}
示例15: matches
/**
* Checks if the specified method matches with the method annotation filter pattern
*
* @param string $className Name of the class to check against - not used here
* @param string $methodName Name of the method
* @param string $methodDeclaringClassName Name of the class the method was originally declared in
* @param mixed $pointcutQueryIdentifier Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection - not used here
* @return boolean TRUE if the class matches, otherwise FALSE
*/
public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier)
{
if ($methodDeclaringClassName === null || !method_exists($methodDeclaringClassName, $methodName)) {
return false;
}
$designatedAnnotations = $this->reflectionService->getMethodAnnotations($methodDeclaringClassName, $methodName, $this->annotation);
if ($designatedAnnotations !== array() || $this->annotationValueConstraints === array()) {
$matches = $designatedAnnotations !== array();
} else {
// It makes no sense to check property values for an annotation that is used multiple times, we shortcut and check the value against the first annotation found.
$firstFoundAnnotation = $designatedAnnotations;
$annotationProperties = $this->reflectionService->getClassPropertyNames($this->annotation);
foreach ($this->annotationValueConstraints as $propertyName => $expectedValue) {
if (!array_key_exists($propertyName, $annotationProperties)) {
$this->systemLogger->log('The property "' . $propertyName . '" declared in pointcut does not exist in annotation ' . $this->annotation, LOG_NOTICE);
return false;
}
if ($firstFoundAnnotation->{$propertyName} === $expectedValue) {
$matches = true;
} else {
return false;
}
}
}
return $matches;
}
开发者ID:robertlemke,项目名称:flow-development-collection,代码行数:35,代码来源:PointcutMethodAnnotatedWithFilter.php