phing-filters
[ class tree: phing-filters ] [ index: phing-filters ] [ all elements ]

Class: StripPhpComments

Source Location: /filters/StripPhpComments.php

Class Overview

Reader
   |
   --FilterReader
      |
      --BaseFilterReader
         |
         --StripPhpComments

This is a Php comment and string stripper reader that filters those lexical tokens out for purposes of simple Php parsing.


Author(s):

Version:

  • $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $

Implements interfaces:

Methods


Inherited Variables

Inherited Methods

Class: BaseFilterReader

BaseFilterReader::__construct()
Constructor used by Phing's introspection mechanism.
BaseFilterReader::eof()
Returns whether the end of file has been reached with input stream.
BaseFilterReader::getInitialized()
Returns the initialized status.
BaseFilterReader::getProject()
Returns the project this filter is part of.
BaseFilterReader::log()
Convenience method to support logging in filters.
BaseFilterReader::read()
Reads characters.
BaseFilterReader::readLine()
Reads a line of text ending with '\n' (or until the end of the stream).
BaseFilterReader::setInitialized()
Sets the initialized status.
BaseFilterReader::setProject()
Sets the project to work with.

Class: FilterReader

FilterReader::__construct()
FilterReader::close()
FilterReader::getResource()
FilterReader::read()
Read data from source.
FilterReader::reset()
FilterReader::setReader()
FilterReader::skip()

Class: Reader

Reader::close()
Close stream.
Reader::getResource()
Returns the filename, url, etc. that is being read from.
Reader::mark()
If supported, places a "marker" (like a bookmark) at current stream position.
Reader::markSupported()
Whether marking is supported.
Reader::read()
Read data from source.
Reader::ready()
Is stream ready for reading.
Reader::reset()
Reset the current position in stream to beginning or last mark (if supported).
Reader::skip()
Move stream position relative to current pos.

Class Details

[line 40]
This is a Php comment and string stripper reader that filters those lexical tokens out for purposes of simple Php parsing.

(if you have more complex Php parsing needs, use a real lexer). Since this class heavily relies on the single char read function, you are reccomended to make it work on top of a buffered reader.




Tags:

author:  <href="mailto:yl@seasonfive.com" a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
author:  hans lellelid, hans@velum.net
version:  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $
see:  FilterReader
access:  public


[ Top ]


Class Methods


method chain [line 182]

a chain( $reader)

Creates a new StripPhpComments using the passed in Reader for instantiation.



Tags:

return:  new filter based on this configuration, but filtering the specified reader



Implementation of:
ChainableReader::chain()
Returns a reader with the same configuration as this one, but filtering input from the specified reader.

Parameters:

reader   $reader   A Reader object providing the underlying stream. Must not be
  1. null
.

[ Top ]

method read [line 63]

the read( [ $len = null])

Returns the stream without Php comments.



Tags:

return:  resulting stream, or -1 if the end of the resulting stream has been reached
throws:  IOException if the underlying stream throws an IOException during reading


Overrides BaseFilterReader::read() (Reads characters.)

Parameters:

   $len  

[ Top ]

method readChar [line 129]

void readChar( )



[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:52:05 +0200 by phpDocumentor 1.4.3