[ Index ]
 

Code source de Serendipity 1.2

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/bundled-libs/Text/Wiki/ -> Parse.php (sommaire)

(pas de description)

Poids: 253 lignes (6 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Text_Wiki_Parse:: (5 méthodes):
  Text_Wiki_Parse()
  parse()
  process()
  getConf()
  getAttrs()


Classe: Text_Wiki_Parse  - X-Ref

Baseline rule class for extension into a "real" parser component.

Text_Wiki_Rule classes do not stand on their own; they are called by a
Text_Wiki object, typcially in the transform()method. Each rule class
performs three main activities: parse, process, and render.

The parse() method takes a regex and applies it to the whole block of
source text at one time. Each match is sent as $matches to the
process() method.

The process() method acts on the matched text from the source, and
then processes the source text is some way.  This may mean the
creation of a delimited token using addToken().  In every case, the
process() method returns the text that should replace the matched text
from parse().

Text_Wiki_Parse(&$obj)   X-Ref
Constructor for this parser rule.

param: object &$obj The calling "parent" Text_Wiki object.

parse()   X-Ref
Abstrct method to parse source text for matches.

Applies the rule's regular expression to the source text, passes
every match to the process() method, and replaces the matched text
with the results of the processing.


process(&$matches)   X-Ref
Abstract method to generate replacements for matched text.

param: array $matches An array of matches from the parse() method
return: string The processed text replacement; defaults to the

getConf($key, $default = null)   X-Ref
Simple method to safely get configuration key values.

param: string $key The configuration key.
param: mixed $default If the key does not exist, return this value
return: mixed The configuration key value (if it exists) or the

getAttrs($text)   X-Ref
Extract 'attribute="value"' portions of wiki markup.

This kind of markup is typically used only in macros, but is useful
anywhere.

The syntax is pretty strict; there can be no spaces between the
option name, the equals, and the first double-quote; the value
must be surrounded by double-quotes.  You can escape characters in
the value with a backslash, and the backslash will be stripped for
you.

param: string $text The "attributes" portion of markup.
return: array An associative array of key-value pairs where the



Généré le : Sat Nov 24 09:00:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics