Returns backup configuration and merge it with preset if exists.

@return array
194066
private function getBackups()
    {
        $backups = $this->getContainer()->getParameter('nanbando.backup');

        $preset = [];
        if ($name = $this->getParameter('nanbando.application.name')) {
            /** @var PresetStore $presetStore */
            $presetStore = $this->getContainer()->get('presets');
            $preset = $presetStore->getPreset(
                $name,
                $this->getParameter('nanbando.application.version'),
                $this->getParameter('nanbando.application.options')
            );
        }

        return array_merge($preset, $backups);
    }
825036
protected function exportConfiguration()
    {
        $format = $this->command->choice('What format do you want your configuration in?', ConfigurationPublisher::$formats, 'php');
        $consolidated = $this->command->confirm('Do you want it consolidated (one file instead of many?', false);

        // Export configuration
        $this->igniter->exportConfiguration($format, $consolidated);
        $path = $this->paths->getRocketeerPath();

        // Summary
        $folder = basename(dirname($path)).'/'.basename($path);
        $this->command->writeln('<info>Your configuration was exported at</info> <comment>'.$folder.'</comment>.');

        return $path;
    }
1304450
public function getSchema()
    {
        $backup = array();
        $tables = $this->getTables();
        foreach ($tables as $table) {
            $backup[] = $this->getBackup();
        }
        
        return implode("\n\n", $backup);
    }
676215
private function extend(array $backup)
    {
        $preset = $this->presetStore->getPreset($this->application, $this->version, $this->options);

        return array_merge($preset, $backup);
    }
811652
public static function getConfiguration(): array
    {
        static $configuration;
        if (\is_array($configuration)) {
            return $configuration;
        }
        if (VersionNumberUtility::convertVersionStringToArray(VersionNumberUtility::getCurrentTypo3Version())['version_main'] < 9) {
            $configuration = isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['staticfilecache']) ? (array)\unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['staticfilecache']) : [];
        } else {
            $configuration = (array)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('staticfilecache');
        }

        return $configuration;
    }
761631
protected function getDefaultConfig()
    {
        $defaultConfig = [
            'denyExtensionRename' => true,
            'denyUpdateCheck' => true,
            'dirnameChangeChars' => [' ' => '_', ':' => '_'],
            'disabled' => false,
            'filenameChangeChars' => [' ' => '_', ':' => '_'],
            'jpegQuality' => 100,
            'uploadDir' => UPLOADED,
            'uploadURL' => Router::url('/files', true),
            'types' => $this->getTypes(),
        ];

        //If the user is not and admin
        if (!$this->Auth->isGroup(['admin'])) {
            //Only admins can delete or rename directories
            $defaultConfig['access']['dirs'] = [
                'create' => true,
                'delete' => false,
                'rename' => false,
            ];
            //Only admins can delete, move or rename files
            $defaultConfig['access']['files'] = [
                'upload' => true,
                'delete' => false,
                'copy' => true,
                'move' => false,
                'rename' => false,
            ];
        }

        return $defaultConfig;
    }
634371
public function config()
    {
        $config = config('packer');

        if (empty($config['environment'])) {
            $config['environment'] = app()->environment();
        }

        if (empty($config['public_path'])) {
            $config['public_path'] = public_path();
        }

        if (empty($config['asset'])) {
            $config['asset'] = asset('');
        }

        return $config;
    }
533515
public function findGeneralConfiguration(): array
    {
        /** @var array[] $configurationSets */
        $configurationSets = [[]];

        $modules = $this->packageRepository->findModules();
        foreach ($modules as $module) {
            $extra = $module->getExtra();
            $this->validateGeneralConfigurationSectionInExtra($extra);
            if (!isset($extra['phplist/core']['configuration'])) {
                continue;
            }

            $configurationSets[] = $extra['phplist/core']['configuration'];
        }

        return /** @scrutinizer ignore-call */ array_replace_recursive(...$configurationSets);
    }
