Setup config store.

@return JSON
514422
protected function _setStore()
    {
        $tmp  = [];
        $rows = $this->_getTable()->find();
        /** @var \Config\Model\Entity\Config $row */
        foreach ($rows as $row) {
            $tmp[$row->name] = $row->get('params');
        }

        return new JSON($tmp);
    }
620188
public static function installConfig()
    {
        $conf_tgt = self::get('app_config_filepath');
        $i18n_tgt = self::get('app_i18n_filepath');

        if (false===@file_exists($conf_tgt)) {
            $conf_src = self::getPath('config') . self::$_defaults['filenames']['app_config'];
            if (false===@copy($conf_src, $conf_tgt)) {
                throw new \Exception(
                    sprintf('Can not copy distributed configuration file to "%s"!', self::getPath('app_config', true))
                );
            }
        }

        if (false===@file_exists($i18n_tgt)) {
            $i18n_src = self::getPath('config') . self::$_defaults['filenames']['app_i18n'];
            if (false===@copy($i18n_src, $i18n_tgt)) {
                throw new \Exception(
                    sprintf('Can not copy distributed language file to "%s"!', self::getPath('app_i18n', true))
                );
            }
        }

        return true;
    }
50515
protected function configure()
    {
        $this
            ->addArgument('stores', InputArgument::IS_ARRAY | InputArgument::REQUIRED,
                'A list of stores to re-encrypt.')
            ->addOption(
                'new-profile',
                null,
                InputOption::VALUE_REQUIRED,
                'The new profile the current data is encrypted with.',
                null
            )
            ->addOption(
                'offset',
                null,
                InputOption::VALUE_REQUIRED,
                'Starting record',
                0
            )
            ->addOption(
                'limit',
                null,
                InputOption::VALUE_REQUIRED,
                'Max records to process',
                null
            )
            ->addOption(
                'batch-size',
                null,
                InputOption::VALUE_REQUIRED,
                'Records per batch to process',
                1
            );
    }
648038
public function saveSettings()
    {
        // Get dependencies
        $settingMapper = ($this->container->dataMapper)('SettingMapper');
        $json = $this->container->json;

        // Fetch custom settings
        $jsonFilePath = ROOT_DIR . "structure/definitions/customSettings.json";
        $customSettings = $json->getJson($jsonFilePath, 'setting');
        $customSettings = $customSettings->settings;

        // Get $_POST data array
        $allSettings = $this->request->getParsedBody();

        // Save each setting
        foreach ($allSettings['setting_key'] as $key => $row) {
            $setting = $settingMapper->make();
            $setting->id = $allSettings['setting_id'][$key];

            // Check for a custom setting delete
            if (isset($allSettings['setting_delete'][$key])) {
                $settingMapper->delete($setting);
                continue;
            }

            $setting->setting_value = $allSettings['setting_value'][$key];

            // If there is no ID, then this is a new custom setting to save
            // Import setting information from custom file
            if (empty($allSettings['setting_id'][$key])) {
                // Get custom setting array key for this setting_key for reference
                $jsonKey = array_search($allSettings['setting_key'][$key], array_column($customSettings, 'key'));

                // Populate the new custom setting and save
                $setting->category = 'custom';
                $setting->sort_order = 1; // Custom setting display order is based on JSON list order
                $setting->setting_key = $customSettings[$jsonKey]->key;
                $setting->input_type = $customSettings[$jsonKey]->inputType;
                $setting->label = $customSettings[$jsonKey]->label;
                $setting->help = $customSettings[$jsonKey]->help;
            }

            $settingMapper->save($setting);
        }

        // Redirect back to list of settings
        return $this->redirect('adminSettings');
    }
142912
protected function registerConfig() {
        $config = new Configuration($this->configFile);
        $this->container->set('config', function() use ($config) {
                return $config;
        });
    }
219946
function initializeStore(config) {
		self.store = new Store(config.master, config);
		self.store.on('message', handleIncomingMessage);
		log.out('Store initialized.');
	}
46954
protected function loadConfiguration()
    {
        $configuration = null;

        if (file_exists(self::CONFIGURATION_FILENAME)) {
            $configuration = json_decode(file_get_contents(self::CONFIGURATION_FILENAME), true);
        }

        return $configuration ?: array();
    }
1265218
private function setupJson()
    {
        $this->io->title('Creating/updating composer.json');
        $this->app['extend.manager.json']->update();
        $this->io->success('Success');
    }
184269
def set_json(self, config_json):
        """"""

        if self.configuration_dict is not None:
            raise RuntimeError("Can only set configuration once", self.configuration_dict)

        schema = fetch_config('ConfigurationSchema.json')
        validictory.validate(config_json, schema)

        config_json['name'] = self.name
        config_json['run_number'] = self.run
        config_json['src_dir'] = get_source_dir()
        config_json['data_dir'] = get_data_dir()
        config_json['log_dir'] = get_log_dir()

        self.configuration_dict = config_json
