本文整理汇总了PHP中TYPO3\Flow\Aop\JoinPointInterface::getClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP JoinPointInterface::getClassName方法的具体用法?PHP JoinPointInterface::getClassName怎么用?PHP JoinPointInterface::getClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Aop\JoinPointInterface
的用法示例。
在下文中一共展示了JoinPointInterface::getClassName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: Flow_Aop_Proxy_invokeJoinPoint
/**
* Invokes a given join point
*
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint
* @return mixed
*/
public function Flow_Aop_Proxy_invokeJoinPoint(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
if (__CLASS__ !== $joinPoint->getClassName()) {
return parent::Flow_Aop_Proxy_invokeJoinPoint($joinPoint);
}
if (isset($this->Flow_Aop_Proxy_methodIsInAdviceMode[$joinPoint->getMethodName()])) {
return call_user_func_array(['self', $joinPoint->getMethodName()], $joinPoint->getMethodArguments());
}
}
示例4: 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;
}
示例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: getClassName
/**
* Determines the short or full class name of the session implementation
*
* @param \TYPO3\Flow\Aop\JoinPointInterface $joinPoint
* @return string
*/
protected function getClassName(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint)
{
$className = $joinPoint->getClassName();
if (substr($className, 0, 18) === \TYPO3\Flow\Session::class) {
$className = substr($className, 19);
}
return $className;
}
示例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;
}