Returns a configuration analysis.
@param Configuration $configuration
@param bool $textOnly whether to render text or HTML
@return string
548829
private function analyzeConfiguration($configuration, $textOnly) {
        $validity = $configuration->isValid() ? "valid" : "invalid";

        $str = "";
        $selectedColor = "\033[1;32m";
        $deselectedColor = "\033[1;31m";
        
        if ($textOnly)
            $str .= "The given configuration has the following feature selection:\n\n";
        else {
            $str .= "<div style='font-family: monospace'>";
            $str .= "<p>The given configuration has the following feature selection:</p>";
            $str .= "<ul>";
        }

        foreach ($configuration->getModel()->getFeatures() as $feature) {
            $isSelected = Feature::has($configuration->getSelectedFeatures(), $feature);
            $mark = $isSelected ? "x" : "&nbsp;";
            $class = $isSelected ? "selected" : "deselected";

            if ($textOnly)
                $str .= "[" . ($isSelected ? "x" : " ") . "] " .
                     ($isSelected ? $selectedColor : $deselectedColor) . $feature->getName() . "$this->defaultColor\n";
            else
                $str .= "<li>[$mark] <span class='feature $class'>" . $feature->getName() . "</span></li>";
        }

        if ($textOnly)
            $str .= "\nThis configuration is $validity.\n";
        else {
            $str .= "</ul>";
            $str .= "<p>This configuration is $validity.</p>";
            $str .= "</div>";
        }
        return $str;
    }
993370
private function getRenderer(Configuration $configuration, OutputInterface $output)
    {
        $messageHelper = $this->getMessageHelper();

        if ($logFilePath = $configuration->logHtml()) {
            $factory = new RendererFactory($messageHelper, new Filesystem());

            return $factory->createHtmlOutputRenderer($logFilePath);
        }

        if ($configuration->isSimpleOutput()) {
            return new SimpleRenderer($output, $messageHelper);
        }

        return new DefaultRenderer($output, $messageHelper);
    }
277616
public static function getConfiguration()
    {
        if (is_null(self::$_configuration)) {
            self::$_configuration = new stdClass();
            self::$_configuration->trigger = 'never';
            self::$_configuration->filters = new stdClass();

            $file = BP . DIRECTORY_SEPARATOR . 'var' . DIRECTORY_SEPARATOR . 'aoe_profiler.xml';
            if (is_file($file)) {
                $conf = simplexml_load_file($file);
                if ($conf !== false) {
                    self::$_configuration->trigger = (string)$conf->aoe_profiler->trigger;
                    self::$_configuration->captureModelInfo = (bool)(string)$conf->aoe_profiler->captureModelInfo;
                    self::$_configuration->captureBacktraces = (bool)(string)$conf->aoe_profiler->captureBacktraces;
                    self::$_configuration->enableFilters = (bool)(string)$conf->aoe_profiler->enableFilters;
                    if (self::$_configuration->enableFilters) {
                        self::$_configuration->filters->sampling = (float)$conf->aoe_profiler->filters->sampling;
                        self::$_configuration->filters->timeThreshold = (int)$conf->aoe_profiler->filters->timeThreshold;
                        self::$_configuration->filters->memoryThreshold = (int)$conf->aoe_profiler->filters->memoryThreshold;
                        self::$_configuration->filters->requestUriWhiteList = (string)$conf->aoe_profiler->filters->requestUriWhiteList;
                        self::$_configuration->filters->requestUriBlackList = (string)$conf->aoe_profiler->filters->requestUriBlackList;
                    }
                }
            }
        }
        return self::$_configuration;
    }
1105754
private function getConfigEntityByInternalName($internalName)
    {
        foreach ($this->configuration['entities'] as $class) {
            /** @var AbstractConfig $entity */
            $entity = new $class();

            if ($entity->getInternalName() == $internalName) {
                return $entity;
            }
        }

        throw new NotFoundHttpException();
    }
