/** * Lifecycle method, called after all dependencies have been injected. * Here, the typeConverter array gets initialized. * * @return void * @throws \TYPO3\FLOW3\Property\Exception\DuplicateTypeConverterException */ public function initializeObject() { foreach ($this->reflectionService->getAllImplementationClassNamesForInterface('TYPO3\\FLOW3\\Property\\TypeConverterInterface') as $typeConverterClassName) { $typeConverter = $this->objectManager->get($typeConverterClassName); foreach ($typeConverter->getSupportedSourceTypes() as $supportedSourceType) { if (isset($this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()])) { throw new \TYPO3\FLOW3\Property\Exception\DuplicateTypeConverterException('There exist at least two converters which handle the conversion from "' . $supportedSourceType . '" to "' . $typeConverter->getSupportedTargetType() . '" with priority "' . $typeConverter->getPriority() . '": ' . get_class($this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()]) . ' and ' . get_class($typeConverter), 1297951378); } $this->typeConverters[$supportedSourceType][$typeConverter->getSupportedTargetType()][$typeConverter->getPriority()] = $typeConverter; } } }
public function getActions() { $actions = array(); $blacklist = explode(",", "index,list"); foreach ($this->reflectionService->getAllImplementationClassNamesForInterface('\\Admin\\Core\\Actions\\ActionInterface') as $actionClassName) { $a = new $actionClassName(); if (!in_array($a->getAction(), $blacklist)) { $actions[$a->getAction()] = $a->__toString(); } } ksort($actions); return $actions; }
/** * This method is used to optimize the matching process. * * @param \TYPO3\FLOW3\Aop\Builder\ClassNameIndex $classNameIndex * @return \TYPO3\FLOW3\Aop\Builder\ClassNameIndex */ public function reduceTargetClassNames(\TYPO3\FLOW3\Aop\Builder\ClassNameIndex $classNameIndex) { if (interface_exists($this->interfaceOrClassName)) { $classNames = $this->reflectionService->getAllImplementationClassNamesForInterface($this->interfaceOrClassName); } elseif (class_exists($this->interfaceOrClassName)) { $classNames = $this->reflectionService->getAllSubClassNamesForClass($this->interfaceOrClassName); $classNames[] = $this->interfaceOrClassName; } else { $classNames = array(); } $filteredIndex = new \TYPO3\FLOW3\Aop\Builder\ClassNameIndex(); $filteredIndex->setClassNames($classNames); return $classNameIndex->intersect($filteredIndex); }
/** * Check for implementations of TYPO3\FLOW3\Resource\Streams\StreamWrapperInterface and * register them. * * @return void */ public function initialize() { $streamWrapperClassNames = $this->reflectionService->getAllImplementationClassNamesForInterface('TYPO3\\FLOW3\\Resource\\Streams\\StreamWrapperInterface'); foreach ($streamWrapperClassNames as $streamWrapperClassName) { $scheme = $streamWrapperClassName::getScheme(); if (in_array($scheme, stream_get_wrappers())) { stream_wrapper_unregister($scheme); } stream_wrapper_register($scheme, '\\TYPO3\\FLOW3\\Resource\\Streams\\StreamWrapperAdapter'); \TYPO3\FLOW3\Resource\Streams\StreamWrapperAdapter::registerStreamWrapper($scheme, $streamWrapperClassName); } // For now this URI is hardcoded, but might be manageable in the future // if additional persistent resources storages are supported. $this->persistentResourcesStorageBaseUri = FLOW3_PATH_DATA . 'Persistent/Resources/'; \TYPO3\FLOW3\Utility\Files::createDirectoryRecursively($this->persistentResourcesStorageBaseUri); $this->importedResources = new \SplObjectStorage(); }