protected function createConfigFile($connectionInfo)
    {
        $fs = new Filesystem();

        $sampleConfigFile = THELIA_CONF_DIR . "database.yml.sample";
        $configFile = THELIA_CONF_DIR . "database.yml";

        $fs->copy($sampleConfigFile, $configFile, true);

        $configContent = file_get_contents($configFile);

        $configContent = str_replace("%DRIVER%", "mysql", $configContent);
        $configContent = str_replace("%USERNAME%", $connectionInfo["username"], $configContent);
        $configContent = str_replace("%PASSWORD%", $connectionInfo["password"], $configContent);
        $configContent = str_replace(
            "%DSN%",
            sprintf("mysql:host=%s;dbname=%s;port=%s", $connectionInfo["host"], $connectionInfo["dbName"], $connectionInfo['port']),
            $configContent
        );

        file_put_contents($configFile, $configContent);

        $fs->remove($this->getContainer()->getParameter("kernel.cache_dir"));
    }
protected function createConfigFile($connectionInfo)
    {
        $fs = new Filesystem();

        $sampleConfigFile = THELIA_CONF_DIR . "database.yml.sample";
        $configFile = THELIA_CONF_DIR . "database.yml";

        $fs->copy($sampleConfigFile, $configFile, true);

        $configContent = file_get_contents($configFile);

        $configContent = str_replace("%DRIVER%", "mysql", $configContent);
        $configContent = str_replace("%USERNAME%", $connectionInfo["username"], $configContent);
        $configContent = str_replace("%PASSWORD%", $connectionInfo["password"], $configContent);
        $configContent = str_replace(
            "%DSN%",
            sprintf("mysql:host=%s;dbname=%s;port=%s", $connectionInfo["host"], $connectionInfo["dbName"], $connectionInfo['port']),
            $configContent
        );

        file_put_contents($configFile, $configContent);

        $fs->remove($this->getContainer()->getParameter("kernel.cache_dir"));
    }
protected function createConfigFile ( $ connectionInfo ) { $ fs = new Filesystem ( ) ; $ sampleConfigFile = THELIA_CONF_DIR . "database.yml.sample" ; $ configFile = THELIA_CONF_DIR . "database.yml" ; $ fs -> copy ( $ sampleConfigFile , $ configFile , true ) ; $ configContent = file_get_contents ( $ configFile ) ; $ configContent = str_replace ( "%DRIVER%" , "mysql" , $ configContent ) ; $ configContent = str_replace ( "%USERNAME%" , $ connectionInfo [ "username" ] , $ configContent ) ; $ configContent = str_replace ( "%PASSWORD%" , $ connectionInfo [ "password" ] , $ configContent ) ; $ configContent = str_replace ( "%DSN%" , sprintf ( "mysql:host=%s;dbname=%s;port=%s" , $ connectionInfo [ "host" ] , $ connectionInfo [ "dbName" ] , $ connectionInfo [ 'port' ] ) , $ configContent ) ; file_put_contents ( $ configFile , $ configContent ) ; $ fs -> remove ( $ this -> getContainer ( ) -> getParameter ( "kernel.cache_dir" ) ) ; }
rename database config file and complete it

@param array $connectionInfo
rename database config file and complete it