summaryrefslogtreecommitdiff
path: root/platform/www/inc/Parsing/ParserMode/Php.php
blob: 914648b51ee6e44a7bfea415824cbe1a475eb769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace dokuwiki\Parsing\ParserMode;

class Php extends AbstractMode
{

    /** @inheritdoc */
    public function connectTo($mode)
    {
        $this->Lexer->addEntryPattern('<php>(?=.*</php>)', $mode, 'php');
        $this->Lexer->addEntryPattern('<PHP>(?=.*</PHP>)', $mode, 'phpblock');
    }

    /** @inheritdoc */
    public function postConnect()
    {
        $this->Lexer->addExitPattern('</php>', 'php');
        $this->Lexer->addExitPattern('</PHP>', 'phpblock');
    }

    /** @inheritdoc */
    public function getSort()
    {
        return 180;
    }
}