Return config array to write to disc.

@return array
767126
public function getJsonData() : array
    {
        $return = [];

        foreach (Hooks::getValidHooks() as $hook => $value) {
            $return[$hook] = $this->hooks[$hook]->getJsonData();
        }

        return $return;
    }
742069
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setString('t', $this->type, '')
                    ->setString('n', $this->name, '')
                    ->setArray('l', $this->labels->writeData(), null, [])
                    ->setArray('d', $this->descriptions->writeData(), null, [])
                    ->setInteger('r', $this->providesRecipeLocalisation ? 1 : 0, 0)
                    ->setInteger('m', $this->providesMachineLocalisation ? 1 : 0, 0)
                    ->setString('i', $this->iconHash, '')
                    ->setInteger('e', $this->isNew ? 1 : 0, 1);
        return $dataBuilder->getData();
    }
1133343
public function allToArray()
    {
        $config = [];

        try {
            foreach ($this->findAll() as $object) {
                $key = $object->key_name;
                if ($object->group_name != 'config') {
                    $config[$object->group_name][$key] = $object->value;
                } else {
                    $config[$key] = $object->value;
                }
            }
        } catch (Exception $e) {
            Log::error($e->getMessage());
        }

        return $config;
    }
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;
  }
404590
public function getDirectories()
    {

        // initialize the array with the directories
        $directories = array();

        // iterate over the directory keys and read the configuration values
        foreach (DirectoryKeys::getServerDirectoryKeys() as $directoryKey) {
            $directories[$directoryKey] = $this->getSystemConfiguration()->getParam($directoryKey);
        }

        // return the array with the directories
        return $directories;
    }
1690
public function generate()
    {
        $tempPath = sys_get_temp_dir() . '/';

        // FastCGI fix for Windows machines, where temp path is not available to
        // PHP, and defaults to the unwritable system directory.  If the temp
        // path is pointing to the system directory, shift to the 'TEMP'
        // sub-folder, which should also exist, but actually be writable.
        if (IS_WIN && $tempPath == getenv("SystemRoot") . '/') {
            $tempPath = getenv("SystemRoot") . '/TEMP/';
        }

        $keyFile = $tempPath . md5(microtime(true));

        if (!is_dir($tempPath)) {
            mkdir($tempPath);
        }

        $return = array('private_key' => '', 'public_key' => '');

        $output = @shell_exec('ssh-keygen -t rsa -b 2048 -f '.$keyFile.' -N "" -C "deploy@phpci"');

        if (!empty($output)) {
            $pub = file_get_contents($keyFile . '.pub');
            $prv = file_get_contents($keyFile);

            if (!empty($pub)) {
                $return['public_key'] = $pub;
            }

            if (!empty($prv)) {
                $return['private_key'] = $prv;
            }
        }

        return $return;
    }
794754
private function _getEventsConfig()
    {
        $content = array(self:: MAIN_EVENTS_FILE => array());

        $configPath = $this->_configPath;
        if (! is_dir($configPath)) {
            return $content;
        }

        $files = DirData::listFilesRecursive($configPath, self:: MAIN_EVENTS_FILE . self::EXT);
        foreach ($files as $file) {
            $content[self:: MAIN_EVENTS_FILE] = array_merge_recursive(require($file), $content[self:: MAIN_EVENTS_FILE]);
        }

        return $content;
    }
927019
protected function getFileSystem(): array
	{
		$fileSystem = [];

		$command = $this->readCommand('df -T');
		if ($command) {
			$bufe = preg_split("/\n/", $command, -1, PREG_SPLIT_NO_EMPTY);
			unset($bufe[0]);
			foreach ($bufe as $buf) {
				$data = preg_split('/\s+/', $buf);
				$mounted = new Obj;

				$mounted->partition = $data[0];
				$mounted->type = $data[1];
				$mounted->size = $data[2] * 1024;
				$mounted->used = $data[3] * 1024;
				$mounted->free = $data[4] * 1024;
				$mounted->usage = $data[5];
				$mounted->mountPoint = $data[6];

				$fileSystem[] = $mounted;
			}
		}

		return $fileSystem;
	}
