home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Text / Wiki / Parse / Default / Phplookup.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.4 KB  |  73 lines

  1. <?php
  2.  
  3. /**
  4. * Find source text marked for lookup in the PHP online manual.
  5. * @category Text
  6. * @package Text_Wiki
  7. * @author Paul M. Jones <pmjones@php.net>
  8. * @license LGPL
  9. * @version $Id: Phplookup.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
  10. */
  11.  
  12. /**
  13. * Find source text marked for lookup in the PHP online manual.
  14. *
  15. * @category Text
  16. * @package Text_Wiki
  17. * @author Paul M. Jones <pmjones@php.net>
  18. */
  19.  
  20. class Text_Wiki_Parse_Phplookup extends Text_Wiki_Parse {
  21.     
  22.     
  23.     /**
  24.     * 
  25.     * The regular expression used to parse the source text and find
  26.     * matches conforming to this rule.  Used by the parse() method.
  27.     * 
  28.     * @access public
  29.     * 
  30.     * @var string
  31.     * 
  32.     * @see parse()
  33.     * 
  34.     */
  35.     
  36.     var $regex = "/\[\[php (.+?)\]\]/";
  37.     
  38.     
  39.     /**
  40.     * 
  41.     * Generates a replacement for the matched text.  Token options are:
  42.     * 
  43.     * 'type' => ['start'|'end'] The starting or ending point of the
  44.     * teletype text.  The text itself is left in the source.
  45.     * 
  46.     * @access public
  47.     *
  48.     * @param array &$matches The array of matches from parse().
  49.     *
  50.     * @return string A pair of delimited tokens to be used as a
  51.     * placeholder in the source text surrounding the teletype text.
  52.     *
  53.     */
  54.     
  55.     function process(&$matches)
  56.     {
  57.         return $this->wiki->addToken(
  58.             $this->rule, array('text' => $matches[1])
  59.         );
  60.     }
  61. }
  62. ?>