Location: PHPKode > projects > Content*Builder > cb_pear/Text/Highlighter/PHP.php
<?php
/**
 * Auto-generated class. PHP syntax highlighting
 * @package Text_Highlighter
 *
 * @author Andrey Demenev <hide@address.com>
 */

/**
 * @ignore
 */

require_once 'Text/Highlighter.php';

/**
 * Auto-generated class. PHP syntax highlighting
 * @package Text_Highlighter
 *
 * @author Andrey Demenev <hide@address.com>
 */
class  Text_Highlighter_PHP extends Text_Highlighter
{    /**
     * PHP4 Compatible Constructor
     *
     * @param array  $options
     * @access public
     */
    function Text_Highlighter_PHP($options=array())
    {
        $this->__construct($options);
    }


    /**
     *  Constructor
     *
     * @param array  $options
     * @access public
     */
    function __construct($options=array())
    {
        $this->_syntax = array (
            'regions' => 
            array (
                'phpCode' => 
                array (
                    'name' => 'phpCode',
                    'case' => false,
                    'innerColor' => 'code',
                    'delimColor' => 'inlinetags',
                    'start' => '/\\<\\?(php|=)?/i',
                    'end' => '/\\?\\>/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'regions' => 
                        array (
                            0 => 'block',
                            1 => 'brackets',
                            2 => 'sqbrackets',
                            3 => 'mlcomment',
                            4 => 'strdouble',
                            5 => 'exec',
                            6 => 'heredoc',
                            7 => 'strsingle',
                            8 => 'comment',
                        ),
                        'blocks' => 
                        array (
                            0 => 'identifier',
                            1 => 'typecast',
                            2 => 'var',
                            3 => 'integer',
                            4 => 'hexinteger',
                            5 => 'octinteger',
                            6 => 'float',
                            7 => 'exponent',
                        ),
                    ),
                ),
                'block' => 
                array (
                    'name' => 'block',
                    'case' => false,
                    'innerColor' => 'code',
                    'delimColor' => 'brackets',
                    'start' => '/\\{/i',
                    'end' => '/\\}/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'regions' => 
                        array (
                            0 => 'block',
                            1 => 'brackets',
                            2 => 'sqbrackets',
                            3 => 'mlcomment',
                            4 => 'strdouble',
                            5 => 'exec',
                            6 => 'heredoc',
                            7 => 'strsingle',
                            8 => 'comment',
                            9 => 'codeescape',
                        ),
                        'blocks' => 
                        array (
                            0 => 'identifier',
                            1 => 'typecast',
                            2 => 'var',
                            3 => 'integer',
                            4 => 'hexinteger',
                            5 => 'octinteger',
                            6 => 'float',
                            7 => 'exponent',
                        ),
                    ),
                ),
                'brackets' => 
                array (
                    'name' => 'brackets',
                    'case' => false,
                    'innerColor' => 'code',
                    'delimColor' => 'brackets',
                    'start' => '/\\(/i',
                    'end' => '/\\)/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'regions' => 
                        array (
                            0 => 'block',
                            1 => 'brackets',
                            2 => 'sqbrackets',
                            3 => 'mlcomment',
                            4 => 'strdouble',
                            5 => 'exec',
                            6 => 'heredoc',
                            7 => 'strsingle',
                            8 => 'comment',
                        ),
                        'blocks' => 
                        array (
                            0 => 'identifier',
                            1 => 'typecast',
                            2 => 'var',
                            3 => 'integer',
                            4 => 'hexinteger',
                            5 => 'octinteger',
                            6 => 'float',
                            7 => 'exponent',
                        ),
                    ),
                ),
                'sqbrackets' => 
                array (
                    'name' => 'sqbrackets',
                    'case' => false,
                    'innerColor' => 'code',
                    'delimColor' => 'brackets',
                    'start' => '/\\[/i',
                    'end' => '/\\]/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'regions' => 
                        array (
                            0 => 'block',
                            1 => 'brackets',
                            2 => 'sqbrackets',
                            3 => 'mlcomment',
                            4 => 'strdouble',
                            5 => 'exec',
                            6 => 'heredoc',
                            7 => 'strsingle',
                            8 => 'comment',
                        ),
                        'blocks' => 
                        array (
                            0 => 'identifier',
                            1 => 'typecast',
                            2 => 'var',
                            3 => 'integer',
                            4 => 'hexinteger',
                            5 => 'octinteger',
                            6 => 'float',
                            7 => 'exponent',
                        ),
                    ),
                ),
                'mlcomment' => 
                array (
                    'name' => 'mlcomment',
                    'case' => false,
                    'innerColor' => 'comment',
                    'delimColor' => 'comment',
                    'start' => '/\\/\\*/i',
                    'end' => '/\\*\\//i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'phpdoc',
                            1 => 'url',
                            2 => 'email',
                            3 => 'note',
                            4 => 'cvstag',
                        ),
                    ),
                ),
                'strdouble' => 
                array (
                    'name' => 'strdouble',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/"/i',
                    'end' => '/"/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'descaped',
                            1 => 'curlyvar',
                            2 => 'var',
                        ),
                    ),
                ),
                'exec' => 
                array (
                    'name' => 'exec',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/`/i',
                    'end' => '/`/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'escaped',
                            1 => 'curlyvar',
                            2 => 'var',
                        ),
                    ),
                ),
                'heredoc' => 
                array (
                    'name' => 'heredoc',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/\\<\\<\\<[\\x20\\x09]*(\\w+)$/mi',
                    'end' => '/^%1%;?$/mi',
                    'remember' => true,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'descaped',
                            1 => 'curlyvar',
                            2 => 'var',
                        ),
                    ),
                ),
                'strsingle' => 
                array (
                    'name' => 'strsingle',
                    'case' => false,
                    'innerColor' => 'string',
                    'delimColor' => 'quotes',
                    'start' => '/\'/i',
                    'end' => '/\'/i',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'escaped',
                        ),
                    ),
                ),
                'comment' => 
                array (
                    'name' => 'comment',
                    'case' => false,
                    'innerColor' => 'comment',
                    'delimColor' => 'comment',
                    'start' => '/(#|\\/\\/)/i',
                    'end' => '/$/mi',
                    'remember' => false,
                    'lookfor' => 
                    array (
                        'blocks' => 
                        array (
                            0 => 'phpdoc',
                            1 => 'url',
                            2 => 'email',
                            3 => 'note',
                            4 => 'cvstag',
                        ),
                    ),
                ),
                'codeescape' => 
                array (
                    'name' => 'codeescape',
                    'case' => false,
                    'innerColor' => 'default',
                    'delimColor' => 'inlinetags',
                    'start' => '/\\?\\>/i',
                    'end' => '/\\<\\?(php|=)?/i',
                    'remember' => false,
                ),
            ),
            'keywords' => 
            array (
                'constants' => 
                array (
                    'name' => 'constants',
                    'innerColor' => 'reserved',
                    'case' => true,
                    'inherits' => 'identifier',
                    'match' => 
                    array (
                        'DIRECTORY_SEPARATOR' => true,
                        'PATH_SEPARATOR' => true,
                    ),
                ),
                'reserved' => 
                array (
                    'name' => 'reserved',
                    'innerColor' => 'reserved',
                    'case' => false,
                    'inherits' => 'identifier',
                    'match' => 
                    array (
                        'echo' => true,
                        'foreach' => true,
                        'else' => true,
                        'if' => true,
                        'elseif' => true,
                        'for' => true,
                        'as' => true,
                        'while' => true,
                        'break' => true,
                        'continue' => true,
                        'class' => true,
                        'const' => true,
                        'declare' => true,
                        'switch' => true,
                        'case' => true,
                        'endfor' => true,
                        'endswitch' => true,
                        'endforeach' => true,
                        'endif' => true,
                        'array' => true,
                        'default' => true,
                        'do' => true,
                        'enddeclare' => true,
                        'eval' => true,
                        'exit' => true,
                        'die' => true,
                        'extends' => true,
                        'function' => true,
                        'global' => true,
                        'include' => true,
                        'include_once' => true,
                        'require' => true,
                        'require_once' => true,
                        'isset' => true,
                        'empty' => true,
                        'list' => true,
                        'new' => true,
                        'static' => true,
                        'unset' => true,
                        'var' => true,
                        'return' => true,
                        'try' => true,
                        'catch' => true,
                        'final' => true,
                        'throw' => true,
                        'public' => true,
                        'private' => true,
                        'protected' => true,
                        'abstract' => true,
                        'interface' => true,
                        'implements' => true,
                        'define' => true,
                        '__file__' => true,
                        '__line__' => true,
                        '__class__' => true,
                        '__method__' => true,
                        '__function__' => true,
                        'null' => true,
                        'true' => true,
                        'false' => true,
                        'and' => true,
                        'or' => true,
                        'xor' => true,
                    ),
                ),
            ),
            'blocks' => 
            array (
                'escaped' => 
                array (
                    'name' => 'escaped',
                    'case' => false,
                    'innerColor' => 'special',
                    'match' => '/\\\\\\\\|\\\\"|\\\\\'|\\\\`/i',
                    'multiline' => false,
                ),
                'descaped' => 
                array (
                    'name' => 'descaped',
                    'case' => false,
                    'innerColor' => 'special',
                    'match' => '/\\\\[\\\\"\'`tnr\\$\\{]/i',
                    'multiline' => false,
                ),
                'identifier' => 
                array (
                    'name' => 'identifier',
                    'case' => false,
                    'innerColor' => 'identifier',
                    'match' => '/[a-z_]\\w*/i',
                    'multiline' => false,
                ),
                'typecast' => 
                array (
                    'name' => 'typecast',
                    'case' => false,
                    'innerColor' => 'reserved',
                    'match' => '/\\((array|int|integer|string|bool|boolean|object|float|double)\\)/i',
                    'multiline' => false,
                ),
                'curlyvar' => 
                array (
                    'name' => 'curlyvar',
                    'case' => false,
                    'innerColor' => 'var',
                    'match' => '/\\{\\$[a-z_].*\\}/i',
                    'multiline' => false,
                ),
                'var' => 
                array (
                    'name' => 'var',
                    'case' => false,
                    'innerColor' => 'var',
                    'match' => '/\\$[a-z_]\\w*/i',
                    'multiline' => false,
                ),
                'integer' => 
                array (
                    'name' => 'integer',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/\\d\\d*|\\b0\\b/i',
                    'multiline' => false,
                ),
                'hexinteger' => 
                array (
                    'name' => 'hexinteger',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/0[xX][\\da-f]+/i',
                    'multiline' => false,
                ),
                'octinteger' => 
                array (
                    'name' => 'octinteger',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/0[0-7]+/i',
                    'multiline' => false,
                ),
                'float' => 
                array (
                    'name' => 'float',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/(\\d*\\.\\d+)|(\\d+\\.\\d*)/i',
                    'multiline' => false,
                ),
                'exponent' => 
                array (
                    'name' => 'exponent',
                    'case' => false,
                    'innerColor' => 'number',
                    'match' => '/((\\d+|((\\d*\\.\\d+)|(\\d+\\.\\d*)))[eE][+-]?\\d+)/i',
                    'multiline' => false,
                ),
                'phpdoc' => 
                array (
                    'name' => 'phpdoc',
                    'case' => false,
                    'innerColor' => 'inlinedoc',
                    'match' => '/\\s@\\w+\\s/i',
                    'multiline' => false,
                ),
                'url' => 
                array (
                    'name' => 'url',
                    'case' => false,
                    'innerColor' => 'url',
                    'match' => '/((https?|ftp):\\/\\/[\\w\\?\\.\\-\\&=\\/]+([^\\w\\?\\.\\&=\\/]|$))|(^|[\\s,!?])www\\.\\w+\\.\\w+[\\w\\?\\.\\&=\\/]*([^\\w\\?\\.\\&=\\/]|$)/mi',
                    'multiline' => false,
                ),
                'email' => 
                array (
                    'name' => 'email',
                    'case' => false,
                    'innerColor' => 'url',
                    'match' => '/\\w+[\\.\\w\\-]+@(\\w+[\\.\\w\\-])+/i',
                    'multiline' => false,
                ),
                'note' => 
                array (
                    'name' => 'note',
                    'case' => false,
                    'innerColor' => 'inlinedoc',
                    'match' => '/\\bnote:/i',
                    'multiline' => false,
                ),
                'cvstag' => 
                array (
                    'name' => 'cvstag',
                    'case' => false,
                    'innerColor' => 'inlinedoc',
                    'match' => '/\\$\\w+:.+\\$/i',
                    'multiline' => false,
                ),
            ),
            'toplevel' => 
            array (
                'regions' => 
                array (
                    0 => 'phpCode',
                ),
            ),
            'case' => false,
            'defcolor' => 'code',
        );

        parent::_init($options);
    }
}

?>
Return current item: Content*Builder