classes/phing/filters/StripWhitespace.php
public function read($len = null)
    {
        if ($this->processed === true) {
            return -1; // EOF
        }

        // Read XML
        $php = null;
        while (($buffer = $this->in->read($len)) !== -1) {
            $php .= $buffer;
        }

        if ($php === null) { // EOF?

            return -1;
        }

        if (empty($php)) {
            $this->log("PHP file is empty!", Project::MSG_WARN);

            return ''; // return empty string, don't attempt to strip whitespace
        }

        // write buffer to a temporary file, since php_strip_whitespace() needs a filename
        $file = new PhingFile(tempnam(PhingFile::getTempDir(), 'stripwhitespace'));
        file_put_contents($file->getAbsolutePath(), $php);
        $output = php_strip_whitespace($file->getAbsolutePath());
        unlink($file->getAbsolutePath());

        $this->processed = true;

        return $output;
    }
public function read($len = null)
    {
        if ($this->processed === true) {
            return -1; // EOF
        }

        // Read XML
        $php = null;
        while (($buffer = $this->in->read($len)) !== -1) {
            $php .= $buffer;
        }

        if ($php === null) { // EOF?

            return -1;
        }

        if (empty($php)) {
            $this->log("PHP file is empty!", Project::MSG_WARN);

            return ''; // return empty string, don't attempt to strip whitespace
        }

        // write buffer to a temporary file, since php_strip_whitespace() needs a filename
        $file = new PhingFile(tempnam(PhingFile::getTempDir(), 'stripwhitespace'));
        file_put_contents($file->getAbsolutePath(), $php);
        $output = php_strip_whitespace($file->getAbsolutePath());
        unlink($file->getAbsolutePath());

        $this->processed = true;

        return $output;
    }
public function read ( $ len = null ) { if ( $ this -> processed === true ) { return - 1 ; // EOF } // Read XML $ php = null ; while ( ( $ buffer = $ this -> in -> read ( $ len ) ) !== - 1 ) { $ php .= $ buffer ; } if ( $ php === null ) { // EOF? return - 1 ; } if ( empty ( $ php ) ) { $ this -> log ( "PHP file is empty!" , Project :: MSG_WARN ) ; return '' ; // return empty string, don't attempt to strip whitespace } // write buffer to a temporary file, since php_strip_whitespace() needs a filename $ file = new PhingFile ( tempnam ( PhingFile :: getTempDir ( ) , 'stripwhitespace' ) ) ; file_put_contents ( $ file -> getAbsolutePath ( ) , $ php ) ; $ output = php_strip_whitespace ( $ file -> getAbsolutePath ( ) ) ; unlink ( $ file -> getAbsolutePath ( ) ) ; $ this -> processed = true ; return $ output ; }
Returns the  stream without Php comments and whitespace.

@param  null $len
@return int the resulting stream, or -1
if the end of the resulting stream has been reached
Returns the stream without Php comments and whitespace .