In general, the case sensitive variant is used everywhere in Flow,
however there might be special situations in which the
case sensitive name is not available. This method helps you in these
rare cases.
public getCaseSensitiveObjectName ( string $caseInsensitiveObjectName ) : mixed | ||
$caseInsensitiveObjectName | string | The object name in lower-, upper- or mixed case |
리턴 | mixed | Either the mixed case object name or FALSE if no object of that name was found. |
/** * Resolves the class name of an authentication provider. If a valid provider class name is given, it is just returned. * * @param string $providerName The (short) name of the provider * @return string The object name of the authentication provider * @throws NoAuthenticationProviderFoundException */ public function resolveProviderClass($providerName) { $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName($providerName); if ($resolvedObjectName !== false) { return $resolvedObjectName; } $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName('Neos\\Flow\\Security\\Authentication\\Provider\\' . $providerName); if ($resolvedObjectName !== false) { return $resolvedObjectName; } throw new NoAuthenticationProviderFoundException('An authentication provider with the name "' . $providerName . '" could not be resolved.', 1217154134); }
/** * Resolves the class name of a security interceptor. If a valid interceptor class name is given, it is just returned. * * @param string $name The (short) name of the interceptor * @return string The class name of the security interceptor, NULL if no class was found. * @throws NoInterceptorFoundException */ public function resolveInterceptorClass($name) { $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName($name); if ($resolvedObjectName !== false) { return $resolvedObjectName; } $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName('Neos\\Flow\\Security\\Authorization\\Interceptor\\' . $name); if ($resolvedObjectName !== false) { return $resolvedObjectName; } throw new NoInterceptorFoundException('A security interceptor with the name: "' . $name . '" could not be resolved.', 1217154134); }
/** * Resolves the class name of a request pattern. If a valid request pattern class name is given, it is just returned. * * @param string $name The (short) name of the pattern * @return string The class name of the request pattern, NULL if no class was found. * @throws Exception\NoRequestPatternFoundException */ public function resolveRequestPatternClass($name) { $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName($name); if ($resolvedObjectName !== false) { return $resolvedObjectName; } $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName('Neos\\Flow\\Security\\RequestPattern\\' . $name); if ($resolvedObjectName !== false) { return $resolvedObjectName; } throw new Exception\NoRequestPatternFoundException('A request pattern with the name: "' . $name . '" could not be resolved.', 1217154134); }
/** * Merge the default plugin arguments of the Plugin with the arguments in the request * and generate a controllerObjectName * * @param object $request * @param array $arguments * @return string $controllerObjectName */ public function getControllerObjectName($request, array $arguments) { $controllerName = $arguments['controllerName'] !== null ? $arguments['controllerName'] : $request->getControllerName(); $subPackageKey = $arguments['subPackageKey'] !== null ? $arguments['subPackageKey'] : $request->getControllerSubpackageKey(); $packageKey = $arguments['packageKey'] !== null ? $arguments['packageKey'] : $request->getControllerPackageKey(); $possibleObjectName = '@package\\@subpackage\\Controller\\@controllerController'; $possibleObjectName = str_replace('@package', str_replace('.', '\\', $packageKey), $possibleObjectName); $possibleObjectName = str_replace('@subpackage', $subPackageKey, $possibleObjectName); $possibleObjectName = str_replace('@controller', $controllerName, $possibleObjectName); $possibleObjectName = str_replace('\\\\', '\\', $possibleObjectName); $controllerObjectName = $this->objectManager->getCaseSensitiveObjectName($possibleObjectName); return $controllerObjectName !== false ? $controllerObjectName : ''; }
/** * Returns the object name of the controller defined by the package, subpackage key and * controller name * * @param string $packageKey the package key of the controller * @param string $subPackageKey the subpackage key of the controller * @param string $controllerName the controller name excluding the "Controller" suffix * @return string The controller's Object Name or NULL if the controller does not exist */ protected function getControllerObjectName($packageKey, $subPackageKey, $controllerName) { $possibleObjectName = '@package\\@subpackage\\Controller\\@controllerController'; $possibleObjectName = str_replace('@package', str_replace('.', '\\', $packageKey), $possibleObjectName); $possibleObjectName = str_replace('@subpackage', $subPackageKey, $possibleObjectName); $possibleObjectName = str_replace('@controller', $controllerName, $possibleObjectName); $possibleObjectName = str_replace('\\\\', '\\', $possibleObjectName); $controllerObjectName = $this->objectManager->getCaseSensitiveObjectName($possibleObjectName); return $controllerObjectName !== false ? $controllerObjectName : null; }
/** * Resolves the class name for the filter by first assuming it is a full qualified class name and otherwise searching * in this package (so filters delivered in Neos.ContentRepository can be used by simply giving the class name without namespace). * * @param string $name * @return string * @throws MigrationException */ protected function resolveFilterClass($name) { $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName($name); if ($resolvedObjectName !== false) { return $resolvedObjectName; } $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName('Neos\\ContentRepository\\Migration\\Filters\\' . $name); if ($resolvedObjectName !== false) { return $resolvedObjectName; } throw new MigrationException('A filter with the name "' . $name . '" could not be found.', 1343199467); }
/** * Tries to resolve the given transformation name into a class name. * * The name can be a fully qualified class name or a name relative to the * Neos\ContentRepository\Migration\Transformations namespace. * * @param string $transformationName * @return string * @throws MigrationException */ protected function resolveTransformationClassName($transformationName) { $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName($transformationName); if ($resolvedObjectName !== false) { return $resolvedObjectName; } $resolvedObjectName = $this->objectManager->getCaseSensitiveObjectName('Neos\\ContentRepository\\Migration\\Transformations\\' . $transformationName); if ($resolvedObjectName !== false) { return $resolvedObjectName; } throw new MigrationException('A transformation with the name "' . $transformationName . '" could not be found.', 1343293064); }
/** * Explicitly sets the object name of the controller * * @param string $unknownCasedControllerObjectName The fully qualified controller object name * @return void * @throws UnknownObjectException * @api */ public function setControllerObjectName($unknownCasedControllerObjectName) { $controllerObjectName = $this->objectManager->getCaseSensitiveObjectName($unknownCasedControllerObjectName); if ($controllerObjectName === false) { throw new UnknownObjectException('The object "' . $unknownCasedControllerObjectName . '" is not registered.', 1268844071); } $this->controllerPackageKey = $this->objectManager->getPackageKeyByObjectName($controllerObjectName); $matches = []; $subject = substr($controllerObjectName, strlen($this->controllerPackageKey) + 1); preg_match('/ ^( Controller | (?P<subpackageKey>.+)\\\\Controller ) \\\\(?P<controllerName>[a-z\\\\]+)Controller $/ix', $subject, $matches); $this->controllerSubpackageKey = isset($matches['subpackageKey']) ? $matches['subpackageKey'] : null; $this->controllerName = $matches['controllerName']; }
/** * Determines the fully qualified view object name. * * @return mixed The fully qualified view object name or FALSE if no matching view could be found. * @api */ protected function resolveViewObjectName() { $possibleViewObjectName = $this->viewObjectNamePattern; $packageKey = $this->request->getControllerPackageKey(); $subpackageKey = $this->request->getControllerSubpackageKey(); $format = $this->request->getFormat(); if ($subpackageKey !== null && $subpackageKey !== '') { $packageKey .= '\\' . $subpackageKey; } $possibleViewObjectName = str_replace('@package', str_replace('.', '\\', $packageKey), $possibleViewObjectName); $possibleViewObjectName = str_replace('@controller', $this->request->getControllerName(), $possibleViewObjectName); $possibleViewObjectName = str_replace('@action', $this->request->getControllerActionName(), $possibleViewObjectName); $viewObjectName = $this->objectManager->getCaseSensitiveObjectName(strtolower(str_replace('@format', $format, $possibleViewObjectName))); if ($viewObjectName === false) { $viewObjectName = $this->objectManager->getCaseSensitiveObjectName(strtolower(str_replace('@format', '', $possibleViewObjectName))); } if ($viewObjectName === false && isset($this->viewFormatToObjectNameMap[$format])) { $viewObjectName = $this->viewFormatToObjectNameMap[$format]; } return $viewObjectName; }