313710
public function toArray()
    {
        $array = array();
        $data = $this->data;

        foreach ($data as $key => $value) {
            if ($value instanceof Config) {
                $array[$key] = $value->toArray();
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
461552
public function toArray()
    {
        $data = [];

        foreach ($this->config as $key => $value) {
            if ($value instanceof self) {
                $value = $value->toArray();
            }

            $data[$key] = $value;
        }

        return $data;
    }
782140
public function getConfigFilesSorted()
    {
        $fileSystem = new Filesystem();

        $projectConfig = $fileSystem->glob(app_path('hc-config.json'));
        $packageConfigs = $fileSystem->glob(__DIR__ . '/../../../../*/*/*/hc-config.json');

        $packageConfigs = $this->sortByPriority($packageConfigs);

        $files = array_merge($packageConfigs, $projectConfig);

        return $files;
    }
1095564
public function loadConfiguration()
    {
        if (!file_exists($this->path)) {
            return array();
        }
        
        if (!is_readable($this->path)) {
            throw new Exception('The file "' . $this->path . '" isn\'t readable!');
        }
        
        $content = file_get_contents($this->path);
        $settings = json_decode($content, true);

        if ($settings == false) {
            return array();
        }
        
        return $settings;
    }
542832
public function writeData(): array
    {
        $dataBuilder = new DataBuilder();
        $dataBuilder->setString('n', $this->name, '')
                    ->setString('m', $this->mode, '')
                    ->setArray('i', $this->ingredients, function (Ingredient $ingredient): array {
                        return $ingredient->writeData();
                    }, [])
                    ->setArray('p', $this->products, function (Product $product): array {
                        return $product->writeData();
                    }, [])
                    ->setFloat('c', $this->craftingTime, 0.)
                    ->setString('a', $this->craftingCategory, '')
                    ->setArray('l', $this->labels->writeData(), null, [])
                    ->setArray('d', $this->descriptions->writeData(), null, [])
                    ->setString('h', $this->iconHash, '');
        return $dataBuilder->getData();
    }
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;
    }
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;
    }
1290886
protected function getConfig(): array
    {
        $loader = null;
        if ($this->isCacheEnabled() === true) {
            $loader = $this->getLoader();
            $cached = $loader->load();
            if (empty($cached) === false) {
                return $cached;
            }
        }

        if ($this->isFrameworkEnabled() === true) {
            $this->addFrameworkConfigs();
        }

        $merged = [];
        $merger = $this->getMerger();
        foreach ($this->getConfigs() as $config) {
            $merged = $merger->merge(
                $merged,
                $config->load()
            );
        }

        foreach ($this->getGlobalConfig() as $global) {
            $merged = $merger->merge($merged, $global);
        }

        foreach ($this->getModuleConfig() as $module) {
            $merged = $merger->merge($merged, $module);
        }

        if ($this->isCacheEnabled() === true) {
            if ($loader instanceof CacheLoader) {
                $loader->save($merged);
            }
        }

        return $merged;
    }
181923
public function getConfig(): array
	{
		global $txt, $modSettings;

		$file = $this->_app->boardDir .'/_config'. $this->_app->name .'.json';

		// Already loaded or does not use config?
		if ($this->_config || !$this->_app->useConfig)
			return $this->_config;

		// Check for a $modSettings key first.
		if (!empty($modSettings['_config'. $this->_app->name]))
			return $this->_config = smf_json_decode($modSettings['_config'. $this->_app->name], true);

		// Get the json file. Must be located in $boarddir folder.
		if (!$this->_config && !file_exists($file))
		{
			loadLanguage('Errors');
			log_error(sprintf($txt['error_bad_file'], $file));
		}

		else
			$this->_config = smf_json_decode(file_get_contents($file), true);

		return $this->_config;
	}