• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/engine/configurator.php
  • Класс: BitrixMainEngineConfigurator
  • Вызов: Configurator::getConfigurationByController
public function getConfigurationByController(Controller $controller)
{
	$newConfiguration = $this->onBuildConfigurationOfActions($controller);
	$configuration = $controller->configureActions() ? : array();

	if ($this->mode & self::MODE_ANNOTATIONS)
	{
		$annotationReader = new AnnotationReader();

		$lengthSuffix = mb_strlen(Controllerable::METHOD_ACTION_SUFFIX);
		$reflectionClass = new ReflectionClass($controller);
		foreach ($reflectionClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method)
		{
			if (!$method->isPublic())
			{
				continue;
			}

			$probablySuffix = mb_substr($method->getName(), -$lengthSuffix);
			if ($probablySuffix !== Controllerable::METHOD_ACTION_SUFFIX)
			{
				continue;
			}

			$actionName = mb_substr($method, 0, -$lengthSuffix);
			if ($this->isExists($configuration, $actionName))
			{
				//we have already config and don't have to grab annotations
				continue;
			}

			$annotations = $annotationReader->getMethodAnnotations($method);
			if (!$this->checkReflectionMethodAsAction($method, $annotations))
			{
				continue;
			}

			$configuration[$actionName] = $this->getConfigurationByAnnotations($annotations);
		}
	}

	$configuration = array_merge($newConfiguration, $configuration);
	$configuration = $this->wrapClosure($configuration);

	$this->checkConfigurations($configuration);

	return $configuration;
}