public static function toFile(Stringset $set, $filename)
    {
        try {
            $str = self::toString($set, $options);
            if (!file_exists($filename) || is_writable($filename)) {
                file_put_contents($filename, $str);
            } else {
                throw new Exception("Cannot write to file");
            }
        } catch (\Exception $e) {
            throw $e;
        }
    }
public static function toFile(Stringset $set, $filename)
    {
        try {
            $str = self::toString($set, $options);
            if (!file_exists($filename) || is_writable($filename)) {
                file_put_contents($filename, $str);
            } else {
                throw new Exception("Cannot write to file");
            }
        } catch (\Exception $e) {
            throw $e;
        }
    }
public static function toFile ( Stringset $ set , $ filename ) { try { $ str = self :: toString ( $ set , $ options ) ; if ( ! file_exists ( $ filename ) || is_writable ( $ filename ) ) { file_put_contents ( $ filename , $ str ) ; } else { throw new Exception ( "Cannot write to file" ) ; } } catch ( \ Exception $ e ) { throw $ e ; } }
Takes a Stringset and a filename and writes a po formatted file.
@param Stringset $set
@param string $filename
@return void
Takes a Stringset and a filename and writes a po formatted file .