314977
protected function configFactory(): Config
	{
		return new Config(new Loader($this->container->get(FileSystem::class), $this->applicationPath . '/config'), $this->getEnvironment());
	}
323926
public function store() {
        $options = $this->getOptions();
        $key = self::DEFAULT_REGISTRY_KEY;

        if (isset($options['storage']['registry']['key'])
            && !empty($options['storage']['registry']['key'])
        ) {
            $key = $options['storage']['registry']['key'];
        }

        Zend_Registry::set($key, $this->_acl);
    }
913483
public function setConfig()
    {
        $this->config = (require static::prependPackagePath('bootstrap/config.php'))['web-drivers'];

        $this->config = @$this->config[$this->getDriver()][$this->getUserOS()];

        if (!$this->config) {
            throw new \ErrorException("Currently {$this->getDriver()} not supported.");
        }

        return $this;
    }
73464
private function saveConfiguration()
    {
        $this->info("Writing configuration file...");

        // Save in .env file
        $this->env->setEnv(
            [
            'APP_URL' => $this->APP_URL,
            'DB_CONNECTION' => $this->DB_TYPE,
            'DB_HOST' => $this->DB_HOST,
            'DB_PORT' => $this->DB_PORT,
            'DB_DATABASE' => $this->DB_DATABASE,
            'DB_USERNAME' => $this->DB_USERNAME,
            'DB_PASSWORD' => $this->DB_PASSWORD,
            ]
        );

        // save in runtime

        config(['app.url' => $this->APP_URL]);
        config(['app.name' => str_replace(' ', '_', $this->APP_NAME)]);
        config(['database.connections.mysql.driver' => $this->DB_TYPE]);
        config(['database.connections.mysql.host' => $this->DB_HOST]);
        config(['database.connections.mysql.port' => $this->DB_PORT]);
        config(['database.connections.mysql.database' => $this->DB_DATABASE]);
        config(['database.connections.mysql.username' => $this->DB_USERNAME]);
        config(['database.connections.mysql.password' => $this->DB_PASSWORD]);

        // save in app.config
        $content = File::get(config_path('app.php'));
        $newContent = str_replace(
            "'name' => '".config('app.name')."'",
            "'name' => '".$this->APP_NAME."'",
            $content
        );

        FILe::put(config_path('app.php'), $newContent);

        $this->advanceBar();

        $this->clearCaches();

        return $this;
    }
374740
private function setup()
    {
        $loader = new FilesystemLoader(GeneratorHelper::getTemplatePath());
        $this->tpl = new Environment($loader, array(
            'cache' => CACHE_DIR . DIRECTORY_SEPARATOR . 'twig',
            'debug' => (bool)$this->debug,
            'auto_reload' => Config::getParam('twig.autoreload', TRUE),
        ));
        $this->loadDomains();
    }
622245
public function store()
    {
        // Create a new object
        $item = new $this->model;

        // Remove nested model data from input and prepare to insert on save
        $input = (new NestedModels)->relateTo($item);

        // Hydrate the object
        $item->fill($input);

        // Validate and save.
        $this->validate($item);
        if ($this->parent) {
            $this->parent->{$this->parent_to_self}()->save($item);
        } else {
            $item->save();
        }

        // Redirect to edit view
        if (Request::ajax()) {
            return Response::json(['id' => $item->id]);
        } else {
            return Redirect::to(DecoyURL::relative('edit', $item->id))
            ->with('success', $this->successMessage($item, 'created'));
        }
    }
249628
protected function getFreshConfiguration()
    {
        //$app = require $this->laravel->bootstrapPath().'/app.php';
        $app = Start::instance()->bootstrap()->getApplication();

        $app->useStoragePath($this->laravel->storagePath());

        $app->make(ConsoleKernelContract::class)->bootstrap();

        return $app['config']->all();
    }
483728
protected function setup() {
        if (!$this->_isSetup) {
            $defaultConfig = array(
                'srcBasePath' => Yii::getAlias('@webroot'),
                'dstBasePath' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(true),
                'dstUrlBase' => Yii::$app->czaHelper->folderOrganizer->getEntityUploadPath(),
                'underOwnerEntityPath' => true,
                'createMode' => 0775,
                'cachingPath' => '',
            );
            $this->config = \yii\helpers\ArrayHelper::merge($defaultConfig, $this->config);


            $defaultOptions = array(
                'isTranslation' => false,
                'handleFiles' => true,
                'handleImages' => true,
            );
            $this->options = \yii\helpers\ArrayHelper::merge($defaultOptions, $this->options);
            $this->_isSetup = true;
        }
    }