/plugins/content/geshi/geshi/geshi.php

Description

GeSHi - Generic Syntax Highlighter

The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation at http://qbnz.com/highlighter/documentation.php for more information about how to use this class.

For changes, release notes, TODOs etc, see the relevant files in the docs/ directory.

This file is part of GeSHi.

GeSHi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

GeSHi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GeSHi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  • author: Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
  • copyright: (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
  • license: GNU GPL
Classes
Class Description
GeSHi The GeSHi Class.
Constants
GESHI_ACTIVE = 2 (line 110)

Links in the source in the :active state

GESHI_AFTER = 4 (line 147)

The key of the regex array defining what bracket group in a

  • access: private
GESHI_ALWAYS = 2 (line 132)

Strict mode always applies

  • access: private
GESHI_BEFORE = 3 (line 144)

The key of the regex array defining what bracket group in a

  • access: private
GESHI_CAPS_LOWER = 2 (line 102)

Leave keywords found as the case that they are

GESHI_CAPS_NO_CHANGE = 0 (line 98)

Lowercase keywords found

GESHI_CAPS_UPPER = 1 (line 100)

Uppercase keywords found

GESHI_CLASS = 5 (line 150)

The key of the regex array defining a custom keyword to use

  • access: private
GESHI_COMMENTS = 0 (line 153)

Used in language files to mark comments

  • access: private
GESHI_END_IMPORTANT = '<END GeSHi>' (line 120)

The ender for important parts of the source

GESHI_ERROR_FILE_NOT_READABLE = 3 (line 243)

GeSHi could not open a file for reading (generally a language file)

  • access: private
GESHI_ERROR_INVALID_HEADER_TYPE = 4 (line 245)

The header type passed to GeSHi->set_header_type() was invalid

  • access: private
GESHI_ERROR_INVALID_LINE_NUMBER_TYPE = 5 (line 247)

The line number type passed to GeSHi->enable_line_numbers() was invalid

  • access: private
GESHI_ERROR_NO_INPUT = 1 (line 239)

No sourcecode to highlight was specified

  • deprecated:
  • access: private
GESHI_ERROR_NO_SUCH_LANG = 2 (line 241)

The language specified does not exist

  • access: private
GESHI_FANCY_LINE_NUMBERS = 2 (line 70)

Use fancy line numbers when building the result

GESHI_HEADER_DIV = 1 (line 76)

Use a "div" to surround the source

GESHI_HEADER_NONE = 0 (line 74)

Use nothing to surround the source

GESHI_HEADER_PRE = 2 (line 78)

Use a "pre" to surround the source

GESHI_HEADER_PRE_TABLE = 4 (line 94)

Use a "table" to surround the source:

<table> <thead><tr><td colspan="2">$header</td></tr></thead> <tbody><tr><td>

$linenumbers
</td><td>
$code>
</td></tr></tbody> <tfooter><tr><td colspan="2">$footer</td></tr></tfoot> </table>

this is essentially only a workaround for Firefox, see sf#1651996 or take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=365805

GESHI_HEADER_PRE_VALID = 3 (line 80)

Use a pre to wrap lines when line numbers are enabled or to wrap the whole code.

GESHI_HOVER = 1 (line 108)

Links in the source in the :hover state

GESHI_LANG_ROOT = GESHI_ROOT.'geshi'.DIRECTORY_SEPARATOR (line 56)

The language file directory for GeSHi

GESHI_LINK = 0 (line 106)

Links in the source in the :link state

GESHI_MAX_PCRE_LENGTH = 12288 (line 198)

it's also important not to generate too long regular expressions

  • access: private
GESHI_MAX_PCRE_SUBPATTERNS = 500 (line 192)

some old PHP / PCRE subpatterns only support up to xxx subpatterns in

  • access: private
GESHI_MAYBE = 1 (line 130)

Strict mode *might* apply, and can be enabled or

  • access: private
GESHI_MODIFIERS = 2 (line 141)

The key of the regex array defining any modifiers to the regular expression

  • access: private
GESHI_NEVER = 0 (line 127)

Strict mode never applies (this is the most common)

  • access: private
GESHI_NORMAL_LINE_NUMBERS = 1 (line 68)

Use normal line numbers when building the result

GESHI_NO_LINE_NUMBERS = 0 (line 66)

Use no line numbers when building the result

GESHI_NUMBER_BIN_PREFIX_0B = 64 (line 210)

Number format to highlight binary numbers with a prefix 0b (C)

  • access: private
GESHI_NUMBER_BIN_PREFIX_PERCENT = 32 (line 208)

Number format to highlight binary numbers with a prefix %

  • access: private
GESHI_NUMBER_BIN_SUFFIX = 16 (line 206)

Number format to highlight binary numbers with a suffix "b"

  • access: private
GESHI_NUMBER_FLT_NONSCI = 65536 (line 226)

Number format to highlight floating-point numbers without support for scientific notation

  • access: private
GESHI_NUMBER_FLT_NONSCI_F = 131072 (line 228)

Number format to highlight floating-point numbers without support for scientific notation

  • access: private
GESHI_NUMBER_FLT_SCI_SHORT = 262144 (line 230)

Number format to highlight floating-point numbers with support for scientific notation (E) and optional leading zero

  • access: private
GESHI_NUMBER_FLT_SCI_ZERO = 524288 (line 232)

Number format to highlight floating-point numbers with support for scientific notation (E) and required leading digit

  • access: private
GESHI_NUMBER_HEX_PREFIX = 4096 (line 220)

Number format to highlight hex numbers with a prefix 0x

  • access: private
GESHI_NUMBER_HEX_PREFIX_DOLLAR = 8192 (line 222)

Number format to highlight hex numbers with a prefix $

  • access: private
GESHI_NUMBER_HEX_SUFFIX = 16384 (line 224)

Number format to highlight hex numbers with a suffix of h

  • access: private
GESHI_NUMBER_INT_BASIC = 1 (line 202)

Basic number format for integers

  • access: private
GESHI_NUMBER_INT_CSTYLE = 2 (line 204)

Enhanced number format for integers like seen in C

  • access: private
GESHI_NUMBER_OCT_PREFIX = 256 (line 212)

Number format to highlight octal numbers with a leading zero

  • access: private
GESHI_NUMBER_OCT_PREFIX_0O = 512 (line 214)

Number format to highlight octal numbers with a prefix 0o (logtalk)

  • access: private
GESHI_NUMBER_OCT_PREFIX_AT = 1024 (line 216)

Number format to highlight octal numbers with a leading @ (Used in HiSofts Devpac series).

  • access: private
GESHI_NUMBER_OCT_SUFFIX = 2048 (line 218)

Number format to highlight octal numbers with a suffix of o

  • access: private
GESHI_PHP_PRE_433 = !(version_compare(PHP_VERSION,'4.3.3')===1) (line 156)

Used to work around missing PHP features *

  • access: private
GESHI_REPLACE = 1 (line 139)

The key of the regex array defining what bracket group in a

  • access: private
GESHI_ROOT = dirname(__FILE__).DIRECTORY_SEPARATOR (line 52)

The root directory for GeSHi

GESHI_SEARCH = 0 (line 136)

The key of the regex array defining what to search for

  • access: private
GESHI_SECURITY_PARANOID = false (line 61)

Tells GeSHi to be paranoid about security settings

GESHI_START_IMPORTANT = '<BEGIN GeSHi>' (line 118)

The starter for important parts of the source

GESHI_VERSION = '1.0.8.10' (line 47)

The version of this GeSHi file

GESHI_VISITED = 3 (line 112)

Links in the source in the :visited state

Functions
geshi_highlight (line 4741)

Easy way to highlight stuff. Behaves just like highlight_string

  • return: The code highlighted (if $return is true)
  • since: 1.0.2
string geshi_highlight (string $string, string $language, [string $path = null], [boolean $return = false])
  • string $string: The code to highlight
  • string $language: The language to highlight the code in
  • string $path: The path to the language files. You can leave this blank if you need as from version 1.0.7 the path should be automatically detected
  • boolean $return: Whether to return the result or to echo

Documentation generated on Mon, 25 Jun 2012 13:55:00 -0500 by phpDocumentor 1.4.4