Support passing the config object directly.

@param Config|null $conf
@return string
975547
static public function getDefaultKeyName(Config $conf = null) {
        $locationId = "global";
        if (is_null($conf)) {
            $projectId = self::getProjectId();
            $keyRingId = self::getKeyRingId();
            $cryptoKeyId = self::getCryptoKeyId();
        } else {
            $projectId = $conf->get(self::CONF_PROJECT_ID_NAME);
            $keyRingId = $conf->get(self::CONF_KEYRING_ID_NAME);
            $cryptoKeyId = $conf->get(self::CONF_KEY_ID_NAME);
        }
        return self::getKeyName($projectId, $locationId, $keyRingId, $cryptoKeyId);
    }
136030
protected function init($conf)
    {
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL('EXT:tt_address/Resources/Private/Language/locallang_pi1.xlf');
        $this->pi_initPIflexForm();

        // flexform data
        $flexKeyMapping = [
            'sDEF.singleRecords' => 'singleRecords',
            'sDEF.groupSelection' => 'groupSelection',
            'sDEF.combination' => 'combination',
            'sDEF.sortBy' => 'sortBy',
            'sDEF.sortOrder' => 'sortOrder',
            'sDEF.pages' => 'pages',
            'sDEF.recursive' => 'recursive',
            'sDISPLAY.templateFile' => 'templateFile',
        ];
        $this->ffData = $this->getFlexFormConfig($flexKeyMapping);

        //set default combination to AND if no combination set
        $combination = 'AND';
        if (!empty($this->ffData['combination']) || !empty($this->conf['combination'])) {
            // 0 and '0' are considered empty, therefore anything else means 1/true => OR
            $combination = 'OR';
        }
        $this->conf['combination'] = $combination;

        // check sorting, priorize FlexForm configuration over TypoScript
        if ($this->ffData['sortBy'] && $this->ffData['sortBy'] !== 'default') {
            // sortBy from FlexForm overrides TypoScript configuration
            $this->conf['sortByColumn'] = $this->ffData['sortBy'];
        }

        // check sorting column for validity, use default column "name" if column is invalid or not set
        $this->conf['sortByColumn'] = $this->checkSorting($this->conf['sortByColumn']);

        //set sorting, set to ASC if not valid
        $sortOrder = $this->ffData['sortOrder'] ?: $this->conf['sortOrder'];
        $this->conf['sortOrder'] = strtoupper($sortOrder) === 'DESC' ? SORT_DESC : SORT_ASC;

        // overwrite TS pidList if set in flexform
        $pages = !empty($this->ffData['pages']) ? $this->ffData['pages'] :
            trim($this->cObj->stdWrap($this->conf['pidList'], $this->conf['pidList.']));
        $pages = $pages ?
            implode(GeneralUtility::intExplode(',', $pages), ',') :
            $this->getTypoScriptFrontendController()->id;

        $recursive = (int)($this->ffData['recursive'] ?: $this->conf['recursive']);

        $this->conf['pidList'] = $this->pi_getPidList($pages, $recursive);

        $this->conf['singleSelection'] = $this->ffData['singleRecords'] ?:
            $this->cObj->stdWrap($this->conf['singleSelection'], $this->conf['singleSelection.']);

        $this->conf['groupSelection'] = $this->ffData['groupSelection'] ?:
            $this->cObj->stdWrap($this->conf['groupSelection'], $this->conf['groupSelection.']);

        $this->conf['templateName'] = $this->getTemplateName();
    }
73837
public static function create($conf = null)
    {
        self::$defaultConf = new FakerinoConf();
        self::$defaultConf->loadConfiguration();
        if ($conf !== null) {
            $confArray = $conf;
            if (!is_array($conf)) {
                $confTypeFactory = new FileConfigurationLoaderFactory(
                    $conf
                );
                $confParser = $confTypeFactory->load();
                $confArray = $confParser->toArray();
            }
            $conf = $confArray;
        }
        self::$defaultConf = new FakerinoConf($conf);
        self::$defaultConf->loadConfiguration();

        return new FakeDataFactory(self::getDefaultHandler(), new DoctrineLayer(self::getDatabaseConfig()), new TwigTemplate());
    }
