Jointer command
@return void Configurated files are saved
498226
private function cmdJss()
    {
        if ($jss = $this->config->get('jss')) {
            echo "\n - Compiled JS+CSS -\n";

            if (!$this->subCmd) {
                foreach ($jss as $k => $v) {
                    echo "\n - $k:\n";
                    $this->jssCompiler($v);
                }
                return;
            }

            if (isset($jss->{$this->subCmd})) {
                echo "\n - ".$this->subCmd."\n";
                
                $this->jssCompiler($jss->{$this->subCmd});
                return;
            } else {
                echo "\n Err: Not found!\n";
                return;
            }
        }
    }
685574
protected function save() {
        // write contents modify in hgrc
        if ($fileConfig = @fopen($this->repository->getDir() . $this->repository->getFileConfig() . "hgrc", 'w+')) {
			$ret = fwrite($fileConfig, $this->arr2ini($this->configuration));
			fclose($fileConfig);
			return $ret;
		}
		return false;
    }
1247715
public function writeConfiguration()
    {
        $configFile= APP_PATH.'config/database.php';
        $config    = $this->getPostConfiguration();

        $configStr = <<<CONFIG
<?php

\$config['database'] = array(
    'default'       => '{$config['driver']}',

    'connections'   => array(
        '{$config['driver']}'     => array(
            'driver'    => '{$config['driver']}',
            'host'      => isset(\$_SERVER['DB1_HOST']) ? \$_SERVER['DB1_HOST'] : '{$config['host']}',
            'database'  => isset(\$_SERVER['DB1_NAME']) ? \$_SERVER['DB1_NAME'] : '{$config['database']}',
            'username'  => isset(\$_SERVER['DB1_USER']) ? \$_SERVER['DB1_USER'] : '{$config['username']}',
            'password'  => isset(\$_SERVER['DB1_PASS']) ? \$_SERVER['DB1_PASS'] : '{$config['password']}',
            'charset'   => '{$config['charset']}',
            'collation' => '{$config['collation']}',
            'prefix'    => '{$config['prefix']}'
        )
    )
);
CONFIG;

        file_put_contents($configFile, $configStr);

        $this->makeConnection($config);
        $this->migrate();
        $this->seed();

        Response::redirect($this->data['baseUrl'].'install.php/finish');
    }
897902
function writeBaseConfiguration()
    {
        if (! $this->files->exists($this->path())) {
            $this->write(['tld' => 'test', 'paths' => []]);
        }

        /**
         * Migrate old configurations from 'domain' to 'tld'
         */
        $config = $this->read();

        if (isset($config['tld'])) {
            return;
        }

        $this->updateKey('tld', !empty($config['domain']) ? $config['domain'] : 'test');
    }
