Options class. More...
Public Member Functions | |
__get ($name) | |
__set ($name, $value) | |
LuminousOptions ($opts=null) | |
set ($nameOrArray, $value=null) |
Private Member Functions | |
set_bool ($key, $value) | |
set_format ($value) | |
set_height ($value) | |
set_start_line ($value) | |
set_string ($key, $value, $nullable=false) | |
set_theme ($value) |
Static Private Member Functions | |
static | check_type ($value, $type, $nullable=false) |
Private Attributes | |
$auto_link = true | |
Hyperlinking. | |
$cache = true | |
Whether to use the built-in cache. | |
$cache_age = 7776000 | |
Maximum age of cache files in seconds. | |
$failure_tag = 'pre' | |
Failure recovery. | |
$format = 'html' | |
Output format. | |
$highlight_lines = array() | |
Highlighting of lines. | |
$html_strict = false | |
HTML strict standards mode. | |
$include_javascript = false | |
JavaScript extras. | |
$include_jquery = false | |
jQuery | |
$line_numbers = true | |
Line numbering. | |
$max_height = -1 | |
Widget height constraint. | |
$relative_root = null | |
Location of Luminous relative to your document root. | |
$sql_function = null | |
Defines an SQL function which can execute queries on a database. | |
$start_line = 1 | |
Line number of first line. | |
$theme = 'luminous_light.css' | |
Theme. | |
$verbose = true | |
$wrap_width = -1 | |
Word wrapping. |
Options class.
We use a fair bit of PHP trickery in the implementation here. The keener among you will notice that the options are all private: don't worry about that. We override the __set() method to apply option specific validation. Options can be written to as normal.
The option variable names correspond with option strings that can be passed through luminous::set(), however, for historical reasons, underscores can be replaced with dashed in the call.
|
private |
Hyperlinking.
If the formatter supports hyper-linking, this setting controls whether or not URLs will be automatically linked
|
private |
Maximum age of cache files in seconds.
Cache files which have not been read for this length of time will be removed from the file system. The file's 'mtime' is used to calculate when it was last used, and a cache hit triggers a 'touch'
Set to -1 or 0 to disable cache purges
|
private |
Failure recovery.
If Luminous hits some kind of unrecoverable internal error, it should return the input source code back to you. If you want, it can be wrapped in an HTML tag. Hopefully you will never see this.
|
private |
Output format.
Chooses which output format to use. Current valid settings are:
NULL
- No formatter. Internal XML format is returned. You probably don't want this.
|
private |
Highlighting of lines.
If the formatter supports highlighting lines, this setting allows the caller to specify the set of line numbers to highlight
|
private |
HTML strict standards mode.
The HTML4-strict doctype disallows a few things which are technically useful. Set this to true if you don't want Luminous to break validation on your HTML4-strict document. Luminous should be valid HTML4 loose/transitional and HTML5 without needing to enable this.
|
private |
JavaScript extras.
controls whether luminous::head_html() outputs the javascript 'extras'.
|
private |
jQuery
Controls whether luminous::head_html() outputs jQuery, which is required for the JavaScript extras. This has no effect if $include_javascript is false.
|
private |
Line numbering.
If the formatter supports line numbering, this setting controls whether or not lines should be numbered
|
private |
Widget height constraint.
If the formatter supports heigh constraint, this setting controls whether or not to constrain the widget's height, and to what.
|
private |
Location of Luminous relative to your document root.
If you use luminous::head_html(), it has to try to figure out the path to the style/ directory so that it can return a correct URL to the necessary stylesheets. Luminous may get this wrong in some situations, specifically it is currently impossible to get this right if Luminous exists on the filesystem outside of the document root, and you have used a symbolic link to put it inside. For this reason, this setting allows you to override the path.
e.g. If you set this to '/extern/highlighter', the stylesheets will be linked with <link rel='stylesheet' href='/extern/highlighter/style/luminous.css'>
|
private |
Defines an SQL function which can execute queries on a database.
An SQL database can be used as a replacement for the file-system cache database. This function should act similarly to the mysql_query function: it should take a single argument (the query string) and return:
false
if the query fails true
if the query succeeds but has no return value
|
private |
Line number of first line.
If the formatter supports line numbering, this setting controls number of the first line
|
private |
Theme.
The default theme to use. This is observed by the HTML-full and LaTeX formatters, it is also read by luminous::head_html().
This should be a valid theme which exists in style/
|
private |
Word wrapping.
If the formatter supports line wrapping, lines will be wrapped at this number of characters (0 or -1 to disable)