Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • Text_Highlighter
  • Text_Highlighter_ABAP
  • Text_Highlighter_CPP
  • Text_Highlighter_CSS
  • Text_Highlighter_DIFF
  • Text_Highlighter_DTD
  • Text_Highlighter_Generator
  • Text_Highlighter_HTML
  • Text_Highlighter_JAVA
  • Text_Highlighter_JAVASCRIPT
  • Text_Highlighter_MYSQL
  • Text_Highlighter_PERL
  • Text_Highlighter_PHP
  • Text_Highlighter_PYTHON
  • Text_Highlighter_Renderer
  • Text_Highlighter_Renderer_Array
  • Text_Highlighter_Renderer_BB
  • Text_Highlighter_Renderer_Console
  • Text_Highlighter_Renderer_Html
  • Text_Highlighter_Renderer_HtmlTags
  • Text_Highlighter_Renderer_JSON
  • Text_Highlighter_Renderer_XML
  • Text_Highlighter_RUBY
  • Text_Highlighter_SH
  • Text_Highlighter_SQL
  • Text_Highlighter_VBSCRIPT
  • Text_Highlighter_XML
  • Overview
  • Package
  • Class
  • Tree

Class Text_Highlighter

Text highlighter base class

This class implements all functions necessary for highlighting, but it does not contain highlighting rules. Actual highlighting is done using a descendent of this class.

One is not supposed to manually create descendent classes. Instead, describe highlighting rules in XML format and use Text_Highlighter_Generator to create descendent class. Alternatively, an instance of a descendent class can be created directly.

Use Text_Highlighter::factory() to create an object for particular language highlighter

Usage example

require_once 'Text/Highlighter.php';
$hlSQL =& Text_Highlighter::factory('SQL',array('numbers'=>true));
echo $hlSQL->highlight('SELECT * FROM table a WHERE id = 12');

Direct known subclasses

Text_Highlighter_ABAP, Text_Highlighter_CPP, Text_Highlighter_PHP, Text_Highlighter_PYTHON, Text_Highlighter_RUBY, Text_Highlighter_SH, Text_Highlighter_SQL, Text_Highlighter_VBSCRIPT, Text_Highlighter_XML, Text_Highlighter_CSS, Text_Highlighter_DIFF, Text_Highlighter_DTD, Text_Highlighter_HTML, Text_Highlighter_JAVA, Text_Highlighter_JAVASCRIPT, Text_Highlighter_MYSQL, Text_Highlighter_PERL
Package: Text\Highlighter
Copyright: 2004-2006 Andrey Demenev
License: PHP License
Author: Andrey Demenev <demenev@gmail.com>
Located at x2engine/framework/vendors/TextHighlighter/Text/Highlighter.php
Methods summary
public
# _checkDefines( )

Called by subclssses' constructors to enable/disable optional highlighter rules

Called by subclssses' constructors to enable/disable optional highlighter rules

public static mixed
# factory( string $lang, array $options = array() )

Create a new Highlighter object for specified language

Create a new Highlighter object for specified language

Parameters

$lang
string
$lang language, for example "SQL"
$options
array
$options Rendering options. This parameter is only keeped for BC reasons, use Text_Highlighter::setRenderer() instead

Returns

mixed
a newly created Highlighter object, or a PEAR error object on error
public
# setRenderer( object $renderer )

Set renderer object

Set renderer object

Parameters

$renderer
object
$renderer Text_Highlighter_Renderer
public
# _matchingBrackets( mixed $str )

Helper function to find matching brackets

Helper function to find matching brackets

public
# _getToken( )
public string
# highlight( string $str )

Highlights code

Highlights code

Parameters

$str
string
$str Code to highlight

Returns

string
Highlighted text
Properties summary
public array $_syntax
#

Syntax highlighting rules. Auto-generated classes set this var

Syntax highlighting rules. Auto-generated classes set this var

See

_init
public array $_renderer
#

Renderer object.

Renderer object.

public array $_options array()
#

Options. Keeped for BC

Options. Keeped for BC

public array $_conditions array()
#

Conditionds

Conditionds

public array $_disabled array()
#

Disabled keywords

Disabled keywords

public string $_language ''
#

Language

Language

API documentation generated by ApiGen 2.8.0