888942
protected function parse($configuration)
    {
        $result = [];

        // Extract commands of Doozr from configuration
        foreach ($configuration as $root => $children) {
            foreach ($children as $key => $values) {
                foreach ($values as $node => $value) {
                    $dom   = [];
                    $doozr = [];

                    switch ($node) {
                        case 'tag':
                            $tag = $value;
                            break;
                        case 'properties':
                            $properties = $value;

                            // Get commands of form
                            foreach ($properties as $property => $value) {
                                if ($this->containsCommand($property) === true) {
                                    $doozr[] = [
                                        'method' => $this->getMethodByKey($property),
                                        'value'  => $value,
                                    ];
                                } else {
                                    $dom[$property] = $value;
                                }
                            }
                            break;
                    }
                }

                if (isset($result[$root]) === false) {
                    $result[$root] = [];
                }

                $result[$root][] = [
                    'dom'   => $dom,
                    'doozr' => $doozr,
                ];
            }
        }

        // After iterating all parts with the same logic shift child form to root -> only one possible!
        $result['form'] = $result['form'][0];

        $this->setConfiguration(array_to_object($result));
    }
1281889
protected function getFullConfiguration()
    {
        $contextHash = $this->getContextHash();

        if (false === array_key_exists($contextHash, $this->configuration)) {
            $typoScriptArray = ($this->environmentService->isEnvironmentInFrontendMode())
                ? $this->getFrontendTypoScriptConfiguration()
                : $this->getBackendTypoScriptConfiguration();

            $this->configuration[$contextHash] = $this->typoScriptService->convertTypoScriptArrayToPlainArray($typoScriptArray);
        }

        return $this->configuration[$contextHash];
    }
616351
private function parseConfiguration($configuration)
    {
        $return = [];
        foreach ($configuration as $page) {
            foreach ($page as $key => $setting) {
                if ($key == 'helpers') {
                    foreach ($setting as $a => $b) {
                        if (!isset($return['renderers'])) {
                            $return['renderers'] = array();
                        }
                        if (!isset($return['renderers'][$a])) {
                            $return['renderers'][$a] = array();
                        }
                        if (!isset($return['renderers'][$a]['helpers'])) {
                            $return['renderers'][$a]['helpers'] = array();
                        }
                        $return['renderers'][$a]['helpers'] = array_replace($return['renderers'][$a]['helpers'], $b);
                    }
                } else {
                    $return[$key] = $setting;
                }
            }
        }
        return $return;
    }
225955
protected function getExtensionConfiguration()
    {
        $cacheInstance = CacheService::get()->getCacheInstance();
        $hash = $this->getContextHash();

        if ($cacheInstance->has($hash)) {
            $result = $cacheInstance->get($hash);
        } else {
            $result = $this->getFullConfiguration();
            $result = (ArrayUtility::isValidPath($result, self::EXTENSION_CONFIGURATION_PATH, '.'))
                ? ArrayUtility::getValueByPath($result, self::EXTENSION_CONFIGURATION_PATH, '.')
                : [];

            if (ArrayUtility::isValidPath($result, 'settings.typoScriptIncluded', '.')) {
                $cacheInstance->set($hash, $result);
            }
        }

        return $result;
    }
877939
public static function get_supported_features(array $configuration = array()) {
        return self::SUPPORTS_DATA_GUARANTEE +
               self::SUPPORTS_NATIVE_TTL +
               self::IS_SEARCHABLE +
               self::SUPPORTS_MULTIPLE_IDENTIFIERS +
               self::DEREFERENCES_OBJECTS;
    }
1300779
public String getTypeName(Configuration config,
        ClassDoc cd, boolean lowerCaseOnly) {
        String typeName = "";
        if (cd.isOrdinaryClass()) {
            typeName = "doclet.Class";
        } else if (cd.isInterface()) {
            typeName = "doclet.Interface";
        } else if (cd.isException()) {
            typeName = "doclet.Exception";
        } else if (cd.isError()) {
            typeName = "doclet.Error";
        } else if (cd.isAnnotationType()) {
            typeName = "doclet.AnnotationType";
        } else if (cd.isEnum()) {
            typeName = "doclet.Enum";
        }
        return config.getText(
            lowerCaseOnly ? StringUtils.toLowerCase(typeName) : typeName);
    }