611654
public static function set($config = null, bool $force = false)
    {
        if ( ! $force && ! empty(self::$config)) {
            return;
        }

        if (is_array($config)) {
            self::$config = $config;
        } else {
            self::$config = require $config ?? self::DEFAULT_CONFIG_PATH;
        }
    }
749394
public function saveOptions($config = null)
    {
        if ($config === null) {
            return $this->getConfig('saveOptions');
        }

        return $this->setConfig('saveOptions', $config);
    }
196529
public static function get(string $config)
  {
    $conf = explode('.', $config);
    $path = DEPConfig::$appdir . 'config' . DIRECTORY_SEPARATOR . $conf[0] . '.php';

    $service = require $path;
    unset($conf[0]);

    foreach($conf as $setting) {
      if (isset($service[$setting])) {
        $service = $service[$setting];
      } else {
        return null;
      }
    }

    return $service;
  }
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;
    }
1215561
public function format($content, $conf)
    {
        // set default values
        $inputFormat = $conf['inputFormat'] ?: 'Y-m-d\TH:i:s\Z';
        $outputFormat = $conf['outputFormat'] ?: '';
        return $this->formatService->format($content, $inputFormat, $outputFormat);
    }
1031215
public function getConfigFile($file = null)
    {
        $file = $file ?: $this->configFile;

        return file_exists($file) ? $file : $this->getConfigFileStub();
    }
194327
protected static function parseConfig($config, $default)
    {
        array_walk($default, function ($value, $key) use (&$config) {
            if (empty($config[$key]) || !isset($config[$key])) {
                $config[$key] = $value;
            }
        });

        return $config;
    }
818926
public function getConnectionConfig($conn = null)
    {
        $conn = $conn ?: $this->getConnectionName();

        return $this->config->extract('queue.' . $conn);
    }
1248433
public static function get( $key = null ) {
		$configs = self::$configs;
		if ( $key ) {
			$configs = ! empty( self::$configs[ $key ] ) ? self::$configs[ $key ] : null;
		} else {
			$configs = self::$configs;
		}

		return $configs;
	}
291953
public function config($config = null)
    {
        if (is_array($config)) {
            $this->_config = $config;
        } elseif (is_string($config)) {
            if (!empty($this->_config[$config])) {
                return $this->_config[$config];
            }

            return false;
        }

        return $this->_config;
    }
523488
protected function getContentObjectVariables(array $conf = array())
    {
        // Call Parent Function to maintain core functions
        $variables = parent::getContentObjectVariables($conf);

        $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
        $this->inlineHelper = $objectManager->get(InlineHelper::class);

        // Make some enhancements to data
        $data = $variables['data'];
        $this->inlineHelper->addFilesToData($data, "pages");
        $this->inlineHelper->addIrreToData($data, "pages");
        $variables['data'] = $data;

        return $variables;
    }
1271847
public static function get($key = null)
    {
        if ($key) {
            $config = static::findBy(['key' => $key]);
            return $config ? $config->getValue() : '';
        } else {
            $config = [];
            foreach (static::all() as $c) {
                $config[$c->key] = $c->getValue();
            }
            return $config;
        }
    }
1146367
protected function getConfig($key = null, $default = null)
    {
        // check manually if a key is given and if it exists in the config
        // this has to be done to check for spoofed additional config keys so that null isn't returned
        if (!empty($key) && empty($this->config[$key])) {
            return $default;
        }

        return $key ? array_get($this->config, $key, $default) : $this->config;
    }
819101
public function getConfig($name = null)
    {
        if (!is_null($name)) {
            if (isset($this->_config[$name])) {
                return $this->_config[$name];
            } else {
                return null;
            }
        }

        return $this->_config;
    }