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

Class: ReplaceTokensWithFile

Source Location: /filters/ReplaceTokensWithFile.php

Class Overview

Reader
   |
   --FilterReader
      |
      --BaseFilterReader
         |
         --BaseParamFilterReader
            |
            --ReplaceTokensWithFile

Base class for core filter readers.


Author(s):

Version:

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

Copyright:

  • © 2003 seasonfive. All rights reserved

Implements interfaces:

Constants

Methods


Inherited Variables

Inherited Methods

Class: BaseParamFilterReader

BaseParamFilterReader::getParameters()
BaseParamFilterReader::setParameters()

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 56]
Base class for core filter readers.



Tags:

author:  <href="mailto:yl@seasonfive.com" a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
version:  $Revision: 526 $ $Date: 2009-08-11 14:11:17 +0200 (Tue, 11 Aug 2009) $
copyright:  © 2003 seasonfive. All rights reserved


[ Top ]


Class Methods


method chain [line 277]

object A chain( $reader)

Creates a new ReplaceTokensWithFile 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:

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

[ Top ]

method getBeginToken [line 175]

string getBeginToken( )

Returns the "begin token" character.



Tags:

return:  The character used to denote the beginning of a token.


[ Top ]

method getEndToken [line 193]

the getEndToken( )

Returns the "end token" character.



Tags:

return:  character used to denote the beginning of a token


[ Top ]

method read [line 246]

mixed read( [ $len = null])

Returns stream with tokens having been replaced with appropriate values.

If a replacement value is not found for a token, the token is left in the stream.




Tags:

return:  filtered stream, -1 on EOF.


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

Parameters:

   $len  

[ Top ]

method setBeginToken [line 166]

void setBeginToken( string $beginToken)

Sets the "begin token" character.



Parameters:

string   $beginToken   the character used to denote the beginning of a token.

[ Top ]

method setDir [line 135]

void setDir( string $dir)

Sets the drectory where to look for the files to use for token replacement



Parameters:

string   $dir  

[ Top ]

method setEndToken [line 184]

void setEndToken( string $endToken)

Sets the "end token" character.



Parameters:

string   $endToken   the character used to denote the end of a token

[ Top ]

method setPostfix [line 157]

void setPostfix( string $postfix)

Sets the postfix that is added to the token in order to create the file name. For example if the token is 01 and the postfix is ".php" then the filename to look for will be "01.php"



Parameters:

string   $postfix  

[ Top ]

method setPrefix [line 146]

void setPrefix( string $prefix)

Sets the prefix that is prepended to the token in order to create the file name. For example if the token is 01 and the prefix is "example" then the filename to look for will be "example01"



Parameters:

string   $prefix  

[ Top ]

method setTranslateHTML [line 126]

void setTranslateHTML( $translate, string $dir)

Sets the drectory where to look for the files to use for token replacement



Parameters:

string   $dir  
   $translate  

[ Top ]


Class Constants

DEFAULT_BEGIN_TOKEN =  "#@#"

[line 62]

Default "begin token" character.


[ Top ]

DEFAULT_END_TOKEN =  "#@#"

[line 68]

Default "end token" character.


[ Top ]



Documentation generated on Mon, 19 Oct 2009 10:51:55 +0200 by phpDocumentor 1.4.3