src/Kunstmaan/GeneratorBundle/Helper/GeneratorUtils.php
public static function replace($toReplace, $replaceText, $filename)
    {
        $content = file_get_contents($filename);
        if ($content) {
            $content = str_replace($toReplace, $replaceText, $content);
            file_put_contents($filename, $content);
        }
    }
public static function replace($toReplace, $replaceText, $filename)
    {
        $content = file_get_contents($filename);
        if ($content) {
            $content = str_replace($toReplace, $replaceText, $content);
            file_put_contents($filename, $content);
        }
    }
public static function replace ( $ toReplace , $ replaceText , $ filename ) { $ content = file_get_contents ( $ filename ) ; if ( $ content ) { $ content = str_replace ( $ toReplace , $ replaceText , $ content ) ; file_put_contents ( $ filename , $ content ) ; } }
Find and replace the string in the file

@param string $toReplace   Text to be replaced
@param string $replaceText Text as replacement
@param string $filename    File to replace in
Find and replace the string in the file