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