632117
protected function getDefaultMetadata()
    {
        //merge acl
        $output = [];
        if (isset($this->settings['acl']) && !empty($this->settings['acl'])) {
            $output['ACL'] = $this->acl[$this->settings['acl']];
        }

        //merge storage
        if (isset($this->settings['storage'])) {
            if ('standard' === $this->settings['storage']) {
                $output['storage'] = static::STORAGE_STANDARD;
            } elseif ('reduced' === $this->settings['storage']) {
                $output['storage'] = static::STORAGE_REDUCED;
            }
        }

        //merge meta
        if (isset($this->settings['meta']) && !empty($this->settings['meta'])) {
            $output['meta'] = $this->settings['meta'];
        }

        //merge cache control header
        if (isset($this->settings['cache_control']) && !empty($this->settings['cache_control'])) {
            $output['CacheControl'] = $this->settings['cache_control'];
        }

        //merge encryption
        if (isset($this->settings['encryption']) && !empty($this->settings['encryption'])) {
            if ('aes256' === $this->settings['encryption']) {
                $output['encryption'] = 'AES256';
            }
        }

        return $output;
    }
930858
protected function getModuleConfig(): array
    {
        $merged = [];
        $merger = $this->getMerger();
        foreach ($this->getModules() as $module) {
            if ($module instanceof ConditionProviderInterface && $module->isConditioned() === true) {
                continue;
            }

            if ($module instanceof ConfigProviderInterface) {
                $merged = $merger->merge(
                    $merged,
                    $module->getConfig()->load()
                );
            }
        }

        return $merged;
    }
5756
protected function getListBackup()
    {
        $options = $this->query_filter;
        $options['limit'] = $this->data_limit;
        return $this->backup->getList($options);
    }
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;
    }
860505
public static function config_get_configuration_array($data) {
        $config = array();

        if (isset($data->path)) {
            $config['path'] = $data->path;
        }
        if (isset($data->autocreate)) {
            $config['autocreate'] = $data->autocreate;
        }
        if (isset($data->singledirectory)) {
            $config['singledirectory'] = $data->singledirectory;
        }
        if (isset($data->prescan)) {
            $config['prescan'] = $data->prescan;
        }

        return $config;
    }
205514
public function prepare()
    {

        $options = $this->options->prepareOptions;

        if( $options & Options::BACKUP or true ) {

            $root = $this->options->pathRoot;
            $pathsToBackup = $this->options->getPathsToBackup();

            // make a fully qualified path relative to $root
            $anchorToRoot = function( $path ) use ($root) {
                return escapeshellarg( "." . substr( $path, strlen($root) ) );
            };

            $pathsToBackup = array_map( $anchorToRoot, $pathsToBackup );
            $pathsToBackup = implode( ' ', $pathsToBackup );

            $backupDir = $this->options->getPath('backup');
            $filename = "{$backupDir}/" . self::fileSystemFriendly(
                date( DateTime::POSTGRES_TIMESTAMP_WITHOUT_TIME_ZONE_NO_MICROSECONDS )
            ) . '.tar.gz';

            $command = sprintf(
                'cd %s; tar cszf %s --exclude=%s -C %s %s; cd -',
                escapeshellarg( $root ),
                escapeshellarg( $filename ),
                $anchorToRoot( $backupDir ),
                escapeshellarg( $root ),
                $pathsToBackup
            );

            exec( $command );

        }

        // trash _all_ previously generated entitys
        /* BROKEN - Too agressive. Doesn't consider $options['match']
        $rebuild = in_array( $option, array( self::REBUILD_AND_BACKUP, self::REBUILD_NO_BACKUP ) );
        if( $rebuild ) {
            foreach( new \DirectoryIterator( $this->paths['entity'] ) as $item ) {
                if( $item->isFile() ) {
                    // unlink( $item->getPathname() );
                }
            }
        }
         */

    }
849537
protected function getConfigFiles()
    {
        $file = new Filesystem();

        $projectFiles = $file->glob(app_path('honeycomb/config.json'));
        $packageFiles = $file->glob(__DIR__ . '/../../../../*/*/*/*/honeycomb/config.json');

        return array_merge($packageFiles, $projectFiles);
    }
999659
public function get_normalized_value() {
        $value = $this->get_value();
        if ($value === false && $this->get_ui() instanceof backup_setting_ui_defaultcustom) {
            $attributes = $this->get_ui()->get_attributes();
            return $attributes['defaultvalue'];
        }
        return $value;
    }
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;
    }