本文整理汇总了PHP中TYPO3\Flow\Aop\JoinPointInterface::getMethodName方法的典型用法代码示例。如果您正苦于以下问题:PHP JoinPointInterface::getMethodName方法的具体用法?PHP JoinPointInterface::getMethodName怎么用?PHP JoinPointInterface::getMethodName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Aop\JoinPointInterface
的用法示例。
在下文中一共展示了JoinPointInterface::getMethodName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: profileAround
/**
*
* @Flow\Around("methodAnnotatedWith(Sandstorm\PhpProfiler\Annotations\Profile)")
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point
* @return array Result of the target method
*/
public function profileAround(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
$run = \Sandstorm\PhpProfiler\Profiler::getInstance()->getRun();
$tag = str_replace('\\', '_', $joinPoint->getClassName()) . ':' . $joinPoint->getMethodName();
$run->startTimer($tag);
$result = $joinPoint->getAdviceChain()->proceed($joinPoint);
$run->stopTimer($tag);
return $result;
}
示例3: renderDecisionReasonMessage
/**
* Returns a string message, giving insights what happened during privilege evaluation.
*
* @param string $privilegeReasonMessage
* @return string
*/
protected function renderDecisionReasonMessage($privilegeReasonMessage)
{
if (count($this->securityContext->getRoles()) === 0) {
$rolesMessage = 'No authenticated roles';
} else {
$rolesMessage = 'Authenticated roles: ' . implode(', ', array_keys($this->securityContext->getRoles()));
}
return sprintf('Access denied for method' . chr(10) . 'Method: %s::%s()' . chr(10) . chr(10) . '%s' . chr(10) . chr(10) . '%s', $this->joinPoint->getClassName(), $this->joinPoint->getMethodName(), $privilegeReasonMessage, $rolesMessage);
}
示例4: callMethodOnOriginalSessionObject
/**
* Around advice, wrapping every method of a scope session object. It redirects
* all method calls to the session object once there is one.
*
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point
* @return mixed
* @Flow\Around("filter(TYPO3\Flow\Session\Aspect\SessionObjectMethodsPointcutFilter)")
*/
public function callMethodOnOriginalSessionObject(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
$objectName = $this->objectManager->getObjectNameByClassName(get_class($joinPoint->getProxy()));
$methodName = $joinPoint->getMethodName();
$proxy = $joinPoint->getProxy();
if (!isset($this->sessionOriginalInstances[$objectName])) {
$this->sessionOriginalInstances[$objectName] = $this->objectManager->get($objectName);
}
if ($this->sessionOriginalInstances[$objectName] === $proxy) {
return $joinPoint->getAdviceChain()->proceed($joinPoint);
} else {
return call_user_func_array(array($this->sessionOriginalInstances[$objectName], $methodName), $joinPoint->getMethodArguments());
}
}
示例5: forwardSignalToDispatcher
/**
* Passes the signal over to the Dispatcher
*
* @Flow\AfterReturning("methodAnnotatedWith(TYPO3\Flow\Annotations\Signal)")
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point
* @return void
*/
public function forwardSignalToDispatcher(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
$signalName = lcfirst(str_replace('emit', '', $joinPoint->getMethodName()));
$this->dispatcher->dispatch($joinPoint->getClassName(), $signalName, $joinPoint->getMethodArguments());
}
示例6: logPersistedUsernamePasswordProviderAuthenticate
/**
* Logs calls and results of the authenticate() method of an authentication provider
*
* @Flow\AfterReturning("within(TYPO3\Flow\Security\Authentication\AuthenticationProviderInterface) && method(.*->authenticate())")
* @param JoinPointInterface $joinPoint The current joinpoint
* @return mixed The result of the target method if it has not been intercepted
*/
public function logPersistedUsernamePasswordProviderAuthenticate(JoinPointInterface $joinPoint)
{
$token = $joinPoint->getMethodArgument('authenticationToken');
switch ($token->getAuthenticationStatus()) {
case TokenInterface::AUTHENTICATION_SUCCESSFUL:
$this->securityLogger->log(sprintf('Successfully authenticated token: %s', $token), LOG_NOTICE, array(), 'TYPO3.Flow', $joinPoint->getClassName(), $joinPoint->getMethodName());
$this->alreadyLoggedAuthenticateCall = true;
break;
case TokenInterface::WRONG_CREDENTIALS:
$this->securityLogger->log(sprintf('Wrong credentials given for token: %s', $token), LOG_WARNING, array(), 'TYPO3.Flow', $joinPoint->getClassName(), $joinPoint->getMethodName());
break;
case TokenInterface::NO_CREDENTIALS_GIVEN:
$this->securityLogger->log(sprintf('No credentials given or no account found for token: %s', $token), LOG_WARNING, array(), 'TYPO3.Flow', $joinPoint->getClassName(), $joinPoint->getMethodName());
break;
}
}
示例7: log
/**
* @Flow\Before("setting(Ttree.Embedly.logApiRequest) && within(Ttree\Embedly\Embedly) && method(public .*->(oembed|preview|objectify|extract|services)())")
* @param JoinPointInterface $joinPoint The current join point
* @return void
*/
public function log(JoinPointInterface $joinPoint)
{
$this->systemLogger->log(sprintf('-> call Embedly::%s', $joinPoint->getMethodName()), LOG_DEBUG);
}
示例8: profilerStop
/**
*
* @Flow\After("filter(Debug\Toolbar\Aop\PointcutSettingsClassFilter)")
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The current join point
* @return array Result of the target method
*/
public function profilerStop(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
$run = \SandstormMedia\PhpProfiler\Profiler::getInstance()->getRun();
$tag = $joinPoint->getClassName() . '::' . $joinPoint->getMethodName();
$run->stopTimer($tag);
}
示例9: getPrivilegesForJoinPoint
/**
* Returns the privileges a specific role has for the given joinpoint. The returned array
* contains the privilege's resource as key of each privilege.
*
* @param \TYPO3\Flow\Security\Policy\Role $role The role for which the privileges should be returned
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint The joinpoint for which the privileges should be returned
* @return array Array of privileges
* @throws \TYPO3\Flow\Security\Exception\NoEntryInPolicyException
*/
public function getPrivilegesForJoinPoint(\TYPO3\Flow\Security\Policy\Role $role, \TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
$methodIdentifier = strtolower($joinPoint->getClassName() . '->' . $joinPoint->getMethodName());
$roleIdentifier = $role->getIdentifier();
if (!isset($this->acls[$methodIdentifier])) {
throw new \TYPO3\Flow\Security\Exception\NoEntryInPolicyException('The given joinpoint was not found in the policy cache. Most likely you have to recreate the AOP proxy classes.', 1222100851);
}
if (!isset($this->acls[$methodIdentifier][$roleIdentifier])) {
return array();
}
$privileges = array();
foreach ($this->acls[$methodIdentifier][$roleIdentifier] as $resource => $privilegeConfiguration) {
if ($privilegeConfiguration['runtimeEvaluationsClosureCode'] !== FALSE) {
// Make object manager usable as closure variable
$objectManager = $this->objectManager;
eval('$runtimeEvaluator = ' . $privilegeConfiguration['runtimeEvaluationsClosureCode'] . ';');
if ($runtimeEvaluator->__invoke($joinPoint) === FALSE) {
continue;
}
}
$privileges[$resource] = $privilegeConfiguration['privilege'];
}
return $privileges;
}