PMCORE-3840
This commit is contained in:
committed by
Mauricio Veliz
parent
feba9cd581
commit
0c079ebb7e
@@ -131,5 +131,6 @@ workflow/engine/xmlform/users/users_List.xml
|
||||
workflow/engine/xmlform/users/users_Options.xml
|
||||
workflow/public_html/skins/JSForms.js
|
||||
workflow/public_html/skins/ajax.js
|
||||
thirdparty/tcpdf
|
||||
thirdparty/geshi
|
||||
thirdparty/lime
|
||||
thirdparty/tcpdf
|
||||
124
thirdparty/geshi/contrib/aliased.php
vendored
124
thirdparty/geshi/contrib/aliased.php
vendored
@@ -1,124 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Another GeSHi example script
|
||||
*
|
||||
* Configure your Apache server with 'AcceptPathInfo true' and something like
|
||||
* 'Alias /viewmysource /var/www/geshi/contrib/aliased.php'. Don't forget
|
||||
* to protect this alias as necessary.
|
||||
*
|
||||
* Usage - visit /viewmysource/file.name.ext to see that file with syntax
|
||||
* highlighting, where "viewmysource" is the name of the alias you set up.
|
||||
* You can use this without an alias too, just by visiting
|
||||
* aliased.php/file.name.ext.
|
||||
*
|
||||
* @author Ross Golder <ross@golder.org>
|
||||
* @version $Id: aliased.php 785 2006-07-19 10:09:45Z oracleshinoda $
|
||||
*/
|
||||
|
||||
// Your config here
|
||||
define("SOURCE_ROOT", "/var/www/your/source/root/");
|
||||
|
||||
// Assume you've put geshi in the include_path already
|
||||
require_once("geshi.php");
|
||||
|
||||
// Get path info
|
||||
$path = SOURCE_ROOT.$_SERVER['PATH_INFO'];
|
||||
|
||||
// Check for dickheads trying to use '../' to get to sensitive areas
|
||||
$base_path_len = strlen(SOURCE_ROOT);
|
||||
$real_path = realpath($path);
|
||||
if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) {
|
||||
exit("Stop that.");
|
||||
}
|
||||
|
||||
// Check file exists
|
||||
if(!file_exists($path)) {
|
||||
exit("File not found ($path).");
|
||||
}
|
||||
|
||||
// Gather contents
|
||||
$contents = file_get_contents($path);
|
||||
|
||||
// Prepare GeSHi instance
|
||||
$geshi =& new GeSHi($contents, "PHP");
|
||||
$geshi->set_header_type(GESHI_HEADER_PRE);
|
||||
$geshi->enable_classes();
|
||||
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
|
||||
$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true);
|
||||
$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true);
|
||||
$geshi->set_code_style('color: #000020;', 'color: #000020;');
|
||||
$geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
|
||||
$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
|
||||
$geshi->set_header_content('Source code viewer');
|
||||
$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
|
||||
$geshi->set_footer_content('Parsed in <TIME> seconds, using GeSHi <VERSION>');
|
||||
$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>Source code viewer - <?php echo $path; ?></title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
<?php
|
||||
// Output the stylesheet. Note it doesn't output the <style> tag
|
||||
echo $geshi->get_stylesheet();
|
||||
?>
|
||||
html {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
body {
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
margin: 10px;
|
||||
border: 2px solid #e0e0e0;
|
||||
background-color: #fcfcfc;
|
||||
padding: 5px;
|
||||
}
|
||||
h2 {
|
||||
margin: .1em 0 .2em .5em;
|
||||
border-bottom: 1px solid #b0b0b0;
|
||||
color: #b0b0b0;
|
||||
font-weight: normal;
|
||||
font-size: 150%;
|
||||
}
|
||||
h3 {
|
||||
margin: .1em 0 .2em .5em;
|
||||
color: #b0b0b0;
|
||||
font-weight: normal;
|
||||
font-size: 120%;
|
||||
}
|
||||
#footer {
|
||||
text-align: center;
|
||||
font-size: 80%;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
#footer a {
|
||||
color: #9999ff;
|
||||
}
|
||||
textarea {
|
||||
border: 1px solid #b0b0b0;
|
||||
font-size: 90%;
|
||||
color: #333;
|
||||
margin-left: 20px;
|
||||
}
|
||||
select, input {
|
||||
margin-left: 20px;
|
||||
}
|
||||
p {
|
||||
font-size: 90%;
|
||||
margin-left: .5em;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
// The fun part :)
|
||||
echo $geshi->parse_code();
|
||||
?>
|
||||
<hr/>
|
||||
</body>
|
||||
</html>
|
||||
456
thirdparty/geshi/contrib/cssgen.php
vendored
456
thirdparty/geshi/contrib/cssgen.php
vendored
@@ -1,456 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************
|
||||
* cssgen.php
|
||||
* ----------
|
||||
* Author: Nigel McNie (nigel@geshi.org)
|
||||
* Copyright: (c) 2004 Nigel McNie
|
||||
* Release Version: 1.0.8.6
|
||||
* Date Started: 2004/05/20
|
||||
*
|
||||
* Application to generate custom CSS files for GeSHi (based on an idea by Andreas
|
||||
* Gohr)
|
||||
*
|
||||
*************************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
set_magic_quotes_runtime(0);
|
||||
//
|
||||
// Functions
|
||||
//
|
||||
|
||||
function make_header ( $title )
|
||||
{
|
||||
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>GeSHi CSS Generator :: ' . $title . ' </title>
|
||||
<style type="text/css" media="screen">
|
||||
<!--
|
||||
html {
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
font-size: 80%;
|
||||
background-color: #d0d0d0;
|
||||
}
|
||||
body {
|
||||
margin: 10px;
|
||||
padding: 5px;
|
||||
border: 1px solid #f0f0f0;
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
h1 {
|
||||
border-bottom: 2px solid #e0e0e0;
|
||||
font-weight: normal;
|
||||
font-size: 150%;
|
||||
color: #c0c0c0;
|
||||
}
|
||||
input, textarea {
|
||||
border: 1px solid #d0d0d0;
|
||||
}
|
||||
th {
|
||||
text-align: right;
|
||||
font-weight: normal;
|
||||
}
|
||||
pre {
|
||||
font-size: 110%;
|
||||
color: #202020;
|
||||
}
|
||||
#footer {
|
||||
color: #b0b0b0;
|
||||
text-align: center;
|
||||
font-size: 90%;
|
||||
margin: 0 auto;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
#footer a {
|
||||
color: #c0c0c0;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function select (state)
|
||||
{
|
||||
var cboxes = document.getElementsByTagName(\'input\');
|
||||
for (var i = 0; i < cboxes.length; i++) {
|
||||
if (cboxes[i].type == "checkbox") {
|
||||
if (state == "true") {
|
||||
cboxes[i].checked = true;
|
||||
} else if (state == "false") {
|
||||
cboxes[i].checked = false;
|
||||
} else if (state == "invert") {
|
||||
cboxes[i].checked = !cboxes[i].checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>' . $title . '</h1>
|
||||
';
|
||||
}
|
||||
|
||||
function make_footer ()
|
||||
{
|
||||
echo '<div id="footer"><a href="http://qbnz.com/highlighter/">GeSHi</a> © Nigel McNie, 2004, released under the GPL</div></body>
|
||||
</html>';
|
||||
}
|
||||
|
||||
|
||||
function get_var ( $var_name )
|
||||
{
|
||||
if ( isset($_GET[$var_name]) )
|
||||
{
|
||||
return str_replace("\'", "'", $_GET[$var_name]);
|
||||
}
|
||||
elseif ( isset($_POST[$var_name]) )
|
||||
{
|
||||
return str_replace("\'", "'", $_POST[$var_name]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Unset everything
|
||||
//
|
||||
foreach ( $_REQUEST as $var )
|
||||
{
|
||||
unset($$var);
|
||||
}
|
||||
foreach ( array(
|
||||
'_POST' => 'HTTP_POST_VARS',
|
||||
'_GET' => 'HTTP_GET_VARS',
|
||||
'_COOKIE' => 'HTTP_COOKIE_VARS',
|
||||
'_SERVER' => 'HTTP_SERVER_VARS',
|
||||
'_ENV' => 'HTTP_ENV_VARS',
|
||||
'_FILES' => 'HTTP_POST_FILES') as $array => $other )
|
||||
{
|
||||
if ( !isset($$array) )
|
||||
{
|
||||
$$array = $$other;
|
||||
}
|
||||
unset($$other);
|
||||
}
|
||||
|
||||
|
||||
// Get what step we're up to
|
||||
$step = get_var('step');
|
||||
|
||||
if ( !$step || $step == 1 )
|
||||
{
|
||||
$errors = 0;
|
||||
make_header('Step 1');
|
||||
echo "Welcome to the GeSHi CSS generator.<br /><pre>Searching for GeSHi... ";
|
||||
|
||||
// Find GeSHi
|
||||
$geshi_path = get_var('geshi-path');
|
||||
$geshi_lang_path = get_var('geshi-lang-path');
|
||||
|
||||
if ( !$geshi_path )
|
||||
{
|
||||
$geshi_path = '../geshi.php';
|
||||
}
|
||||
if ( !$geshi_lang_path )
|
||||
{
|
||||
$geshi_lang_path = '../geshi/';
|
||||
}
|
||||
|
||||
|
||||
if ( is_file($geshi_path) && is_readable($geshi_path) )
|
||||
{
|
||||
// Get file contents and see if GeSHi is in here
|
||||
$file = @file($geshi_path);
|
||||
$contents = '';
|
||||
foreach ( $file as $line )
|
||||
{
|
||||
$contents .= $line;
|
||||
}
|
||||
if ( strpos($contents, '<?php
|
||||
/**
|
||||
* GeSHi - Generic Syntax Highlighter') !== false )
|
||||
{
|
||||
echo '<span style="color: green;">Found at ' . realpath($geshi_path) . '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
++$errors;
|
||||
$no_geshi_dot_php_error = true;
|
||||
echo '<span style="color: red;">Not found</span>';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
++$errors;
|
||||
$no_geshi_dot_php_error = true;
|
||||
echo '<span style="color: red;">Not found</span>';
|
||||
}
|
||||
|
||||
// Find language files
|
||||
echo "\nSearching for language files... ";
|
||||
if ( is_readable($geshi_lang_path . 'css-gen.cfg') )
|
||||
{
|
||||
|
||||
echo '<span style="color: green;">Found at ' . realpath($geshi_lang_path) . '</span>';
|
||||
}
|
||||
else
|
||||
{
|
||||
++$errors;
|
||||
$no_lang_dir_error = true;
|
||||
echo '<span style="color: red;">Not found</span>';
|
||||
}
|
||||
echo "</pre>\n";
|
||||
|
||||
if ( $errors > 0 )
|
||||
{
|
||||
// We're gonna have to ask for the paths...
|
||||
echo 'Unfortunately CSSGen could not detect the following paths. Please input them and press "submit" to try again.';
|
||||
echo "
|
||||
<form action=\"cssgen.php\" method=\"post\">";
|
||||
if ( $no_geshi_dot_php_error )
|
||||
{
|
||||
echo "
|
||||
<br />geshi.php: <input type=\"text\" name=\"geshi-path\" value=\"" . realpath('../geshi.php') . "\" size=\"50\" />";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="hidden" name="geshi-path" value="' . htmlspecialchars($geshi_path) . '" />';
|
||||
}
|
||||
if ( $no_lang_dir_error )
|
||||
{
|
||||
echo "
|
||||
<br />language files directory: <input type=\"text\" name=\"geshi-lang-path\" value=\"" . realpath('../geshi/') . "/\" size=\"50\" /> (should have a trailing slash)";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<input type="hidden" name="geshi-lang-path" value="' . $geshi_lang_path . '" />';
|
||||
}
|
||||
|
||||
echo "
|
||||
<br /><input type=\"submit\" value=\"Search\" /></form>";
|
||||
}
|
||||
else
|
||||
{
|
||||
// no errors - echo continue form
|
||||
echo 'Everything seems to be detected successfully. Use the button to continue.
|
||||
<br /><br /><form action="cssgen.php?step=2" method="post">
|
||||
<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
|
||||
<input type="submit" value="Step 2" />';
|
||||
}
|
||||
|
||||
make_footer();
|
||||
}
|
||||
// Step 2
|
||||
elseif ( $step == 2 )
|
||||
{
|
||||
make_header('Step 2');
|
||||
|
||||
$geshi_path = get_var('geshi-path');
|
||||
$geshi_lang_path = get_var('geshi-lang-path');
|
||||
|
||||
$dh = opendir($geshi_lang_path);
|
||||
$lang_files = array();
|
||||
$file = readdir($dh);
|
||||
while ( $file !== false )
|
||||
{
|
||||
if ( $file == '.' || $file == '..' || $file == 'CVS' || $file == 'css-gen.cfg' )
|
||||
{
|
||||
$file = readdir($dh);
|
||||
continue;
|
||||
}
|
||||
$lang_files[] = $file;
|
||||
$file = readdir($dh);
|
||||
}
|
||||
closedir($dh);
|
||||
sort($lang_files);
|
||||
|
||||
// Now installed languages are in $lang_files
|
||||
|
||||
echo '<form action="cssgen.php?step=3" method="post" id="step2">
|
||||
What languages are you wanting to make this stylesheet for?<br /><br />
|
||||
Detected languages:<br />';
|
||||
|
||||
foreach ( $lang_files as $lang )
|
||||
{
|
||||
$lang = substr($lang, 0, strpos($lang, '.'));
|
||||
if ($lang) {
|
||||
echo "<input type=\"checkbox\" name=\"langs[$lang]\" checked=\"checked\" /> $lang<br />\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo "Select: <a href=\"javascript:select('true')\">All</a>, <a href=\"javascript:select('false')\">None</a>, <a href=\"javascript:select('invert')\">Invert</a><br />\n";
|
||||
|
||||
echo 'If you\'d like any other languages not detected here to be supported, please enter
|
||||
them here, one per line:<br /><textarea rows="4" cols="20" name="extra-langs"></textarea><br />
|
||||
';
|
||||
|
||||
echo '<br />Styles:
|
||||
<table>
|
||||
<tr><th>Style for the overall code block:</th><td><input type="text" name="overall" value="border: 1px dotted #a0a0a0; font-family: \'Courier New\', Courier, monospace; background-color: #f0f0f0; color: #0000bb;" /></td></tr>
|
||||
<tr><th>Default Styles</th><td><input type="text" name="default-styles" value="font-weight:normal;background:transparent;color:#000; padding-left: 5px;" /></td></tr>
|
||||
<tr><th>Keywords I (if, do, while etc)</th><td><input type="text" name="keywords-1" value="color: #a1a100;" /></td></tr>
|
||||
<tr><th>Keywords II (null, true, false etc)</th><td><input type="text" name="keywords-2" value="color: #000; font-weight: bold;" /></td></tr>
|
||||
<tr><th>Inbuilt Functions (echo, print etc)</th><td><input type="text" name="keywords-3" value="color: #000066;" /></td></tr>
|
||||
<tr><th>Data Types (int, boolean etc)</th><td><input type="text" name="keywords-4" value="color: #f63333;" /></td></tr>
|
||||
|
||||
<tr><th>Comments (//, <!-- --> etc)</th><td><input type="text" name="comments" value="color: #808080;" /></td></tr>
|
||||
<tr><th>Escaped Characters (\n, \t etc)</th><td><input type="text" name="escaped-chars" value="color: #000033; font-weight: bold;" /></td></tr>
|
||||
<tr><th>Brackets ( ([{}]) etc)</th><td><input type="text" name="brackets" value="color: #66cc66;" /></td></tr>
|
||||
<tr><th>Strings ("foo" etc)</th><td><input type="text" name="strings" value="color: #ff0000;" /></td></tr>
|
||||
<tr><th>Numbers (1, -54, 2.5 etc)</th><td><input type="text" name="numbers" value="color: #ff33ff;" /></td></tr>
|
||||
<tr><th>Methods (Foo.bar() etc)</th><td><input type="text" name="methods" value="color: #006600;" /></td></tr>
|
||||
</table>';
|
||||
|
||||
echo '<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
|
||||
<input type="submit" value="Step 3" /></form>';
|
||||
|
||||
make_footer();
|
||||
}
|
||||
// Step 3
|
||||
elseif ( $step == 3 )
|
||||
{
|
||||
make_header('Step 3');
|
||||
echo '<p>Here is your completed stylesheet. Note that it may not be perfect - no regular expression styles are included for one thing,
|
||||
you\'ll have to add those yourself (php and xml are just two languages that use them), and line numbers are not included, however
|
||||
it includes most of the basic information.</p>';
|
||||
|
||||
// Make the stylesheet
|
||||
$part_selector_1 = '';
|
||||
$part_selector_2 = '';
|
||||
$part_selector_3 = '';
|
||||
|
||||
$langs = get_var('langs');
|
||||
$extra_langs = trim(get_var('extra-langs'));
|
||||
if ( $extra_langs != '' )
|
||||
{
|
||||
$l = explode("\r\n", $extra_langs);
|
||||
foreach ( $l as $lng )
|
||||
{
|
||||
$langs[$lng] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ( $langs as $lang => $dummy )
|
||||
{
|
||||
$part_selector_1 .= ".$lang {PART}, ";
|
||||
$part_selector_2 .= ".$lang {PART1}, .$lang {PART2}, ";
|
||||
$part_selector_3 .= ".$lang {PART1}, .$lang {PART2}, .$lang {PART3}, ";
|
||||
}
|
||||
$part_selector_1 = substr($part_selector_1, 0, -2);
|
||||
$part_selector_2 = substr($part_selector_2, 0, -2);
|
||||
$part_selector_3 = substr($part_selector_3, 0, -2);
|
||||
|
||||
|
||||
$default_styles = get_var('default-styles');
|
||||
$ol_selector = str_replace('{PART}', 'ol', $part_selector_1);
|
||||
$overall_styles = get_var('overall');
|
||||
$overall_selector = str_replace('{PART}', '', $part_selector_1);
|
||||
|
||||
$stylesheet = "/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */";
|
||||
|
||||
if ( $overall != '' )
|
||||
{
|
||||
$stylesheet .= "\n$overall_selector {{$overall_styles}}";
|
||||
}
|
||||
if ( $default_styles != '' )
|
||||
{
|
||||
$default_selector = str_replace(array('{PART1}', '{PART2}'), array('.de1', '.de2'), $part_selector_2);
|
||||
$stylesheet .= "\n$default_selector {{$default_styles}}";
|
||||
}
|
||||
|
||||
// Do keywords
|
||||
$keywords_1 = get_var('keywords-1');
|
||||
$keyword_selector_1 = str_replace('{PART}', '.kw1', $part_selector_1);
|
||||
if ( $keywords_1 != '' )
|
||||
{
|
||||
$stylesheet .= "\n$keyword_selector_1 {{$keywords_1}}";
|
||||
}
|
||||
|
||||
$keywords_2 = get_var('keywords-2');
|
||||
$keyword_selector_2 = str_replace('{PART}', '.kw2', $part_selector_1);
|
||||
if ( $keywords_2 != '' )
|
||||
{
|
||||
$stylesheet .= "\n$keyword_selector_2 {{$keywords_2}}";
|
||||
}
|
||||
|
||||
$keywords_3 = get_var('keywords-3');
|
||||
$keyword_selector_3 = str_replace('{PART}', '.kw3', $part_selector_1);
|
||||
if ( $keywords_3 != '' )
|
||||
{
|
||||
$stylesheet .= "\n$keyword_selector_3 {{$keywords_3}}";
|
||||
}
|
||||
|
||||
$keywords_4 = get_var('keywords-4');
|
||||
$keyword_selector_4 = str_replace('{PART}', '.kw4', $part_selector_1);
|
||||
if ( $keywords_4 != '' )
|
||||
{
|
||||
$stylesheet .= "\n$keyword_selector_4 {{$keywords_4}}";
|
||||
}
|
||||
|
||||
// Do other lexics
|
||||
$comments = get_var('comments');
|
||||
$comment_selector = str_replace(array('{PART1}', '{PART2}', '{PART3}'), array('.co1', '.co2', '.coMULTI'), $part_selector_3);
|
||||
if ( $comments != '' )
|
||||
{
|
||||
$stylesheet .= "\n$comment_selector {{$comments}}";
|
||||
}
|
||||
|
||||
$esc = get_var('escaped-chars');
|
||||
$esc_selector = str_replace('{PART}', '.es0', $part_selector_1);
|
||||
if ( $esc != '' )
|
||||
{
|
||||
$stylesheet .= "\n$esc_selector {{$esc}}";
|
||||
}
|
||||
|
||||
$brackets = get_var('brackets');
|
||||
$brk_selector = str_replace('{PART}', '.br0', $part_selector_1);
|
||||
if ( $brackets != '' )
|
||||
{
|
||||
$stylesheet .= "\n$brk_selector {{$brackets}}";
|
||||
}
|
||||
|
||||
$strings = get_var('strings');
|
||||
$string_selector = str_replace('{PART}', '.st0', $part_selector_1);
|
||||
if ( $strings != '' )
|
||||
{
|
||||
$stylesheet .= "\n$string_selector {{$strings}}";
|
||||
}
|
||||
|
||||
$numbers = get_var('numbers');
|
||||
$num_selector = str_replace('{PART}', '.nu0', $part_selector_1);
|
||||
if ( $numbers != '' )
|
||||
{
|
||||
$stylesheet .= "\n$num_selector {{$numbers}}";
|
||||
}
|
||||
|
||||
$methods = get_var('methods');
|
||||
$method_selector = str_replace('{PART}', '.me0', $part_selector_1);
|
||||
if ( $methods != '' )
|
||||
{
|
||||
$stylesheet .= "\n$method_selector {{$methods}}";
|
||||
}
|
||||
|
||||
echo "<pre>$stylesheet</pre>";
|
||||
|
||||
make_footer();
|
||||
}
|
||||
|
||||
?>
|
||||
59
thirdparty/geshi/contrib/cssgen2.php
vendored
59
thirdparty/geshi/contrib/cssgen2.php
vendored
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* A simple script which outputs the CSS classes for all languages
|
||||
* supported by GeSHi. You can access it directly to download
|
||||
* the CSS file. On *NIX you can also do a simple `php cssgen.php > geshi.css`.
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* @package geshi
|
||||
* @subpackage contrib
|
||||
* @author revulo <revulon@gmail.com>
|
||||
* @copyright 2008 revulo
|
||||
* @license http://gnu.org/copyleft/gpl.html GNU GPL
|
||||
*
|
||||
*/
|
||||
|
||||
require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'geshi.php';
|
||||
$geshi = new GeSHi;
|
||||
|
||||
$languages = array();
|
||||
if ($handle = opendir($geshi->language_path)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$pos = strpos($file, '.');
|
||||
if ($pos > 0 && substr($file, $pos) == '.php') {
|
||||
$languages[] = substr($file, 0, $pos);
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
sort($languages);
|
||||
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename="geshi.css"');
|
||||
|
||||
echo "/**\n".
|
||||
" * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
|
||||
" * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
|
||||
" */\n";
|
||||
|
||||
foreach ($languages as $language) {
|
||||
$geshi->set_language($language);
|
||||
// note: the false argument is required for stylesheet generators, see API documentation
|
||||
$css = $geshi->get_stylesheet(false);
|
||||
echo preg_replace('/^\/\*\*.*?\*\//s', '', $css);
|
||||
}
|
||||
766
thirdparty/geshi/contrib/langcheck.php
vendored
766
thirdparty/geshi/contrib/langcheck.php
vendored
@@ -1,766 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* GeSHi language file validation script
|
||||
*
|
||||
* Just point your browser at this script (with geshi.php in the parent directory)
|
||||
* and the language files in subdirectory "../geshi/" are being validated
|
||||
*
|
||||
* CLI mode is supported
|
||||
*
|
||||
* @author Benny Baumann
|
||||
* @version $Id: langcheck.php 2174 2009-09-10 09:17:40Z benbe $
|
||||
*/
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
|
||||
set_time_limit(0);
|
||||
error_reporting(E_ALL);
|
||||
$time_start = explode(' ', microtime());
|
||||
|
||||
function colorize($level, $string) {
|
||||
static $colors, $end;
|
||||
if ( !isset($colors) ) {
|
||||
if ( PHP_SAPI != 'cli' ) {
|
||||
$end = '</span>';
|
||||
$colors = array(
|
||||
TYPE_NOTICE => '<span style="color:#080;font-weight:bold;">',
|
||||
TYPE_WARNING => '<span style="color:#CC0; font-weight: bold;">',
|
||||
TYPE_ERROR => '<span style="color:#F00; font-weight: bold;">',
|
||||
TYPE_OK => '<span style="color: #080; font-weight: bold;">'
|
||||
);
|
||||
} else {
|
||||
$end = chr(27).'[0m';
|
||||
$colors = array(
|
||||
TYPE_NOTICE => chr(27).'[1m',
|
||||
TYPE_WARNING => chr(27).'[1;33m',
|
||||
TYPE_ERROR => chr(27).'[1;31m',
|
||||
TYPE_OK => chr(27).'[1;32m'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($colors[$level]) ) {
|
||||
trigger_error("no colors for level $level", E_USER_ERROR);
|
||||
}
|
||||
|
||||
return $colors[$level].$string.$end;
|
||||
}
|
||||
|
||||
define ('TYPE_NOTICE', 0);
|
||||
define ('TYPE_WARNING', 1);
|
||||
define ('TYPE_ERROR', 2);
|
||||
define ('TYPE_OK', 3);
|
||||
|
||||
$error_abort = false;
|
||||
$error_cache = array();
|
||||
function output_error_cache(){
|
||||
global $error_cache, $error_abort;
|
||||
|
||||
if(count($error_cache)) {
|
||||
echo colorize(TYPE_ERROR, "Failed");
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "\n\n";
|
||||
} else {
|
||||
echo "<br /><ol>\n";
|
||||
}
|
||||
foreach($error_cache as $error_msg) {
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "\n";
|
||||
} else {
|
||||
echo "<li>";
|
||||
}
|
||||
switch($error_msg['t']) {
|
||||
case TYPE_NOTICE:
|
||||
$msg = 'NOTICE';
|
||||
break;
|
||||
case TYPE_WARNING:
|
||||
$msg = 'WARNING';
|
||||
break;
|
||||
case TYPE_ERROR:
|
||||
$msg = 'ERROR';
|
||||
break;
|
||||
}
|
||||
echo colorize($error_msg['t'], $msg);
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "\t" . $error_msg['m'];
|
||||
} else {
|
||||
echo " " . $error_msg['m'] . "</li>";
|
||||
}
|
||||
}
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "\n";
|
||||
} else {
|
||||
echo "</ol>\n";
|
||||
}
|
||||
} else {
|
||||
echo colorize(TYPE_OK, "OK");
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "\n";
|
||||
} else {
|
||||
echo "\n<br />";
|
||||
}
|
||||
}
|
||||
echo "\n";
|
||||
|
||||
$error_cache = array();
|
||||
}
|
||||
|
||||
function report_error($type, $message) {
|
||||
global $error_cache, $error_abort;
|
||||
|
||||
$error_cache[] = array('t' => $type, 'm' => $message);
|
||||
if(TYPE_ERROR == $type) {
|
||||
$error_abort = true;
|
||||
}
|
||||
}
|
||||
|
||||
function dupfind_strtolower(&$value){
|
||||
$value = strtolower($value);
|
||||
}
|
||||
|
||||
if ( PHP_SAPI != 'cli' ) { ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title>GeSHi Language File Validation Script</title>
|
||||
<style type="text/css">
|
||||
<!--
|
||||
html {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
body {
|
||||
font-family: Verdana, Arial, sans-serif;
|
||||
margin: 10px;
|
||||
border: 2px solid #e0e0e0;
|
||||
background-color: #fcfcfc;
|
||||
padding: 5px;
|
||||
font-size: 10pt;
|
||||
}
|
||||
h2 {
|
||||
margin: .1em 0 .2em .5em;
|
||||
border-bottom: 1px solid #b0b0b0;
|
||||
color: #b0b0b0;
|
||||
font-weight: normal;
|
||||
font-size: 150%;
|
||||
}
|
||||
h3 {
|
||||
margin: .1em 0 .2em .5em;
|
||||
color: #b0b0b0;
|
||||
font-weight: normal;
|
||||
font-size: 120%;
|
||||
}
|
||||
#footer {
|
||||
text-align: center;
|
||||
font-size: 80%;
|
||||
color: #a9a9a9;
|
||||
}
|
||||
#footer a {
|
||||
color: #9999ff;
|
||||
}
|
||||
textarea {
|
||||
border: 1px solid #b0b0b0;
|
||||
font-size: 90%;
|
||||
color: #333;
|
||||
margin-left: 20px;
|
||||
}
|
||||
select, input {
|
||||
margin-left: 20px;
|
||||
}
|
||||
p {
|
||||
font-size: 90%;
|
||||
margin-left: .5em;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h2>GeSHi Language File Validation Script</h2>
|
||||
<p>To use this script, make sure that <strong>geshi.php</strong> is in the
|
||||
parent directory or in your include_path, and that the language files are in a
|
||||
subdirectory of GeSHi's directory called <strong>geshi/</strong>.</p>
|
||||
<p>Everything else will be done by this script automatically. After the script
|
||||
finished you should see messages of what could cause trouble with GeSHi or where
|
||||
your language files can be improved. Please be patient, as this might take some time.</p>
|
||||
|
||||
<ol>
|
||||
<li>Checking where to find GeSHi installation ...<?php
|
||||
} else { ?>
|
||||
<?php echo colorize(TYPE_NOTICE, "#### GeSHi Language File Validation Script ####") ?>
|
||||
|
||||
|
||||
To use this script, make sure that <?php echo colorize(TYPE_NOTICE, "geshi.php"); ?> is in the
|
||||
parent directory or in your include_path, and that the language files are in a
|
||||
subdirectory of GeSHi's directory called <?php echo colorize(TYPE_NOTICE, "geshi/"); ?>.
|
||||
|
||||
Everything else will be done by this script automatically. After the script
|
||||
finished you should see messages of what could cause trouble with GeSHi or where
|
||||
your language files can be improved. Please be patient, as this might take some time.
|
||||
|
||||
|
||||
Checking where to find GeSHi installation ...<?php echo "\t";
|
||||
}
|
||||
|
||||
// Rudimentary checking of where GeSHi is. In a default install it will be in ../, but
|
||||
// it could be in the current directory if the include_path is set. There's nowhere else
|
||||
// we can reasonably guess.
|
||||
if (is_readable('../geshi.php')) {
|
||||
$path = '../';
|
||||
} elseif (is_readable('geshi.php')) {
|
||||
$path = './';
|
||||
} else {
|
||||
report_error(TYPE_ERROR, 'Could not find geshi.php - make sure it is in your include path!');
|
||||
}
|
||||
|
||||
if(!$error_abort) {
|
||||
require $path . 'geshi.php';
|
||||
|
||||
if(!class_exists('GeSHi')) {
|
||||
report_error(TYPE_ERROR, 'The GeSHi class was not found, although it seemed we loaded the correct file!');
|
||||
}
|
||||
}
|
||||
|
||||
if(!$error_abort) {
|
||||
if(!defined('GESHI_LANG_ROOT')) {
|
||||
report_error(TYPE_ERROR, 'There\'s no information present on where to find the language files!');
|
||||
} else if(!is_dir(GESHI_LANG_ROOT)) {
|
||||
report_error(TYPE_ERROR, 'The path "'.GESHI_LANG_ROOT.'" given, does not ressemble a directory!');
|
||||
} else if(!is_readable(GESHI_LANG_ROOT)) {
|
||||
report_error(TYPE_ERROR, 'The path "'.GESHI_LANG_ROOT.'" is not readable to this script!');
|
||||
}
|
||||
}
|
||||
|
||||
output_error_cache();
|
||||
|
||||
if(!$error_abort) {
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "Listing available language files ...\t\t";
|
||||
} else {
|
||||
echo "</li>\n<li>Listing available language files ... ";
|
||||
}
|
||||
|
||||
if (!($dir = @opendir(GESHI_LANG_ROOT))) {
|
||||
report_error(TYPE_ERROR, 'Error requesting listing for available language files!');
|
||||
}
|
||||
|
||||
$languages = array();
|
||||
|
||||
if(!$error_abort) {
|
||||
while ($file = readdir($dir)) {
|
||||
if (!$file || $file[0] == '.' || strpos($file, '.') === false) {
|
||||
continue;
|
||||
}
|
||||
$lang = substr($file, 0, strpos($file, '.'));
|
||||
$languages[] = $lang;
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
|
||||
$languages = array_unique($languages);
|
||||
sort($languages);
|
||||
|
||||
if(!count($languages)) {
|
||||
report_error(TYPE_WARNING, 'Unable to locate any usable language files in "'.GESHI_LANG_ROOT.'"!');
|
||||
}
|
||||
|
||||
output_error_cache();
|
||||
}
|
||||
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
if (isset($_SERVER['argv'][1]) && in_array($_SERVER['argv'][1], $languages)) {
|
||||
$languages = array($_SERVER['argv'][1]);
|
||||
}
|
||||
} else {
|
||||
if (isset($_REQUEST['show']) && in_array($_REQUEST['show'], $languages)) {
|
||||
$languages = array($_REQUEST['show']);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$error_abort) {
|
||||
foreach ($languages as $lang) {
|
||||
|
||||
if ( PHP_SAPI == 'cli' ) {
|
||||
echo "Validating language file for '$lang' ...\t\t";
|
||||
} else {
|
||||
echo "</li>\n<li>Validating language file for '$lang' ... ";
|
||||
}
|
||||
|
||||
$langfile = GESHI_LANG_ROOT . $lang . '.php';
|
||||
|
||||
$language_data = array();
|
||||
|
||||
if(!is_file($langfile)) {
|
||||
report_error(TYPE_ERROR, 'The path "' .$langfile. '" does not ressemble a regular file!');
|
||||
} else if(!is_readable($langfile)) {
|
||||
report_error(TYPE_ERROR, 'Cannot read file "' .$langfile. '"!');
|
||||
} else {
|
||||
$langfile_content = file_get_contents($langfile);
|
||||
if(preg_match("/\?>(?:\r?\n|\r(?!\n)){2,}\Z/", $langfile_content)) {
|
||||
report_error(TYPE_ERROR, 'Language file contains trailing empty lines at EOF!');
|
||||
}
|
||||
if(!preg_match("/\?>(?:\r?\n|\r(?!\n))?\Z/", $langfile_content)) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no PHP end marker at EOF!');
|
||||
}
|
||||
if(preg_match("/\t/", $langfile_content)) {
|
||||
report_error(TYPE_NOTICE, 'Language file contains unescaped tabulator chars (probably for indentation)!');
|
||||
}
|
||||
if(preg_match('/^(?: )*(?! )(?! \*) /m', $langfile_content)) {
|
||||
report_error(TYPE_NOTICE, 'Language file contains irregular indentation (other than 4 spaces per indentation level)!');
|
||||
}
|
||||
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?Author:((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not contain a specification of an author!');
|
||||
}
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?Copyright:((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not contain a specification of the copyright!');
|
||||
}
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?Release Version:((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not contain a specification of the release version!');
|
||||
}
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?Date Started:((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not contain a specification of the date it was started!');
|
||||
}
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?This file is part of GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not state that it belongs to GeSHi!');
|
||||
}
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?language file for GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not state that it is a language file for GeSHi!');
|
||||
}
|
||||
if(!preg_match("/\/\*\*((?!\*\/).)*?GNU General Public License((?!\*\/).)*?\*\//s", $langfile_content)) {
|
||||
report_error(TYPE_WARNING, 'Language file does not state that it is provided under the terms of the GNU GPL!');
|
||||
}
|
||||
|
||||
unset($langfile_content);
|
||||
|
||||
include $langfile;
|
||||
|
||||
if(!isset($language_data)) {
|
||||
report_error(TYPE_ERROR, 'Language file does not contain a $language_data structure to check!');
|
||||
} else if (!is_array($language_data)) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data structure which is not an array!');
|
||||
}
|
||||
}
|
||||
|
||||
if(!$error_abort) {
|
||||
if(!isset($language_data['LANG_NAME'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'LANG_NAME\'] specification!');
|
||||
} else if (!is_string($language_data['LANG_NAME'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'LANG_NAME\'] specification which is not a string!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['COMMENT_SINGLE'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'COMMENT_SIGNLE\'] structure to check!');
|
||||
} else if (!is_array($language_data['COMMENT_SINGLE'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_SINGLE\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['COMMENT_MULTI'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'COMMENT_MULTI\'] structure to check!');
|
||||
} else if (!is_array($language_data['COMMENT_MULTI'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_MULTI\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(isset($language_data['COMMENT_REGEXP'])) {
|
||||
if (!is_array($language_data['COMMENT_REGEXP'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_REGEXP\'] structure which is not an array!');
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($language_data['QUOTEMARKS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'QUOTEMARKS\'] structure to check!');
|
||||
} else if (!is_array($language_data['QUOTEMARKS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'QUOTEMARKS\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(isset($language_data['HARDQUOTE'])) {
|
||||
if (!is_array($language_data['HARDQUOTE'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'HARDQUOTE\'] structure which is not an array!');
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($language_data['ESCAPE_CHAR'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'ESCAPE_CHAR\'] specification to check!');
|
||||
} else if (!is_string($language_data['ESCAPE_CHAR'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification which is not a string!');
|
||||
} else if (1 < strlen($language_data['ESCAPE_CHAR'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification is not empty or exactly one char!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['CASE_KEYWORDS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'CASE_KEYWORDS\'] specification!');
|
||||
} else if (!is_int($language_data['CASE_KEYWORDS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is not an integer!');
|
||||
} else if (GESHI_CAPS_NO_CHANGE != $language_data['CASE_KEYWORDS'] &&
|
||||
GESHI_CAPS_LOWER != $language_data['CASE_KEYWORDS'] &&
|
||||
GESHI_CAPS_UPPER != $language_data['CASE_KEYWORDS']) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is neither of GESHI_CAPS_NO_CHANGE, GESHI_CAPS_LOWER nor GESHI_CAPS_UPPER!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['KEYWORDS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'KEYWORDS\'] structure to check!');
|
||||
} else if (!is_array($language_data['KEYWORDS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'KEYWORDS\'] structure which is not an array!');
|
||||
} else {
|
||||
foreach($language_data['KEYWORDS'] as $kw_key => $kw_value) {
|
||||
if(!is_integer($kw_key)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$kw_key' in \$language_data['KEYWORDS'] that is not integer!");
|
||||
} else if (!is_array($kw_value)) {
|
||||
report_error(TYPE_ERROR, "Language file contains a \$language_data['CASE_SENSITIVE']['$kw_value'] structure which is not an array!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($language_data['SYMBOLS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'SYMBOLS\'] structure to check!');
|
||||
} else if (!is_array($language_data['SYMBOLS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'SYMBOLS\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['CASE_SENSITIVE'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'CASE_SENSITIVE\'] structure to check!');
|
||||
} else if (!is_array($language_data['CASE_SENSITIVE'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_SENSITIVE\'] structure which is not an array!');
|
||||
} else {
|
||||
foreach($language_data['CASE_SENSITIVE'] as $cs_key => $cs_value) {
|
||||
if(!is_integer($cs_key)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$cs_key' in \$language_data['CASE_SENSITIVE'] that is not integer!");
|
||||
} else if (!is_bool($cs_value)) {
|
||||
report_error(TYPE_ERROR, "Language file contains a Case Sensitivity specification for \$language_data['CASE_SENSITIVE']['$cs_value'] which is not a boolean!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($language_data['URLS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'URLS\'] structure to check!');
|
||||
} else if (!is_array($language_data['URLS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'URLS\'] structure which is not an array!');
|
||||
} else {
|
||||
foreach($language_data['URLS'] as $url_key => $url_value) {
|
||||
if(!is_integer($url_key)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$url_key' in \$language_data['URLS'] that is not integer!");
|
||||
} else if (!is_string($url_value)) {
|
||||
report_error(TYPE_ERROR, "Language file contains a Documentation URL specification for \$language_data['URLS']['$url_value'] which is not a string!");
|
||||
} else if (preg_match('#&([^;]*(=|$))#U', $url_value)) {
|
||||
report_error(TYPE_ERROR, "Language file contains unescaped ampersands (&) in \$language_data['URLS']!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($language_data['OOLANG'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'OOLANG\'] specification!');
|
||||
} else if (!is_int($language_data['OOLANG']) && !is_bool($language_data['OOLANG'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OOLANG\'] specification which is neither boolean nor integer!');
|
||||
} else if (false !== $language_data['OOLANG'] &&
|
||||
true !== $language_data['OOLANG'] &&
|
||||
2 !== $language_data['OOLANG']) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OOLANG\'] specification which is neither of false, true or 2!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['OBJECT_SPLITTERS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'OBJECT_SPLITTERS\'] structure to check!');
|
||||
} else if (!is_array($language_data['OBJECT_SPLITTERS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OBJECT_SPLITTERS\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['REGEXPS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'REGEXPS\'] structure to check!');
|
||||
} else if (!is_array($language_data['REGEXPS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'REGEXPS\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['STRICT_MODE_APPLIES'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'STRICT_MODE_APPLIES\'] specification!');
|
||||
} else if (!is_int($language_data['STRICT_MODE_APPLIES'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is not an integer!');
|
||||
} else if (GESHI_MAYBE != $language_data['STRICT_MODE_APPLIES'] &&
|
||||
GESHI_ALWAYS != $language_data['STRICT_MODE_APPLIES'] &&
|
||||
GESHI_NEVER != $language_data['STRICT_MODE_APPLIES']) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is neither of GESHI_MAYBE, GESHI_ALWAYS nor GESHI_NEVER!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['SCRIPT_DELIMITERS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'SCRIPT_DELIMITERS\'] structure to check!');
|
||||
} else if (!is_array($language_data['SCRIPT_DELIMITERS'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'SCRIPT_DELIMITERS\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(!isset($language_data['HIGHLIGHT_STRICT_BLOCK'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure to check!');
|
||||
} else if (!is_array($language_data['HIGHLIGHT_STRICT_BLOCK'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure which is not an array!');
|
||||
}
|
||||
|
||||
if(isset($language_data['TAB_WIDTH'])) {
|
||||
if (!is_int($language_data['TAB_WIDTH'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is not an integer!');
|
||||
} else if (1 > $language_data['TAB_WIDTH']) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is less than 1!');
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($language_data['PARSER_CONTROL'])) {
|
||||
if (!is_array($language_data['PARSER_CONTROL'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'PARSER_CONTROL\'] structure which is not an array!');
|
||||
}
|
||||
}
|
||||
|
||||
if(!isset($language_data['STYLES'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains no $language_data[\'STYLES\'] structure to check!');
|
||||
} else if (!is_array($language_data['STYLES'])) {
|
||||
report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STYLES\'] structure which is not an array!');
|
||||
} else {
|
||||
$style_arrays = array('KEYWORDS', 'COMMENTS', 'ESCAPE_CHAR',
|
||||
'BRACKETS', 'STRINGS', 'NUMBERS', 'METHODS', 'SYMBOLS',
|
||||
'REGEXPS', 'SCRIPT');
|
||||
foreach($style_arrays as $style_kind) {
|
||||
if(!isset($language_data['STYLES'][$style_kind])) {
|
||||
report_error(TYPE_ERROR, "Language file contains no \$language_data['STYLES']['$style_kind'] structure to check!");
|
||||
} else if (!is_array($language_data['STYLES'][$style_kind])) {
|
||||
report_error(TYPE_ERROR, "Language file contains a \$language_data['STYLES\']['$style_kind'] structure which is not an array!");
|
||||
} else {
|
||||
foreach($language_data['STYLES'][$style_kind] as $sk_key => $sk_value) {
|
||||
if(!is_int($sk_key) && ('COMMENTS' != $style_kind && 'MULTI' != $sk_key)
|
||||
&& !(('STRINGS' == $style_kind || 'ESCAPE_CHAR' == $style_kind) && 'HARD' == $sk_key)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$sk_key' in \$language_data['STYLES']['$style_kind'] that is not integer!");
|
||||
} else if (!is_string($sk_value)) {
|
||||
report_error(TYPE_WARNING, "Language file contains a CSS specification for \$language_data['STYLES']['$style_kind'][$key] which is not a string!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unset($style_arrays);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$error_abort) {
|
||||
//Initial sanity checks survived? --> Let's dig deeper!
|
||||
foreach($language_data['KEYWORDS'] as $key => $keywords) {
|
||||
if(!isset($language_data['CASE_SENSITIVE'][$key])) {
|
||||
report_error(TYPE_ERROR, "Language file contains no \$language_data['CASE_SENSITIVE'] specification for keyword group $key!");
|
||||
}
|
||||
if(!isset($language_data['URLS'][$key])) {
|
||||
report_error(TYPE_ERROR, "Language file contains no \$language_data['URLS'] specification for keyword group $key!");
|
||||
}
|
||||
if(empty($keywords)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an empty keyword list in \$language_data['KEYWORDS'] for group $key!");
|
||||
}
|
||||
foreach($keywords as $id => $kw) {
|
||||
if(!is_string($kw)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['KEYWORDS'][$key][$id]!");
|
||||
} else if (!strlen($kw)) {
|
||||
report_error(TYPE_ERROR, "Language file contains an empty string entry at \$language_data['KEYWORDS'][$key][$id]!");
|
||||
} else if (preg_match('/^([\(\)\{\}\[\]\^=.,:;\-+\*\/%\$\"\'\?]|&[\w#]\w*;)+$/i', $kw)) {
|
||||
report_error(TYPE_NOTICE, "Language file contains an keyword ('$kw') at \$language_data['KEYWORDS'][$key][$id] which seems to be better suited for the symbols section!");
|
||||
}
|
||||
}
|
||||
if(isset($language_data['CASE_SENSITIVE'][$key]) && !$language_data['CASE_SENSITIVE'][$key]) {
|
||||
array_walk($keywords, 'dupfind_strtolower');
|
||||
}
|
||||
if(count($keywords) != count(array_unique($keywords))) {
|
||||
$kw_diffs = array_count_values($keywords);
|
||||
foreach($kw_diffs as $kw => $kw_count) {
|
||||
if($kw_count > 1) {
|
||||
report_error(TYPE_WARNING, "Language file contains per-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key]!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$disallowed_before = "(?<![a-zA-Z0-9\$_\|\#;>|^&";
|
||||
$disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
|
||||
|
||||
foreach($language_data['KEYWORDS'] as $key => $keywords) {
|
||||
foreach($language_data['KEYWORDS'] as $key2 => $keywords2) {
|
||||
if($key2 <= $key) {
|
||||
continue;
|
||||
}
|
||||
$kw_diffs = array_intersect($keywords, $keywords2);
|
||||
foreach($kw_diffs as $kw) {
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS'])) {
|
||||
//Check the precondition\post-cindition for the involved keyword groups
|
||||
$g1_pre = $disallowed_before;
|
||||
$g2_pre = $disallowed_before;
|
||||
$g1_post = $disallowed_after;
|
||||
$g2_post = $disallowed_after;
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) {
|
||||
$g1_pre = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
|
||||
$g2_pre = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
|
||||
}
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) {
|
||||
$g1_post = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
|
||||
$g2_post = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
|
||||
}
|
||||
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_BEFORE'])) {
|
||||
$g1_pre = $language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_BEFORE'];
|
||||
}
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_AFTER'])) {
|
||||
$g1_post = $language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_AFTER'];
|
||||
}
|
||||
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_BEFORE'])) {
|
||||
$g2_pre = $language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_BEFORE'];
|
||||
}
|
||||
if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_AFTER'])) {
|
||||
$g2_post = $language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_AFTER'];
|
||||
}
|
||||
|
||||
if($g1_pre != $g2_pre || $g1_post != $g2_post) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
report_error(TYPE_WARNING, "Language file contains cross-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key] and \$language_data['KEYWORDS'][$key2]!");
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($language_data['CASE_SENSITIVE'] as $key => $keywords) {
|
||||
if(!isset($language_data['KEYWORDS'][$key]) && $key != GESHI_COMMENTS) {
|
||||
report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['CASE_SENSITIVE'] specification for non-existing keyword group $key!");
|
||||
}
|
||||
}
|
||||
foreach($language_data['URLS'] as $key => $keywords) {
|
||||
if(!isset($language_data['KEYWORDS'][$key])) {
|
||||
report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['URLS'] specification for non-existing keyword group $key!");
|
||||
}
|
||||
}
|
||||
foreach($language_data['STYLES']['KEYWORDS'] as $key => $keywords) {
|
||||
if(!isset($language_data['KEYWORDS'][$key])) {
|
||||
report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['STYLES']['KEYWORDS'] specification for non-existing keyword group $key!");
|
||||
}
|
||||
}
|
||||
|
||||
foreach($language_data['COMMENT_SINGLE'] as $ck => $cv) {
|
||||
if(!is_int($ck)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$ck' in \$language_data['COMMENT_SINGLE'] that is not integer!");
|
||||
}
|
||||
if(!is_string($cv)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['COMMENT_SINGLE'][$ck]!");
|
||||
}
|
||||
if(!isset($language_data['STYLES']['COMMENTS'][$ck])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
|
||||
}
|
||||
}
|
||||
if(isset($language_data['COMMENT_REGEXP'])) {
|
||||
foreach($language_data['COMMENT_REGEXP'] as $ck => $cv) {
|
||||
if(!is_int($ck)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$ck' in \$language_data['COMMENT_REGEXP'] that is not integer!");
|
||||
}
|
||||
if(!is_string($cv)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['COMMENT_REGEXP'][$ck]!");
|
||||
}
|
||||
if(!isset($language_data['STYLES']['COMMENTS'][$ck])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($language_data['STYLES']['COMMENTS'] as $ck => $cv) {
|
||||
if($ck != 'MULTI' && !isset($language_data['COMMENT_SINGLE'][$ck]) &&
|
||||
!isset($language_data['COMMENT_REGEXP'][$ck])) {
|
||||
report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['COMMENTS'] specification for Single Line or Regular-Expression Comment key $ck!");
|
||||
}
|
||||
}
|
||||
if (isset($language_data['STYLES']['STRINGS']['HARD'])) {
|
||||
if (empty($language_data['HARDQUOTE'])) {
|
||||
report_error(TYPE_NOTICE, "Language file contains superfluous \$language_data['STYLES']['STRINGS'] specification for key 'HARD', but no 'HARDQUOTE's are defined!");
|
||||
}
|
||||
unset($language_data['STYLES']['STRINGS']['HARD']);
|
||||
}
|
||||
foreach($language_data['STYLES']['STRINGS'] as $sk => $sv) {
|
||||
if($sk && !isset($language_data['QUOTEMARKS'][$sk])) {
|
||||
report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['STRINGS'] specification for non-existing quotemark key $sk!");
|
||||
}
|
||||
}
|
||||
|
||||
foreach($language_data['REGEXPS'] as $rk => $rv) {
|
||||
if(!is_int($rk)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an key '$rk' in \$language_data['REGEXPS'] that is not integer!");
|
||||
}
|
||||
if(is_string($rv)) {
|
||||
//Check for unmasked / in regular expressions ...
|
||||
if(empty($rv)) {
|
||||
report_error(TYPE_WARNING, "Language file contains an empty regular expression at \$language_data['REGEXPS'][$rk]!");
|
||||
} else {
|
||||
if(preg_match("/(?<!\\\\)\//s", $rv)) {
|
||||
report_error(TYPE_WARNING, "Language file contains a regular expression with an unmasked / character at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif (preg_match("/(?<!<)(\\\\\\\\)*\\\\\|(?!>)/s", $rv)) {
|
||||
report_error(TYPE_WARNING, "Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '<PIPE>' instead at \$language_data['REGEXPS'][$rk]!");
|
||||
}
|
||||
}
|
||||
} elseif(is_array($rv)) {
|
||||
if(!isset($rv[GESHI_SEARCH])) {
|
||||
report_error(TYPE_ERROR, "Language file contains no GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif(!is_string($rv[GESHI_SEARCH])) {
|
||||
report_error(TYPE_ERROR, "Language file contains a GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
|
||||
} else {
|
||||
if(preg_match("/(?<!\\\\)\//s", $rv[GESHI_SEARCH])) {
|
||||
report_error(TYPE_WARNING, "Language file contains a regular expression with an unmasked / character at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif (preg_match("/(?<!<)(\\\\\\\\)*\\\\\|(?!>)/s", $rv[GESHI_SEARCH])) {
|
||||
report_error(TYPE_WARNING, "Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '<PIPE>' instead at \$language_data['REGEXPS'][$rk]!");
|
||||
}
|
||||
}
|
||||
if(!isset($rv[GESHI_REPLACE])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif(!is_string($rv[GESHI_REPLACE])) {
|
||||
report_error(TYPE_ERROR, "Language file contains a GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
|
||||
}
|
||||
if(!isset($rv[GESHI_MODIFIERS])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif(!is_string($rv[GESHI_MODIFIERS])) {
|
||||
report_error(TYPE_ERROR, "Language file contains a GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
|
||||
}
|
||||
if(!isset($rv[GESHI_BEFORE])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif(!is_string($rv[GESHI_BEFORE])) {
|
||||
report_error(TYPE_ERROR, "Language file contains a GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
|
||||
}
|
||||
if(!isset($rv[GESHI_AFTER])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
|
||||
} elseif(!is_string($rv[GESHI_AFTER])) {
|
||||
report_error(TYPE_ERROR, "Language file contains a GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
|
||||
}
|
||||
} else {
|
||||
report_error(TYPE_WARNING, "Language file contains an non-string and non-array entry at \$language_data['REGEXPS'][$rk]!");
|
||||
}
|
||||
if(!isset($language_data['STYLES']['REGEXPS'][$rk])) {
|
||||
report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['REGEXPS'] specification for regexp group $rk!");
|
||||
}
|
||||
}
|
||||
foreach($language_data['STYLES']['REGEXPS'] as $rk => $rv) {
|
||||
if(!isset($language_data['REGEXPS'][$rk])) {
|
||||
report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['REGEXPS'] specification for regexp key $rk!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
output_error_cache();
|
||||
|
||||
flush();
|
||||
|
||||
if($error_abort) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$time_end = explode(' ', microtime());
|
||||
$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1];
|
||||
|
||||
if ( PHP_SAPI != 'cli' ) {
|
||||
?></li>
|
||||
</ol>
|
||||
|
||||
<p>Validation process completed in <?php printf("%.2f", $time_diff); ?> seconds.</p>
|
||||
|
||||
<div id="footer">GeSHi © 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, released under the GNU GPL</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php } else { ?>
|
||||
|
||||
Validation process completed in <?php printf("%.2f", $time_diff); ?> seconds.
|
||||
|
||||
GeSHi © 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, released under the GNU GPL
|
||||
|
||||
<?php } ?>
|
||||
4665
thirdparty/geshi/geshi.php
vendored
4665
thirdparty/geshi/geshi.php
vendored
File diff suppressed because it is too large
Load Diff
327
thirdparty/geshi/geshi/bash.php
vendored
327
thirdparty/geshi/geshi/bash.php
vendored
@@ -1,327 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************
|
||||
* bash.php
|
||||
* --------
|
||||
* Author: Andreas Gohr (andi@splitbrain.org)
|
||||
* Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
|
||||
* Release Version: 1.0.8.8
|
||||
* Date Started: 2004/08/20
|
||||
*
|
||||
* BASH language file for GeSHi.
|
||||
*
|
||||
* CHANGES
|
||||
* -------
|
||||
* 2008/06/21 (1.0.8)
|
||||
* - Added loads of keywords and commands of GNU/Linux
|
||||
* - Added support for parameters starting with a dash
|
||||
* 2008/05/23 (1.0.7.22)
|
||||
* - Added description of extra language features (SF#1970248)
|
||||
* 2007/09/05 (1.0.7.21)
|
||||
* - PARSER_CONTROL patch using SF #1788408 (BenBE)
|
||||
* 2007/06/11 (1.0.7.20)
|
||||
* - Added a lot of keywords (BenBE / Jan G)
|
||||
* 2004/11/27 (1.0.2)
|
||||
* - Added support for multiple object splitters
|
||||
* 2004/10/27 (1.0.1)
|
||||
* - Added support for URLs
|
||||
* 2004/08/20 (1.0.0)
|
||||
* - First Release
|
||||
*
|
||||
* TODO (updated 2004/11/27)
|
||||
* -------------------------
|
||||
* * Get symbols working
|
||||
* * Highlight builtin vars
|
||||
*
|
||||
*************************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
$language_data = array (
|
||||
'LANG_NAME' => 'Bash',
|
||||
// Bash DOES have single line comments with # markers. But bash also has
|
||||
// the $# variable, so comments need special handling (see sf.net
|
||||
// 1564839)
|
||||
'COMMENT_SINGLE' => array('#'),
|
||||
'COMMENT_MULTI' => array(),
|
||||
'COMMENT_REGEXP' => array(
|
||||
//Variables
|
||||
1 => "/\\$\\{[^\\n\\}]*?\\}/i",
|
||||
//BASH-style Heredoc
|
||||
2 => '/<<-?\s*?(\'?)([a-zA-Z0-9]+)\1\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
|
||||
//Escaped String Starters
|
||||
3 => "/\\\\['\"]/siU"
|
||||
),
|
||||
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
|
||||
'QUOTEMARKS' => array('"'),
|
||||
'HARDQUOTE' => array("'", "'"),
|
||||
'HARDESCAPE' => array("\'"),
|
||||
'ESCAPE_CHAR' => '',
|
||||
'ESCAPE_REGEXP' => array(
|
||||
//Simple Single Char Escapes
|
||||
1 => "#\\\\[nfrtv\\$\\\"\n]#i",
|
||||
// $var
|
||||
2 => "#\\$[a-z_][a-z0-9_]*#i",
|
||||
// ${...}
|
||||
3 => "/\\$\\{[^\\n\\}]*?\\}/i",
|
||||
// $(...)
|
||||
4 => "/\\$\\([^\\n\\)]*?\\)/i",
|
||||
// `...`
|
||||
5 => "/`[^`]*`/"
|
||||
),
|
||||
'KEYWORDS' => array(
|
||||
1 => array(
|
||||
'case', 'do', 'done', 'elif', 'else', 'esac', 'fi', 'for', 'function',
|
||||
'if', 'in', 'select', 'set', 'then', 'until', 'while', 'time'
|
||||
),
|
||||
2 => array(
|
||||
'aclocal', 'aconnect', 'aplay', 'apm', 'apmsleep', 'apropos',
|
||||
'apt-cache', 'apt-file', 'apt-get', 'apt-key', 'apt-src', 'aptitude',
|
||||
'ar', 'arch', 'arecord', 'as', 'as86', 'ash', 'autoconf',
|
||||
'autoheader', 'automake', 'awk',
|
||||
|
||||
'basename', 'bash', 'bc', 'bison', 'bunzip2', 'bzcat',
|
||||
'bzcmp', 'bzdiff', 'bzegrep', 'bzfgrep', 'bzgrep',
|
||||
'bzip2', 'bzip2recover', 'bzless', 'bzmore',
|
||||
|
||||
'c++', 'cal', 'cat', 'chattr', 'cc', 'cdda2wav', 'cdparanoia',
|
||||
'cdrdao', 'cd-read', 'cdrecord', 'chfn', 'chgrp', 'chmod',
|
||||
'chown', 'chroot', 'chsh', 'chvt', 'clear', 'cmp', 'comm', 'co',
|
||||
'col', 'cp', 'cpio', 'cpp', 'csh', 'cut', 'cvs', 'cvs-pserver',
|
||||
|
||||
'dash', 'date', 'dc', 'dch', 'dcop', 'dd', 'ddate', 'ddd',
|
||||
'deallocvt', 'debconf', 'defoma', 'depmod', 'df', 'dh',
|
||||
'dialog', 'diff', 'diff3', 'dig', 'dir', 'dircolors', 'directomatic',
|
||||
'dirname', 'dmesg', 'dnsdomainname', 'domainname', 'dpkg',
|
||||
'dselect', 'du', 'dumpkeys',
|
||||
|
||||
'ed', 'egrep', 'env', 'expr',
|
||||
|
||||
'false', 'fbset', 'ffmpeg', 'fgconsole','fgrep', 'file', 'find',
|
||||
'flex', 'flex++', 'fmt', 'free', 'ftp', 'funzip', 'fuser',
|
||||
|
||||
'g++', 'gawk', 'gc','gcc', 'gdb', 'getent', 'getkeycodes',
|
||||
'getopt', 'gettext', 'gettextize', 'gimp', 'gimp-remote',
|
||||
'gimptool', 'gmake', 'gocr', 'grep', 'groups', 'gs', 'gunzip',
|
||||
'gzexe', 'gzip',
|
||||
|
||||
'git', 'gitaction', 'git-add', 'git-add--interactive', 'git-am',
|
||||
'git-annotate', 'git-apply', 'git-archive', 'git-bisect',
|
||||
'git-bisect--helper', 'git-blame', 'git-branch', 'git-bundle',
|
||||
'git-cat-file', 'git-check-attr', 'git-checkout',
|
||||
'git-checkout-index', 'git-check-ref-format', 'git-cherry',
|
||||
'git-cherry-pick', 'git-clean', 'git-clone', 'git-commit',
|
||||
'git-commit-tree', 'git-config', 'git-count-objects', 'git-daemon',
|
||||
'git-describe', 'git-diff', 'git-diff-files', 'git-diff-index',
|
||||
'git-difftool', 'git-difftool--helper', 'git-diff-tree',
|
||||
'gitdpkgname', 'git-fast-export', 'git-fast-import', 'git-fetch',
|
||||
'git-fetch-pack', 'git-fetch--tool', 'git-filter-branch', 'gitfm',
|
||||
'git-fmt-merge-msg', 'git-for-each-ref', 'git-format-patch',
|
||||
'git-fsck', 'git-fsck-objects', 'git-gc', 'git-get-tar-commit-id',
|
||||
'git-grep', 'git-hash-object', 'git-help', 'git-http-fetch',
|
||||
'git-http-push', 'git-imap-send', 'git-index-pack', 'git-init',
|
||||
'git-init-db', 'git-instaweb', 'gitkeys', 'git-log',
|
||||
'git-lost-found', 'git-ls-files', 'git-ls-remote', 'git-ls-tree',
|
||||
'git-mailinfo', 'git-mailsplit', 'git-merge', 'git-merge-base',
|
||||
'git-merge-file', 'git-merge-index', 'git-merge-octopus',
|
||||
'git-merge-one-file', 'git-merge-ours', 'git-merge-recursive',
|
||||
'git-merge-resolve', 'git-merge-subtree', 'git-mergetool',
|
||||
'git-mergetool--lib', 'git-merge-tree', 'gitmkdirs', 'git-mktag',
|
||||
'git-mktree', 'gitmount', 'git-mv', 'git-name-rev',
|
||||
'git-pack-objects', 'git-pack-redundant', 'git-pack-refs',
|
||||
'git-parse-remote', 'git-patch-id', 'git-peek-remote', 'git-prune',
|
||||
'git-prune-packed', 'gitps', 'git-pull', 'git-push',
|
||||
'git-quiltimport', 'git-read-tree', 'git-rebase',
|
||||
'git-rebase--interactive', 'git-receive-pack', 'git-reflog',
|
||||
'gitregrep', 'git-relink', 'git-remote', 'git-repack',
|
||||
'git-repo-config', 'git-request-pull', 'git-rerere', 'git-reset',
|
||||
'git-revert', 'git-rev-list', 'git-rev-parse', 'gitrfgrep',
|
||||
'gitrgrep', 'git-rm', 'git-send-pack', 'git-shell', 'git-shortlog',
|
||||
'git-show', 'git-show-branch', 'git-show-index', 'git-show-ref',
|
||||
'git-sh-setup', 'git-stage', 'git-stash', 'git-status',
|
||||
'git-stripspace', 'git-submodule', 'git-svn', 'git-symbolic-ref',
|
||||
'git-tag', 'git-tar-tree', 'gitunpack', 'git-unpack-file',
|
||||
'git-unpack-objects', 'git-update-index', 'git-update-ref',
|
||||
'git-update-server-info', 'git-upload-archive', 'git-upload-pack',
|
||||
'git-var', 'git-verify-pack', 'git-verify-tag', 'gitview',
|
||||
'git-web--browse', 'git-whatchanged', 'gitwhich', 'gitwipe',
|
||||
'git-write-tree', 'gitxgrep',
|
||||
|
||||
'head', 'hexdump', 'hostname',
|
||||
|
||||
'id', 'ifconfig', 'ifdown', 'ifup', 'igawk', 'install',
|
||||
|
||||
'join',
|
||||
|
||||
'kbd_mode','kbdrate', 'kdialog', 'kfile', 'kill', 'killall',
|
||||
|
||||
'lame', 'last', 'lastb', 'ld', 'ld86', 'ldd', 'less', 'lex', 'link',
|
||||
'ln', 'loadkeys', 'loadunimap', 'locate', 'lockfile', 'login',
|
||||
'logname', 'lp', 'lpr', 'ls', 'lsattr', 'lsmod', 'lsmod.old',
|
||||
'lspci', 'ltrace', 'lynx',
|
||||
|
||||
'm4', 'make', 'man', 'mapscrn', 'mesg', 'mkdir', 'mkfifo',
|
||||
'mknod', 'mktemp', 'more', 'mount', 'mplayer', 'msgfmt', 'mv',
|
||||
|
||||
'namei', 'nano', 'nasm', 'nawk', 'netstat', 'nice',
|
||||
'nisdomainname', 'nl', 'nm', 'nm86', 'nmap', 'nohup', 'nop',
|
||||
|
||||
'od', 'openvt',
|
||||
|
||||
'passwd', 'patch', 'pcregrep', 'pcretest', 'perl', 'perror',
|
||||
'pgawk', 'pidof', 'ping', 'pr', 'procmail', 'prune', 'ps', 'pstree',
|
||||
'ps2ascii', 'ps2epsi', 'ps2frag', 'ps2pdf', 'ps2ps', 'psbook',
|
||||
'psmerge', 'psnup', 'psresize', 'psselect', 'pstops',
|
||||
|
||||
'rbash', 'rcs', 'rcs2log', 'read', 'readlink', 'red', 'resizecons',
|
||||
'rev', 'rm', 'rmdir', 'rsh', 'run-parts',
|
||||
|
||||
'sash', 'scp', 'screen', 'sed', 'seq', 'sendmail', 'setfont',
|
||||
'setkeycodes', 'setleds', 'setmetamode', 'setserial', 'setterm',
|
||||
'sh', 'showkey', 'shred', 'size', 'size86', 'skill', 'sleep',
|
||||
'slogin', 'snice', 'sort', 'sox', 'split', 'ssed', 'ssh', 'ssh-add',
|
||||
'ssh-agent', 'ssh-keygen', 'ssh-keyscan', 'stat', 'strace',
|
||||
'strings', 'strip', 'stty', 'su', 'sudo', 'suidperl', 'sum', 'svn',
|
||||
'svnadmin', 'svndumpfilter', 'svnlook', 'svnmerge', 'svnmucc',
|
||||
'svnserve', 'svnshell', 'svnsync', 'svnversion', 'svnwrap', 'sync',
|
||||
|
||||
'tac', 'tail', 'tar', 'tee', 'tempfile', 'touch', 'tr', 'tree',
|
||||
'true',
|
||||
|
||||
'umount', 'uname', 'unicode_start', 'unicode_stop', 'uniq',
|
||||
'unlink', 'unzip', 'updatedb', 'updmap', 'uptime', 'users',
|
||||
'utmpdump', 'uuidgen',
|
||||
|
||||
'valgrind', 'vdir', 'vi', 'vim', 'vmstat',
|
||||
|
||||
'w', 'wall', 'watch', 'wc', 'wget', 'whatis', 'whereis',
|
||||
'which', 'whiptail', 'who', 'whoami', 'whois', 'wine', 'wineboot',
|
||||
'winebuild', 'winecfg', 'wineconsole', 'winedbg', 'winedump',
|
||||
'winefile', 'wodim', 'write',
|
||||
|
||||
'xargs', 'xhost', 'xmodmap', 'xset',
|
||||
|
||||
'yacc', 'yes', 'ypdomainname',
|
||||
|
||||
'zcat', 'zcmp', 'zdiff', 'zdump', 'zegrep', 'zfgrep', 'zforce',
|
||||
'zgrep', 'zip', 'zipgrep', 'zipinfo', 'zless', 'zmore', 'znew',
|
||||
'zsh', 'zsoelim'
|
||||
),
|
||||
3 => array(
|
||||
'alias', 'bg', 'bind', 'break', 'builtin', 'cd', 'command',
|
||||
'compgen', 'complete', 'continue', 'declare', 'dirs', 'disown',
|
||||
'echo', 'enable', 'eval', 'exec', 'exit', 'export', 'fc',
|
||||
'fg', 'getopts', 'hash', 'help', 'history', 'jobs', 'let',
|
||||
'local', 'logout', 'popd', 'printf', 'pushd', 'pwd', 'readonly',
|
||||
'return', 'shift', 'shopt', 'source', 'suspend', 'test', 'times',
|
||||
'trap', 'type', 'typeset', 'ulimit', 'umask', 'unalias', 'unset',
|
||||
'wait'
|
||||
)
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
'(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>', ';;', '`'
|
||||
),
|
||||
'CASE_SENSITIVE' => array(
|
||||
GESHI_COMMENTS => false,
|
||||
1 => true,
|
||||
2 => true,
|
||||
3 => true
|
||||
),
|
||||
'STYLES' => array(
|
||||
'KEYWORDS' => array(
|
||||
1 => 'color: #000000; font-weight: bold;',
|
||||
2 => 'color: #c20cb9; font-weight: bold;',
|
||||
3 => 'color: #7a0874; font-weight: bold;'
|
||||
),
|
||||
'COMMENTS' => array(
|
||||
0 => 'color: #666666; font-style: italic;',
|
||||
1 => 'color: #800000;',
|
||||
2 => 'color: #cc0000; font-style: italic;',
|
||||
3 => 'color: #000000; font-weight: bold;'
|
||||
),
|
||||
'ESCAPE_CHAR' => array(
|
||||
1 => 'color: #000099; font-weight: bold;',
|
||||
2 => 'color: #007800;',
|
||||
3 => 'color: #007800;',
|
||||
4 => 'color: #007800;',
|
||||
5 => 'color: #780078;',
|
||||
'HARD' => 'color: #000099; font-weight: bold;'
|
||||
),
|
||||
'BRACKETS' => array(
|
||||
0 => 'color: #7a0874; font-weight: bold;'
|
||||
),
|
||||
'STRINGS' => array(
|
||||
0 => 'color: #ff0000;',
|
||||
'HARD' => 'color: #ff0000;'
|
||||
),
|
||||
'NUMBERS' => array(
|
||||
0 => 'color: #000000;'
|
||||
),
|
||||
'METHODS' => array(
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
0 => 'color: #000000; font-weight: bold;'
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
0 => 'color: #007800;',
|
||||
1 => 'color: #007800;',
|
||||
2 => 'color: #007800;',
|
||||
4 => 'color: #007800;',
|
||||
5 => 'color: #660033;'
|
||||
),
|
||||
'SCRIPT' => array(
|
||||
)
|
||||
),
|
||||
'URLS' => array(
|
||||
1 => '',
|
||||
2 => '',
|
||||
3 => ''
|
||||
),
|
||||
'OOLANG' => false,
|
||||
'OBJECT_SPLITTERS' => array(
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
//Variables (will be handled by comment_regexps)
|
||||
0 => "\\$\\{[a-zA-Z_][a-zA-Z0-9_]*?\\}",
|
||||
//Variables without braces
|
||||
1 => "\\$[a-zA-Z_][a-zA-Z0-9_]*",
|
||||
//Variable assignment
|
||||
2 => "(?<![\.a-zA-Z_\-])([a-zA-Z_][a-zA-Z0-9_]*?)(?==)",
|
||||
//Shorthand shell variables
|
||||
4 => "\\$[*#\$\\-\\?!\d]",
|
||||
//Parameters of commands
|
||||
5 => "(?<=\s)--?[0-9a-zA-Z\-]+(?=[\s=]|<(?:SEMI|PIPE)>|$)"
|
||||
),
|
||||
'STRICT_MODE_APPLIES' => GESHI_NEVER,
|
||||
'SCRIPT_DELIMITERS' => array(
|
||||
),
|
||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
||||
),
|
||||
'TAB_WIDTH' => 4,
|
||||
'PARSER_CONTROL' => array(
|
||||
'COMMENTS' => array(
|
||||
'DISALLOWED_BEFORE' => '$'
|
||||
),
|
||||
'KEYWORDS' => array(
|
||||
'DISALLOWED_BEFORE' => "(?<![\.\-a-zA-Z0-9_\$\#])",
|
||||
'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%=\\/])"
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
150
thirdparty/geshi/geshi/javascript.php
vendored
150
thirdparty/geshi/geshi/javascript.php
vendored
@@ -1,150 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************
|
||||
* javascript.php
|
||||
* --------------
|
||||
* Author: Ben Keen (ben.keen@gmail.com)
|
||||
* Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
|
||||
* Release Version: 1.0.8.8
|
||||
* Date Started: 2004/06/20
|
||||
*
|
||||
* JavaScript language file for GeSHi.
|
||||
*
|
||||
* CHANGES
|
||||
* -------
|
||||
* 2008/05/23 (1.0.7.22)
|
||||
* - Added description of extra language features (SF#1970248)
|
||||
* 2004/11/27 (1.0.1)
|
||||
* - Added support for multiple object splitters
|
||||
* 2004/10/27 (1.0.0)
|
||||
* - First Release
|
||||
*
|
||||
* TODO (updated 2004/11/27)
|
||||
* -------------------------
|
||||
*
|
||||
*************************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
$language_data = array (
|
||||
'LANG_NAME' => 'Javascript',
|
||||
'COMMENT_SINGLE' => array(1 => '//'),
|
||||
'COMMENT_MULTI' => array('/*' => '*/'),
|
||||
//Regular Expressions
|
||||
'COMMENT_REGEXP' => array(2 => "/(?<=[\\s^])s\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])m?\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\,\\;\\)])/iU"),
|
||||
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
|
||||
'QUOTEMARKS' => array("'", '"'),
|
||||
'ESCAPE_CHAR' => '\\',
|
||||
'KEYWORDS' => array(
|
||||
1 => array(
|
||||
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
|
||||
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
|
||||
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
|
||||
'while', 'write', 'with'
|
||||
),
|
||||
2 => array(
|
||||
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
|
||||
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
|
||||
'protected', 'public', 'super', 'true', 'use', 'var'
|
||||
),
|
||||
3 => array(
|
||||
// common functions for Window object
|
||||
'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
|
||||
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
|
||||
'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
|
||||
'stop',
|
||||
)
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
'(', ')', '[', ']', '{', '}',
|
||||
'+', '-', '*', '/', '%',
|
||||
'!', '@', '&', '|', '^',
|
||||
'<', '>', '=',
|
||||
',', ';', '?', ':'
|
||||
),
|
||||
'CASE_SENSITIVE' => array(
|
||||
GESHI_COMMENTS => false,
|
||||
1 => false,
|
||||
2 => false,
|
||||
3 => false
|
||||
),
|
||||
'STYLES' => array(
|
||||
'KEYWORDS' => array(
|
||||
1 => 'color: #000066; font-weight: bold;',
|
||||
2 => 'color: #003366; font-weight: bold;',
|
||||
3 => 'color: #000066;'
|
||||
),
|
||||
'COMMENTS' => array(
|
||||
1 => 'color: #006600; font-style: italic;',
|
||||
2 => 'color: #009966; font-style: italic;',
|
||||
'MULTI' => 'color: #006600; font-style: italic;'
|
||||
),
|
||||
'ESCAPE_CHAR' => array(
|
||||
0 => 'color: #000099; font-weight: bold;'
|
||||
),
|
||||
'BRACKETS' => array(
|
||||
0 => 'color: #009900;'
|
||||
),
|
||||
'STRINGS' => array(
|
||||
0 => 'color: #3366CC;'
|
||||
),
|
||||
'NUMBERS' => array(
|
||||
0 => 'color: #CC0000;'
|
||||
),
|
||||
'METHODS' => array(
|
||||
1 => 'color: #660066;'
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
0 => 'color: #339933;'
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
),
|
||||
'SCRIPT' => array(
|
||||
0 => '',
|
||||
1 => '',
|
||||
2 => '',
|
||||
3 => ''
|
||||
)
|
||||
),
|
||||
'URLS' => array(
|
||||
1 => '',
|
||||
2 => '',
|
||||
3 => ''
|
||||
),
|
||||
'OOLANG' => true,
|
||||
'OBJECT_SPLITTERS' => array(
|
||||
1 => '.'
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
),
|
||||
'STRICT_MODE_APPLIES' => GESHI_MAYBE,
|
||||
'SCRIPT_DELIMITERS' => array(
|
||||
0 => array(
|
||||
'<script type="text/javascript">' => '</script>'
|
||||
),
|
||||
1 => array(
|
||||
'<script language="javascript">' => '</script>'
|
||||
)
|
||||
),
|
||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
||||
0 => true,
|
||||
1 => true
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
238
thirdparty/geshi/geshi/jquery.php
vendored
238
thirdparty/geshi/geshi/jquery.php
vendored
@@ -1,238 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************
|
||||
* jquery.php
|
||||
* --------------
|
||||
* Author: Rob Loach (http://www.robloach.net)
|
||||
* Copyright: (c) 2009 Rob Loach (http://www.robloach.net)
|
||||
* Release Version: 1.0.8.8
|
||||
* Date Started: 2009/07/20
|
||||
*
|
||||
* jQuery 1.3 language file for GeSHi.
|
||||
*
|
||||
* CHANGES
|
||||
* -------
|
||||
* 2009/07/20 (1.0.8.5)
|
||||
* - First Release
|
||||
*
|
||||
* TODO (updated 2009/07/20)
|
||||
* -------------------------
|
||||
*
|
||||
*************************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
$language_data = array (
|
||||
'LANG_NAME' => 'jQuery',
|
||||
'COMMENT_SINGLE' => array(1 => '//'),
|
||||
'COMMENT_MULTI' => array('/*' => '*/'),
|
||||
//Regular Expressions
|
||||
'COMMENT_REGEXP' => array(2 => "/(?<=[\\s^])s\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])m?\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\,\\;\\)])/iU"),
|
||||
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
|
||||
'QUOTEMARKS' => array("'", '"'),
|
||||
'ESCAPE_CHAR' => '\\',
|
||||
'KEYWORDS' => array(
|
||||
1 => array(
|
||||
'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
|
||||
'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
|
||||
'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
|
||||
'while', 'write', 'with'
|
||||
),
|
||||
2 => array(
|
||||
'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
|
||||
'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
|
||||
'protected', 'public', 'super', 'true', 'use', 'var'
|
||||
),
|
||||
3 => array(
|
||||
// common functions for Window object
|
||||
'alert', 'back', 'close', 'confirm', 'forward', 'home',
|
||||
'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
|
||||
'onresize', 'onunload', 'open', 'print', 'prompt', 'status',
|
||||
//'blur', 'focus', 'scroll', // Duplicate with kw9
|
||||
//'stop', //Duplicate with kw10
|
||||
),
|
||||
4 => array(
|
||||
// jQuery Core Functions
|
||||
'jQuery', 'each', 'size', 'length', 'selector', 'context', 'eq',
|
||||
'index', 'data', 'removeData', 'queue', 'dequeue', 'noConflict'
|
||||
//'get', //Duplicate with kw11
|
||||
),
|
||||
5 => array(
|
||||
// jQuery Attribute Functions
|
||||
'attr', 'removeAttr', 'addClass', 'hasClass', 'removeClass', 'toggleClass',
|
||||
'html', 'text', 'val',
|
||||
),
|
||||
6 => array(
|
||||
// jQuery Traversing Functions
|
||||
'filter', 'not', 'slice', 'add', 'children', 'closest',
|
||||
'contents', 'find', 'next', 'nextAll', 'parent', 'parents',
|
||||
'prev', 'prevAll', 'siblings', 'andSelf', 'end',
|
||||
//'is', //Dup with kw1
|
||||
//'offsetParent', //Duplicate with kw8
|
||||
//'map', //Duplicate with kw12
|
||||
),
|
||||
7 => array(
|
||||
// jQuery Manipulation Functions
|
||||
'append', 'appendTo', 'prepend', 'prependTo', 'after', 'before', 'insertAfter',
|
||||
'insertBefore', 'wrap', 'wrapAll', 'wrapInner', 'replaceWith', 'replaceAll',
|
||||
'empty', 'remove', 'clone',
|
||||
),
|
||||
8 => array(
|
||||
// jQuery CSS Functions
|
||||
'css', 'offset', 'offsetParent', 'position', 'scrollTop', 'scrollLeft',
|
||||
'height', 'width', 'innerHeight', 'innerWidth', 'outerHeight', 'outerWidth',
|
||||
),
|
||||
9 => array(
|
||||
// jQuery Events Functions
|
||||
'ready', 'bind', 'one', 'trigger', 'triggerHandler', 'unbind', 'live',
|
||||
'die', 'hover', 'blur', 'change', 'click', 'dblclick', 'error',
|
||||
'focus', 'keydown', 'keypress', 'keyup', 'mousedown', 'mouseenter',
|
||||
'mouseleave', 'mousemove', 'mouseout', 'mouseover', 'mouseup', 'resize',
|
||||
'scroll', 'select', 'submit', 'unload',
|
||||
//'toggle', //Duplicate with kw10
|
||||
//'load', //Duplicate with kw11
|
||||
),
|
||||
10 => array(
|
||||
// jQuery Effects Functions
|
||||
'show', 'hide', 'toggle', 'slideDown', 'slideUp', 'slideToggle', 'fadeIn',
|
||||
'fadeOut', 'fadeTo', 'animate', 'stop',
|
||||
),
|
||||
11 => array(
|
||||
// jQuery Ajax Functions
|
||||
'ajax', 'load', 'get', 'getJSON', 'getScript', 'post', 'ajaxComplete',
|
||||
'ajaxError', 'ajaxSend', 'ajaxStart', 'ajaxStop', 'ajaxSuccess', 'ajaxSetup',
|
||||
'serialize', 'serializeArray',
|
||||
),
|
||||
12 => array(
|
||||
// jQuery Utility Functions
|
||||
'support', 'browser', 'version', 'boxModal', 'extend', 'grep', 'makeArray',
|
||||
'map', 'inArray', 'merge', 'unique', 'isArray', 'isFunction', 'trim',
|
||||
'param',
|
||||
),
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
0 => array(
|
||||
'(', ')', '[', ']', '{', '}',
|
||||
'+', '-', '*', '/', '%',
|
||||
'!', '@', '&', '|', '^',
|
||||
'<', '>', '=',
|
||||
',', ';', '?', ':'
|
||||
),
|
||||
1 => array(
|
||||
'$'
|
||||
)
|
||||
),
|
||||
'CASE_SENSITIVE' => array(
|
||||
GESHI_COMMENTS => false,
|
||||
1 => false,
|
||||
2 => false,
|
||||
3 => false,
|
||||
4 => false,
|
||||
5 => false,
|
||||
6 => false,
|
||||
7 => false,
|
||||
8 => false,
|
||||
9 => false,
|
||||
10 => false,
|
||||
11 => false,
|
||||
12 => false
|
||||
),
|
||||
'STYLES' => array(
|
||||
'KEYWORDS' => array(
|
||||
1 => 'color: #000066; font-weight: bold;',
|
||||
2 => 'color: #003366; font-weight: bold;',
|
||||
3 => 'color: #000066;',
|
||||
4 => 'color: #000066;',
|
||||
5 => 'color: #000066;',
|
||||
6 => 'color: #000066;',
|
||||
7 => 'color: #000066;',
|
||||
8 => 'color: #000066;',
|
||||
9 => 'color: #000066;',
|
||||
10 => 'color: #000066;',
|
||||
11 => 'color: #000066;',
|
||||
12 => 'color: #000066;'
|
||||
),
|
||||
'COMMENTS' => array(
|
||||
1 => 'color: #006600; font-style: italic;',
|
||||
2 => 'color: #009966; font-style: italic;',
|
||||
'MULTI' => 'color: #006600; font-style: italic;'
|
||||
),
|
||||
'ESCAPE_CHAR' => array(
|
||||
0 => 'color: #000099; font-weight: bold;'
|
||||
),
|
||||
'BRACKETS' => array(
|
||||
0 => 'color: #009900;'
|
||||
),
|
||||
'STRINGS' => array(
|
||||
0 => 'color: #3366CC;'
|
||||
),
|
||||
'NUMBERS' => array(
|
||||
0 => 'color: #CC0000;'
|
||||
),
|
||||
'METHODS' => array(
|
||||
1 => 'color: #660066;'
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
0 => 'color: #339933;',
|
||||
1 => 'color: #000066;'
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
),
|
||||
'SCRIPT' => array(
|
||||
0 => '',
|
||||
1 => '',
|
||||
2 => '',
|
||||
3 => ''
|
||||
)
|
||||
),
|
||||
'URLS' => array(
|
||||
1 => '',
|
||||
2 => '',
|
||||
3 => '',
|
||||
4 => 'http://docs.jquery.com/Core/{FNAME}',
|
||||
5 => 'http://docs.jquery.com/Attributes/{FNAME}',
|
||||
6 => 'http://docs.jquery.com/Traversing/{FNAME}',
|
||||
7 => 'http://docs.jquery.com/Manipulation/{FNAME}',
|
||||
8 => 'http://docs.jquery.com/CSS/{FNAME}',
|
||||
9 => 'http://docs.jquery.com/Events/{FNAME}',
|
||||
10 => 'http://docs.jquery.com/Effects/{FNAME}',
|
||||
11 => 'http://docs.jquery.com/Ajax/{FNAME}',
|
||||
12 => 'http://docs.jquery.com/Utilities/{FNAME}'
|
||||
),
|
||||
'OOLANG' => true,
|
||||
'OBJECT_SPLITTERS' => array(
|
||||
1 => '.'
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
),
|
||||
'STRICT_MODE_APPLIES' => GESHI_MAYBE,
|
||||
'SCRIPT_DELIMITERS' => array(
|
||||
0 => array(
|
||||
'<script type="text/javascript">' => '</script>'
|
||||
),
|
||||
1 => array(
|
||||
'<script language="javascript">' => '</script>'
|
||||
)
|
||||
),
|
||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
||||
0 => true,
|
||||
1 => true
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
1114
thirdparty/geshi/geshi/php.php
vendored
1114
thirdparty/geshi/geshi/php.php
vendored
File diff suppressed because it is too large
Load Diff
157
thirdparty/geshi/geshi/xml.php
vendored
157
thirdparty/geshi/geshi/xml.php
vendored
@@ -1,157 +0,0 @@
|
||||
<?php
|
||||
/*************************************************************************************
|
||||
* xml.php
|
||||
* -------
|
||||
* Author: Nigel McNie (nigel@geshi.org)
|
||||
* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
|
||||
* Release Version: 1.0.8.8
|
||||
* Date Started: 2004/09/01
|
||||
*
|
||||
* XML language file for GeSHi. Based on the idea/file by Christian Weiske
|
||||
*
|
||||
* CHANGES
|
||||
* -------
|
||||
* 2008/05/23 (1.0.7.22)
|
||||
* - Added description of extra language features (SF#1970248)
|
||||
* 2005/12/28 (1.0.2)
|
||||
* - Removed escape character for strings
|
||||
* 2004/11/27 (1.0.1)
|
||||
* - Added support for multiple object splitters
|
||||
* 2004/10/27 (1.0.0)
|
||||
* - First Release
|
||||
*
|
||||
* TODO (updated 2004/11/27)
|
||||
* -------------------------
|
||||
* * Check regexps work and correctly highlight XML stuff and nothing else
|
||||
*
|
||||
*************************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
$language_data = array (
|
||||
'LANG_NAME' => 'XML',
|
||||
'COMMENT_SINGLE' => array(),
|
||||
'COMMENT_MULTI' => array(),
|
||||
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
|
||||
'QUOTEMARKS' => array("'", '"'),
|
||||
'ESCAPE_CHAR' => '',
|
||||
'KEYWORDS' => array(
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
),
|
||||
'CASE_SENSITIVE' => array(
|
||||
GESHI_COMMENTS => false,
|
||||
),
|
||||
'STYLES' => array(
|
||||
'KEYWORDS' => array(
|
||||
),
|
||||
'COMMENTS' => array(
|
||||
),
|
||||
'ESCAPE_CHAR' => array(
|
||||
0 => 'color: #000099; font-weight: bold;'
|
||||
),
|
||||
'BRACKETS' => array(
|
||||
0 => 'color: #66cc66;'
|
||||
),
|
||||
'STRINGS' => array(
|
||||
0 => 'color: #ff0000;'
|
||||
),
|
||||
'NUMBERS' => array(
|
||||
0 => 'color: #cc66cc;'
|
||||
),
|
||||
'METHODS' => array(
|
||||
),
|
||||
'SYMBOLS' => array(
|
||||
0 => 'color: #66cc66;'
|
||||
),
|
||||
'SCRIPT' => array(
|
||||
-1 => 'color: #808080; font-style: italic;', // comments
|
||||
0 => 'color: #00bbdd;',
|
||||
1 => 'color: #ddbb00;',
|
||||
2 => 'color: #339933;',
|
||||
3 => 'color: #009900;'
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
0 => 'color: #000066;',
|
||||
1 => 'color: #000000; font-weight: bold;',
|
||||
2 => 'color: #000000; font-weight: bold;'
|
||||
)
|
||||
),
|
||||
'URLS' => array(
|
||||
),
|
||||
'OOLANG' => false,
|
||||
'OBJECT_SPLITTERS' => array(
|
||||
),
|
||||
'REGEXPS' => array(
|
||||
0 => array(//attribute names
|
||||
GESHI_SEARCH => '([a-z_:][\w\-\.:]*)(=)',
|
||||
GESHI_REPLACE => '\\1',
|
||||
GESHI_MODIFIERS => 'i',
|
||||
GESHI_BEFORE => '',
|
||||
GESHI_AFTER => '\\2'
|
||||
),
|
||||
1 => array(//Initial header line
|
||||
GESHI_SEARCH => '(<[\/?|(\?xml)]?[a-z_:][\w\-\.:]*(\??>)?)',
|
||||
GESHI_REPLACE => '\\1',
|
||||
GESHI_MODIFIERS => 'i',
|
||||
GESHI_BEFORE => '',
|
||||
GESHI_AFTER => ''
|
||||
),
|
||||
2 => array(//Tag end markers
|
||||
GESHI_SEARCH => '(([\/|\?])?>)',
|
||||
GESHI_REPLACE => '\\1',
|
||||
GESHI_MODIFIERS => 'i',
|
||||
GESHI_BEFORE => '',
|
||||
GESHI_AFTER => ''
|
||||
),
|
||||
),
|
||||
'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
|
||||
'SCRIPT_DELIMITERS' => array(
|
||||
-1 => array(
|
||||
'<!--' => '-->'
|
||||
),
|
||||
0 => array(
|
||||
'<!DOCTYPE' => '>'
|
||||
),
|
||||
1 => array(
|
||||
'&' => ';'
|
||||
),
|
||||
2 => array(
|
||||
'<![CDATA[' => ']]>'
|
||||
),
|
||||
3 => array(
|
||||
'<' => '>'
|
||||
)
|
||||
),
|
||||
'HIGHLIGHT_STRICT_BLOCK' => array(
|
||||
-1 => false,
|
||||
0 => false,
|
||||
1 => false,
|
||||
2 => false,
|
||||
3 => true
|
||||
),
|
||||
'TAB_WIDTH' => 2,
|
||||
'PARSER_CONTROL' => array(
|
||||
'ENABLE_FLAGS' => array(
|
||||
'NUMBERS' => GESHI_NEVER
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user