Text_Wiki
[ class tree: Text_Wiki ] [ index: Text_Wiki ] [ all elements ]

Source for file Address.php

Documentation is available at Address.php

  1. <?php
  2.  
  3. /**
  4.  *
  5.  * Parses for signatures.
  6.  * This class implements a Text_Wiki rule to find sections of the source
  7.  * text that are signatures. A signature is any line starting with exactly
  8.  * two - signs.
  9.  *
  10.  * @category Text
  11.  *
  12.  * @package Text_Wiki
  13.  *
  14.  * @author Michele Tomaiuolo <tomamic@yahoo.it>
  15.  *
  16.  * @license LGPL
  17.  *
  18.  * @version $Id: Address.php 222265 2006-10-23 13:11:27Z mic $
  19.  *
  20.  */
  21.  
  22. class Text_Wiki_Parse_Address extends Text_Wiki_Parse {
  23.  
  24.     /**
  25.      *
  26.      * The regular expression used to find source text matching this
  27.      * rule.
  28.      *
  29.      * @access public
  30.      *
  31.      * @var string 
  32.      *
  33.      */
  34.  
  35.     var $regex = '/^--([^-].*)$/m';
  36.  
  37.     /**
  38.      *
  39.      * Generates a token entry for the matched text. Token options are:
  40.      *
  41.      * 'start' => The starting point of the signature.
  42.      *
  43.      * 'end' => The ending point of the signature.
  44.      *
  45.      * @access public
  46.      *
  47.      * @param array &$matches The array of matches from parse().
  48.      *
  49.      * @return delimited token number to be used as a placeholder in
  50.      *  the source text.
  51.      *
  52.      */
  53.  
  54.     function process(&$matches)
  55.     {
  56.         $start $this->wiki->addToken(
  57.             $this->rulearray('type' => 'start')
  58.         );
  59.  
  60.         $end $this->wiki->addToken(
  61.             $this->rulearray('type' => 'end')
  62.         );
  63.  
  64.         return "\n" $start trim($matches[1]$end;
  65.     }
  66. }
  67. ?>

Documentation generated on Mon, 11 Mar 2019 15:40:30 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.