Normalize a backend configuration to a unified format.

@return array
974587
public function getNormalizedLegacyConfiguration(): array
    {
        $normalizedConfiguration = [];
        foreach ($this->legacyConfiguration as $logIdentifier => $configuration) {
            // Skip everything that is not an actual log configuration.
            if (!isset($configuration['backend'])) {
                continue;
            }

            $backendObjectNames = $configuration['backend'];
            $backendOptions = $configuration['backendOptions'] ?? [];
            $normalizedConfiguration[$logIdentifier] = $this->mapLoggerConfiguration($backendObjectNames, $backendOptions);
        }

        return $normalizedConfiguration;
    }
479774
protected function makeConfiguration()
    {
        if ($this->on == 'create' || $this->on == 'update') {
            return $this->fieldName;
        }

        return [
            'field'        => $this->fieldName,
            'trackedField' => $this->trackedFields,
            'value'        => $this->value,
        ];
    }
549521
protected function getConfig(){
    $config = array();

    $config['zipMaxSize'] = 'default';
    if (isset($GLOBALS['config']['ZipMaxSize']) && (string)$GLOBALS['config']['ZipMaxSize']!='default' ){
      $config['zipMaxSize'] = CKFinder_Connector_Utils_Misc::returnBytes((string)$GLOBALS['config']['ZipMaxSize']);
    }

    return $config;
  }
344761
function normalize()
    {
        $normalized = array();
        $paths      = $this->getPath();

        if (empty($paths))
            return $normalized;

        // Replace "~" with user's home directory.
        if ('~' === $paths[0]) {
            $home  = explode($this->getSeparator(), str_replace('\\', '/', $this->_getHomeDir()));
            $paths = $paths + $home;
        }

        $isRoot = $this->_isRoot($paths[0]);
        $paths  = array_filter($paths, function($p, $i) use (&$isRoot, $paths) {
            if ( ($isRoot && $i > 0) || $i+1 == count($paths) /* keep last slash remain */) {
                // keep last slash /go/to/path/
                // keep first slash after root if exists
                //   phar://path/to/res
                $isRoot = false;
                return true;
            }

            // Remove all ['',] from path
            // on appended path we don't want any absolute sign in
            // array list
            return ($p !== '' && $p !== '.');
        }, ARRAY_FILTER_USE_BOTH);

        // Collapse ".." with the previous part, if one exists
        // Don't collapse ".." if the previous part is also ".."
        foreach ($paths as $path) {
            if (   '..' === $path && count($normalized) > 0      // keep first segment
                && '..' !== $normalized[count($normalized) - 1]
            ) {
                if (! $this->_isRoot($normalized[count($normalized) - 1]) )
                    array_pop($normalized);

                continue;
            }

            $normalized[] = $path;
        }

        $this->setPath($normalized);
        return $this;
    }
1374653
protected function getFormzConfiguration()
    {
        $rootConfigurationArray = $this->getFormObject()
            ->getConfiguration()
            ->getRootConfiguration()
            ->toArray();

        $cleanFormzConfigurationArray = [
            'view' => $rootConfigurationArray['view']
        ];

        return ArrayService::get()->arrayToJavaScriptJson($cleanFormzConfigurationArray);
    }
302695
public static function getRestartSettings()
    {
        $envArgs = explode('|', (string) getenv(self::RESTART_SETTINGS));

        if (count($envArgs) !== 6
            || (!self::$inRestart && php_ini_loaded_file() !== $envArgs[0])) {
            return;
        }

        return array(
            'tmpIni' => $envArgs[0],
            'scannedInis' => (bool) $envArgs[1],
            'scanDir' => '*' === $envArgs[2] ? false : $envArgs[2],
            'phprc' => '*' === $envArgs[3] ? false : $envArgs[3],
            'inis' => explode(PATH_SEPARATOR, $envArgs[4]),
            'skipped' => $envArgs[5],
        );
    }
1060102
private function getPostConfiguration()
    {
        $driver     = Input::post('dbdriver');
        $database   = Input::post('dbname');

        /**
         * point to APP_PATH/storage/db if driver is sqlite
         */
        if($driver == 'sqlite'){
            $database = APP_PATH.'storage/db/'.$database.'.sqlite';
        }

        return array(
            'driver'    => $driver,
            'host'      => Input::post('dbhost'),
            'database'  => $database,
            'username'  => Input::post('dbuser'),
            'password'  => Input::post('dbpass'),
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        );
    }
1116453
private static function convertConfigsToFile(): string
    {
        $content = '';
        $separator = self::$separator;

        /* Convert array to strings */
        foreach (self::$configs as $configName => $configValue) {
            $content .= $configName . $separator . $configValue . "\n";
        }

        return $content;
    }
1271015
public function normalize()
	{
		$path = clone $this;
		$path->parts = [];
		foreach ($this->parts as $part) {
			if ($part === '..') {
				if (empty($path->parts) || count($path->parts) === 1 && $path->parts[0] === '') {
					$path->parts[] = $part;
				} else {
					array_pop($path->parts);
				}
			} else if ($part === '.' && $this->partCount > 1) {
				// pass
			} else {
				$path->parts[] = $part;
			}
		}
		if ($this->lastPart === '..' || $this->lastPart === '.') {
			$path->parts[] = '';
		}
		$path->setParts($path->parts);
		return $path;
	}
1003733
public static function configMerge() {
        $result = array();
        $args = func_get_args();
        foreach ($args as $arg) {
            if (!is_array($arg)) {
                continue;
            }
            foreach ($arg as $key => $value) {
                if (is_numeric($key)) {
                    // Renumber numeric keys as array_merge() does.
                    $result[] = $value;
                } elseif (array_key_exists($key, $result) && is_array($result[$key]) && is_array($value)) {
                    // Recurse only when both values are arrays.
                    $result[$key] = ConfigServiceProvider::configMerge($result[$key], $value);
                } else {
                    // Otherwise, use the latter value.
                    $result[$key] = $value;
                }
            }
        }
        return $result;
    }
1161750
protected function getNormalizedHelpers()
    {
        if (isset($this->controller->helpers)) {
            return Hash::normalize((array)$this->controller->helpers);
        }

        return array();
    }
254342
public function getConfig()
    {
        $config = [];

        $config['general'] = $this->parseGeneral();
        $config['taxonomy'] = $this->parseTaxonomy();
        $config['contenttypes'] = $this->parseContentTypes($config['general']);
        $config['menu'] = $this->parseConfigYaml('menu.yml');
        $config['routing'] = $this->parseConfigYaml('routing.yml');
        $config['permissions'] = $this->parseConfigYaml('permissions.yml');
        $config['extensions'] = $this->parseConfigYaml('extensions.yml');

        return $config;
    }
991183
protected function generate_configuration_array() {
        $configuration = array();
        $configuration['stores'] = $this->configstores;
        $configuration['modemappings'] = $this->configmodemappings;
        $configuration['definitions'] = $this->configdefinitions;
        $configuration['definitionmappings'] = $this->configdefinitionmappings;
        $configuration['locks'] = $this->configlocks;
        return $configuration;
    }
868248
protected function getFormatOptionsFromPost()
    {
        $presetMode = post('format_preset');

        $options = [
            'delimiter' => null,
            'enclosure' => null,
            'escape' => null,
            'encoding' => null
        ];

        if ($presetMode == 'custom') {
            $options['delimiter'] = post('format_delimiter');
            $options['enclosure'] = post('format_enclosure');
            $options['escape'] = post('format_escape');
            $options['encoding'] = post('format_encoding');
        }

        return $options;
    }
580363
public function configure()
    {
        $docs = []; //$this->configuration->getTransformer()->getExternalClassDocumentation();
        foreach ($docs as $external) {
            $prefix = (string) $external->getPrefix();
            $uri = (string) $external->getUri();

            $this[] = new Rule(
                function ($node) use ($prefix) {
                    return is_string($node) && (strpos(ltrim($node, '\\'), $prefix) === 0);
                },
                function ($node) use ($uri) {
                    return str_replace('{CLASS}', ltrim($node, '\\'), $uri);
                }
            );
        }
    }
140308
public function normalize(): string {
        if (!$this->uri) {
            return '';
        }

        $path = $this->path ?: '/';
        $path = $this->removeDotSegments($path);
        $path = $this->decodeUnreservedCharacters($path);
        $path = $this->decodeReservedSubDelimiters($path);

        return $this->reconstitute(
            $this->scheme,
            $this->getAuthority(),
            $path,
            $this->query,
            $this->fragment
        );
    }
671747
public function getConfig(): array
    {
        if (empty($this->config)) {
            $yamlParser = new Parser();
            $files = $this->getFileNames();
            $config = [];
            foreach ($files as $file) {
                $fileConfig = $yamlParser->parseFile($file);
                $config = \array_merge($config, $fileConfig);
            }
            $this->config = $config;
        }
        return $this->config;
    }