974617
public function _render($textOnly) {
        $tracingLinkNum = count($this->tracingLinks);
        $str = "";

        if ($textOnly) {
            $str .= "\nFeature Traceability\n====================\n" .
                 "The following $tracingLinkNum tracing links were found:\n\n";
            $maxLen = fphp\Helper\_String::getMaxLength($this->tracingLinks, "getFeatureName")
                    + fphp\Helper\_String::getMaxLength($this->tracingLinks, "getType");
            foreach ($this->tracingLinks as $tracingLink)
                $str .= $this->analyzeTracingLink($tracingLink, true, $maxLen);
        } else {
            $str .= "<h2>Feature Traceability</h2>";
            $str .= "<p>The following $tracingLinkNum tracing links were found:</p>";
            $str .= "<table cellpadding='2'>";
            $str .= "<tr align='left'><th>Feature</th><th>Type</th><th>Source</th><th>Target</th></tr>";
            foreach ($this->tracingLinks as $tracingLink)
                $str .= $this->analyzeTracingLink($tracingLink);
            $str .= "</table>";
        }
        
        return $str;
    }
285300
public static function getExtConfig( $name, $default = null )
	{
		if( self::$extConfig === null )
		{
			if( class_exists( '\TYPO3\CMS\Core\Configuration\ExtensionConfiguration' ) ) {
				self::$extConfig = GeneralUtility::makeInstance( 'TYPO3\CMS\Core\Configuration\ExtensionConfiguration' )->get( 'aimeos' );
			} else { // @deprecated Since TYPO3 9.x
				self::$extConfig = unserialize( $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['aimeos'] );
			}
		}

		if( isset( self::$extConfig[$name] ) ) {
			return self::$extConfig[$name];
		}

		return $default;
	}
1019184
public function determineAccessToken($headerOnly = false)
    {
        if (!empty($this->getRequest()->headers->get('Authorization'))) {
            $accessToken = $this->getTokenType()->determineAccessTokenInHeader($this->getRequest());
        } elseif ($headerOnly === false && (! $this->getTokenType() instanceof MAC)) {
            $accessToken = ($this->getRequest()->server->get('REQUEST_METHOD') === 'GET')
                                ? $this->getRequest()->query->get($this->tokenKey)
                                : $this->getRequest()->request->get($this->tokenKey);
        }

        if (empty($accessToken)) {
            throw new InvalidRequestException('access token');
        }

        return $accessToken;
    }
143548
public function getFilterOptionsForUsedOnly($usedOnly)
    {
        $sortColumn = $this->getSortingColumn();

        if ($usedOnly) {
            $builder = $this->connection->createQueryBuilder()
                ->select('COUNT(sourceTable.' . $this->getIdColumn() . ') as mm_count')
                ->addSelect('sourceTable.*')
                ->from($this->getSelectSource(), 'sourceTable')
                ->rightJoin(
                    'sourceTable',
                    $this->getMetaModel()->getTableName(),
                    'modelTable',
                    'modelTable.' . $this->getColName() . '=sourceTable.' . $this->getIdColumn()
                )
                ->addGroupBy('sourceTable.' . $this->getIdColumn())
                ->addOrderBy('sourceTable.' . $sortColumn);

            if ($additionalWhere = $this->getAdditionalWhere()) {
                $builder->andWhere($additionalWhere);
            }

            return $builder->execute();
        }

        $builder = $this->connection->createQueryBuilder()
            ->select('COUNT(modelTable.' . $this->getColName() . ') as mm_count')
            ->addSelect('sourceTable.*')
            ->from($this->getSelectSource(), 'sourceTable')
            ->leftJoin(
                'sourceTable',
                $this->getMetaModel()->getTableName(),
                'modelTable',
                'modelTable.' . $this->getColName() . '=sourceTable.' . $this->getIdColumn()
            )
            ->addGroupBy('sourceTable.' . $this->getIdColumn())
            ->addOrderBy('sourceTable.' . $sortColumn);

        if ($additionalWhere = $this->getAdditionalWhere()) {
            $builder->andWhere($additionalWhere);
        }

        return $builder->execute();
    }
779561
public function getBodyHtml($htmlOnly = false)
    {
        if ($htmlOnly && $this->_bodyHtml) {
            $body = $this->_bodyHtml;
            return $body->getContent();
        }

        return $this->_bodyHtml;
    }
1278087
public function initConfiguration(Configuration $configuration = null)
    {
        parent::initConfiguration($configuration);
        if (isset($this->configuration)) {
            $this->twig = $this->configuration->getTwig();
            $this->resolver = $this->configuration->getResolver();
        }
    }
777558
private function getCollectionBy($configuration)
    {
        if (!$configuration) {
            return null;
        }

        $db = $this->connection->selectDB($configuration['db']);
        return $db->{$configuration['collection']};
    }