Sven\FlexEnv\Env::replaceInFile PHP Méthode

replaceInFile() public méthode

Replace a part of the .env file.
public replaceInFile ( string $old, string $new, integer $append ) : Env
$old string
$new string
$append integer
Résultat Env
    public function replaceInFile($old, $new, $append = 0)
    {
        $contents = $this->previous;
        $replaceWith = preg_replace("~{$old}\n?~", "{$new}\n", $contents);
        file_put_contents($this->getPath(), $replaceWith, $append);
        return $this;
    }