25246
public function save()
    {
        $filepath = $this->getFilepath();
        $this->validateConfig($this->rules, $this->configData);
        $fileSystem = $this->createNew(FileSystem::class);
        $fileSystem->filePutContents($filepath, json_encode($this->configData, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
    }
165922
protected function registerSelfUpdateCommand()
    {
        $this->getContainer()->add(SelfUpdateCommand::class)
            ->withArguments([
                \Symfony\Component\Filesystem\Filesystem::class,
                \Symfony\Component\Finder\Finder::class,
            ]);
    }
581239
protected function initConfig(): void
    {
        $configFile = $this->getRootRelatedPath($this->getConfigFileName());

        $this->assertFileIsReadable($configFile);

        self::$config = (array)(include $configFile);
    }
383153
protected function cmdRefresh() /*: void*/
    {
        /**
         * @see simplecomplex_config_cli()
         */
        $container = Dependency::container();
        // Validate input. ---------------------------------------------
        $store = '';
        if (empty($this->command->arguments['store'])) {
            $this->command->inputErrors[] = !isset($this->command->arguments['store']) ? 'Missing \'store\' argument.' :
                'Empty \'store\' argument.';
        } else {
            $store = $this->command->arguments['store'];
            if (!ConfigKey::validate($store)) {
                $this->command->inputErrors[] = 'Invalid \'store\' argument.';
            }
        }
        $allow_none = !empty($this->command->options['allow-none']);
        $verbose = !empty($this->command->options['verbose']);
        // Pre-confirmation --yes/-y ignored for this command.
        if ($this->environment->riskyCommandRequireConfirm && $this->command->preConfirmed) {
            $this->command->inputErrors[] = 'Pre-confirmation \'yes\'/-y option not supported for this command,'
                . "\n" . 'unless env var PHP_LIB_SIMPLECOMPLEX_UTILS_CLI_SKIP_CONFIRM'
                . "\n" . 'or .risky_command_skip_confirm file in document root.';
        }
        if ($this->command->inputErrors) {
            foreach ($this->command->inputErrors as $msg) {
                $this->environment->echoMessage(
                    $this->environment->format($msg, 'hangingIndent'),
                    'notice'
                );
            }
            // This command's help text.
            $this->environment->echoMessage("\n" . $this->command);
            exit;
        }
        // Display command and the arg values used.---------------------
        if ($this->environment->riskyCommandRequireConfirm || !$this->command->preConfirmed) {
            $this->environment->echoMessage(
                $this->environment->format(
                    $this->environment->format($this->command->name, 'emphasize')
                    . "\n" . 'store: ' . $store,
                    'hangingIndent'
                )
            );
        }
        // Request confirmation, ignore --yes/-y pre-confirmation option;
        // unless .risky_command_skip_confirm file placed in document root.
        if ($this->environment->riskyCommandRequireConfirm) {
            if (!$this->environment->confirm(
                'Refresh that config store? Type \'yes\' to continue:',
                ['yes'],
                '',
                'Aborted refreshing config store.'
            )) {
                exit;
            }
        } elseif (!$this->command->preConfirmed && !$this->environment->confirm(
                'Refresh that config store? Type \'yes\' or \'y\' to continue:',
                ['yes', 'y'],
                '',
                'Aborted refreshing config store.'
            )) {
            exit;
        }
        // Check if the command is doable.------------------------------
        // Nothing to check here.
        if ($store == 'global' && $container->has('config')) {
            /** @var IniSectionedConfig $config_store */
            $config_store = $container->get('config');
        } else {
            $config_class = static::CLASS_CONFIG;
            /** @var IniSectionedConfig $config_store */
            $config_store = new $config_class($store);
        }
        // Do it.
        if (!$config_store->refresh($allow_none, $verbose)) {
            $this->environment->echoMessage('Failed to refresh config store[' . $store . '].', 'error');
        } elseif (!$this->command->silent) {
            $this->environment->echoMessage('Refreshed config store[' . $store . '].', 'success');
        }
        exit;
    }
1073639
protected function registerConfigFiles()
    {
        if (isset($this->dir) and isset($this->configFiles) and is_array($this->configFiles)) {
            foreach ($this->configFiles as $key) {
                $path = $this->getConfigFilePath($key);
                //$this->mergeConfigFrom($this->getConfigFilePath($filename), $filename);
                $config = $this->app->make('config')->get($key, [ ]);
                $this->app->make('config')->set($key, array_replace_recursive(require $path, $config));
            }
        }
    }
205343
public function setupCommand() {
		$serverPublicKeyString = Files::getFileContents('resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoServer.pub', FILE_TEXT);
		if ($serverPublicKeyString === FALSE) {
			$this->outputLine('Could not open resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoServer.pub, exiting.');
			$this->quit(1);
		}

		$serverPublicKeyFingerprint = $this->rsaWalletService->registerPublicKeyFromString($serverPublicKeyString);
		$this->outputLine('Registered sso demo server public key');

		$clientPrivateKeyString = Files::getFileContents('resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoClient.key', FILE_TEXT);
		if ($clientPrivateKeyString === FALSE) {
			$this->outputLine('Could not open resource://Flowpack.SingleSignOn.DemoInstance/Private/Fixtures/DemoClient.key, exiting.');
			$this->quit(2);
		}

		$clientPublicKeyFingerprint = $this->rsaWalletService->registerKeyPairFromPrivateKeyString($clientPrivateKeyString);
		$this->outputLine('Registered demo client key pair');

		$globalSettings = $this->yamlSource->load(FLOW_PATH_CONFIGURATION . '/Settings');
		$globalSettings['Flowpack']['SingleSignOn']['Client']['client']['publicKeyFingerprint'] = $clientPublicKeyFingerprint;
		$globalSettings['Flowpack']['SingleSignOn']['Client']['server']['DemoServer']['publicKeyFingerprint'] = $serverPublicKeyFingerprint;
		$this->yamlSource->save(FLOW_PATH_CONFIGURATION . '/Settings', $globalSettings);
		$this->outputLine('Updated settings');
	}
937198
public function deploy()
    {
        $configs = JsonListener::open(FEnvFcm::get("framework.config.core.config.file"));
        $default = $configs->default_env;
        if ($default == "prod") {
            JsonListener::close(FEnvFcm::get("framework.config.core.config.file"));
            Output::displayAsError("Cannot deployed to production environment : Your(s) app(s) are already deployed");
        }

        $this->getRequirements();

        $configs->default_env = "prod";
        $configs->deployment = new \DateTime();
        JsonListener::put(
            FEnvFcm::get("framework.config.core.config.file"),
            json_encode($configs, JSON_PRETTY_PRINT)
        );
        JsonListener::close(FEnvFcm::get("framework.config.core.config.file"));

        //ASSETS MANAGER
        $asm = new ASM();
        $asm->__render(["commands" => ["assets:clear"], "options" => ["--env=prod", "--noexit"]]);
        $asm->__render(["commands" => ["assets:copy"], "options" => ["--env=prod", "--noexit"]]);

        // CACHE MANAGER
        (new CAM())->__render(["commands" => ["cache:clear"], "options" => ["--env=all", "--noexit"]]);

        // COMPILED MANAGER
        $com = new COM();
        $com->__render(["commands" => ["compiled:clear"], "options" => ["--env=all", "--noexit"]]);

        // Mercure MANAGER
        (new Mercure())->__render(["commands" => ["mercure:build:jsrouting"], "options" => ["--noexit"]]);

        Output::clear();
        CoreManager::setCurrentModule("Deployer Manager");
        Output::displayAsEndSuccess("The deployment process is successful");
    }
904014
private void completeFilesystem(ConfigurationBuilder builder, Configuration configuration)
    {
        PersistenceConfigurationBuilder persistence = builder.persistence();

        if (containsIncompleteFileLoader(configuration)) {
            for (StoreConfigurationBuilder<?, ?> store : persistence.stores()) {
                if (store instanceof SingleFileStoreConfigurationBuilder) {
                    SingleFileStoreConfigurationBuilder singleFileStore = (SingleFileStoreConfigurationBuilder) store;

                    singleFileStore.location(createTempDir());
                }
            }
        }
    }
12452
private function saveInstalledPaths()
    {
        // Check if we found installed paths to set.
        if (count($this->installedPaths) !== 0) {
            $paths = implode(',', $this->installedPaths);
            $arguments = array('--config-set', self::PHPCS_CONFIG_KEY, $paths);
            $configMessage = sprintf(
                'PHP CodeSniffer Config <info>%s</info> <comment>set to</comment> <info>%s</info>',
                self::PHPCS_CONFIG_KEY,
                $paths
            );
        } else {
            // Delete the installed paths if none were found.
            $arguments = array('--config-delete', self::PHPCS_CONFIG_KEY);
            $configMessage = sprintf(
                'PHP CodeSniffer Config <info>%s</info> <comment>delete</comment>',
                self::PHPCS_CONFIG_KEY
            );
        }

        $this->io->write($configMessage);

        $this->processExecutor->execute(
            sprintf(
                'phpcs %s',
                implode(' ', $arguments)
            ),
            $configResult,
            $this->composer->getConfig()->get('bin-dir')
        );

        if ($this->io->isVerbose() && !empty($configResult)) {
            $this->io->write(sprintf('<info>%s</info>', $configResult));
        }
    }
393554
public function cmdGetFile()
    {
        $result = $this->getListFile();
        $this->outputFormat($result);
        $this->outputFormatTableFile($result);
        $this->output();
    }
1024567
private static function initializeConfigurations()
    {
        if (!is_readable(self::CONFIGURATION_PATH)) {
            throw new \RuntimeException("Cannot parse configurations file (config.ini)");
        }
        self::$configurationFile = new ConfigurationFile(self::CONFIGURATION_PATH);
    }
268005
protected function configureAliases()
    {
        $file = "{$this->basePath}/aliases.sh";
        if (file_exists($file)) {
            $fileContent = file_get_contents($file);
            $fileContent = str_replace(
                'alias p=\'cd ~/Code/artestead\'',
                'alias p=\'cd ~/Code/'.$this->defaultName.'\'',
                $fileContent
            );
            file_put_contents($file, $fileContent);
        }
    }
76664
public static function configure(): void
    {
        $filesystem = new Filesystem();
        $config     = [
            'colors'          => '1',
            'installed_paths' => implode(',', [
                Path::VENDOR_DIR . '/hostnet/phpcs-tool/src/',
                Path::VENDOR_DIR . '/slevomat/coding-standard/SlevomatCodingStandard',
            ]),
        ];

        if (!$filesystem->exists(['phpcs.xml', 'phpcs.xml.dist'])) {
            $config['default_standard'] = 'Hostnet';
        }

        $filesystem->dumpFile(
            Path::VENDOR_DIR . '/squizlabs/php_codesniffer/CodeSniffer.conf',
            sprintf('<?php $phpCodeSnifferConfig = %s;', var_export($config, true))
        );

        $filesystem->dumpFile(__DIR__ . '/../../../HostnetPaths/ruleset.xml', self::generateHostnetPathsXml());
    }