classes/phing/system/util/Properties.php
public function store(PhingFile $file = null, $header = null)
    {
        if ($file == null) {
            $file = $this->file;
        }

        if ($file == null) {
            throw new IOException("Unable to write to empty filename");
        }

        // stores the properties in this object in the file denoted
        // if file is not given and the properties were loaded from a
        // file prior, this method stores them in the file used by load()
        try {
            $fw = new FileWriter($file);
            if ($header !== null) {
                $fw->write("# " . $header . PHP_EOL);
            }
            $fw->write((string) $this);
            $fw->close();
        } catch (IOException $e) {
            throw new IOException("Error writing property file: " . $e->getMessage());
        }
    }
public function store(PhingFile $file = null, $header = null)
    {
        if ($file == null) {
            $file = $this->file;
        }

        if ($file == null) {
            throw new IOException("Unable to write to empty filename");
        }

        // stores the properties in this object in the file denoted
        // if file is not given and the properties were loaded from a
        // file prior, this method stores them in the file used by load()
        try {
            $fw = new FileWriter($file);
            if ($header !== null) {
                $fw->write("# " . $header . PHP_EOL);
            }
            $fw->write((string) $this);
            $fw->close();
        } catch (IOException $e) {
            throw new IOException("Error writing property file: " . $e->getMessage());
        }
    }
public function store ( PhingFile $ file = null , $ header = null ) { if ( $ file == null ) { $ file = $ this -> file ; } if ( $ file == null ) { throw new IOException ( "Unable to write to empty filename" ) ; } // stores the properties in this object in the file denoted // if file is not given and the properties were loaded from a // file prior, this method stores them in the file used by load() try { $ fw = new FileWriter ( $ file ) ; if ( $ header !== null ) { $ fw -> write ( "# " . $ header . PHP_EOL ) ; } $ fw -> write ( ( string ) $ this ) ; $ fw -> close ( ) ; } catch ( IOException $ e ) { throw new IOException ( "Error writing property file: " . $ e -> getMessage ( ) ) ; } }
Stores current properties to specified file.

@param  PhingFile $file File to create/overwrite with properties.
@param  string $header Header text that will be placed (within comments) at the top of properties file.
@return void
@throws IOException - on error writing properties file.
Stores current properties to specified file .