public function createContents(AbstractDatabase $database, $dataDir)
    {
        $template  = file_get_contents(__DIR__.'/../../res/template/config.php.txt');
        $variables = [
            '{{DBTYPE}}'          => $database->type,
            '{{DBLIBRARY}}'       => $database->library,
            '{{DBHOST}}'          => $database->host,
            '{{DBNAME}}'          => $database->name,
            '{{DBUSER}}'          => $database->user,
            '{{DBPASS}}'          => $database->pass,
            '{{WWWROOT}}'         => 'http://localhost/moodle',
            '{{DATAROOT}}'        => $dataDir,
            '{{PHPUNITDATAROOT}}' => $dataDir.'/phpu_moodledata',
            '{{BEHATDATAROOT}}'   => $dataDir.'/behat_moodledata',
            '{{BEHATDUMP}}'       => $dataDir.'/behat_dump',
            '{{BEHATWWWROOT}}'    => 'http://localhost:8000',
            '{{EXTRACONFIG}}'     => self::PLACEHOLDER,
        ];

        return str_replace(array_keys($variables), array_values($variables), $template);
    }
public function createContents(AbstractDatabase $database, $dataDir)
    {
        $template  = file_get_contents(__DIR__.'/../../res/template/config.php.txt');
        $variables = [
            '{{DBTYPE}}'          => $database->type,
            '{{DBLIBRARY}}'       => $database->library,
            '{{DBHOST}}'          => $database->host,
            '{{DBNAME}}'          => $database->name,
            '{{DBUSER}}'          => $database->user,
            '{{DBPASS}}'          => $database->pass,
            '{{WWWROOT}}'         => 'http://localhost/moodle',
            '{{DATAROOT}}'        => $dataDir,
            '{{PHPUNITDATAROOT}}' => $dataDir.'/phpu_moodledata',
            '{{BEHATDATAROOT}}'   => $dataDir.'/behat_moodledata',
            '{{BEHATDUMP}}'       => $dataDir.'/behat_dump',
            '{{BEHATWWWROOT}}'    => 'http://localhost:8000',
            '{{EXTRACONFIG}}'     => self::PLACEHOLDER,
        ];

        return str_replace(array_keys($variables), array_values($variables), $template);
    }
public function createContents ( AbstractDatabase $ database , $ dataDir ) { $ template = file_get_contents ( __DIR__ . '/../../res/template/config.php.txt' ) ; $ variables = [ '{{DBTYPE}}' => $ database -> type , '{{DBLIBRARY}}' => $ database -> library , '{{DBHOST}}' => $ database -> host , '{{DBNAME}}' => $ database -> name , '{{DBUSER}}' => $ database -> user , '{{DBPASS}}' => $ database -> pass , '{{WWWROOT}}' => 'http://localhost/moodle' , '{{DATAROOT}}' => $ dataDir , '{{PHPUNITDATAROOT}}' => $ dataDir . '/phpu_moodledata' , '{{BEHATDATAROOT}}' => $ dataDir . '/behat_moodledata' , '{{BEHATDUMP}}' => $ dataDir . '/behat_dump' , '{{BEHATWWWROOT}}' => 'http://localhost:8000' , '{{EXTRACONFIG}}' => self :: PLACEHOLDER , ] ; return str_replace ( array_keys ( $ variables ) , array_values ( $ variables ) , $ template ) ; }
Create a Moodle config.

@param AbstractDatabase $database
@param string           $dataDir  Absolute path to data directory

@return string
Create a Moodle config .