Skip to content
Browse files

Initial checkin of old 6.0 pastebin code.

  • Loading branch information...
0 parents commit 8e98696a9d5d54e472ed9ce9fdfd8aa24d047bb5 Christian Höltje committed Apr 22, 2010
Showing with 11,817 additions and 0 deletions.
  1. +27 −0 CHANGES
  2. +93 −0 INSTALL
  3. +283 −0 LICENCE
  4. +33 −0 README
  5. +13 −0 UPGRADE
  6. +207 −0 lib/config/default.conf.php
  7. +460 −0 lib/geshi/contrib/cssgen.php
  8. +193 −0 lib/geshi/contrib/example.php
  9. +32 −0 lib/geshi/docs/BUGS
  10. +251 −0 lib/geshi/docs/CHANGES
  11. +340 −0 lib/geshi/docs/COPYING
  12. +35 −0 lib/geshi/docs/README
  13. +99 −0 lib/geshi/docs/THANKS
  14. +66 −0 lib/geshi/docs/TODO
  15. +5 −0 lib/geshi/docs/geshi-doc.txt
  16. +2,712 −0 lib/geshi/geshi.php
  17. +957 −0 lib/geshi/geshi/actionscript-french.php
  18. +199 −0 lib/geshi/geshi/actionscript.php
  19. +135 −0 lib/geshi/geshi/ada.php
  20. +173 −0 lib/geshi/geshi/apache.php
  21. +118 −0 lib/geshi/geshi/applescript.php
  22. +200 −0 lib/geshi/geshi/asm.php
  23. +155 −0 lib/geshi/geshi/asp.php
  24. +196 −0 lib/geshi/geshi/autoit.php
  25. +130 −0 lib/geshi/geshi/bash.php
  26. +187 −0 lib/geshi/geshi/blitzbasic.php
  27. +144 −0 lib/geshi/geshi/c.php
  28. +176 −0 lib/geshi/geshi/c_mac.php
  29. +127 −0 lib/geshi/geshi/caddcl.php
  30. +187 −0 lib/geshi/geshi/cadlisp.php
  31. +128 −0 lib/geshi/geshi/cfdg.php
  32. +327 −0 lib/geshi/geshi/cfm.php
  33. +174 −0 lib/geshi/geshi/cpp.php
  34. +233 −0 lib/geshi/geshi/csharp.php
  35. 0 lib/geshi/geshi/css-gen.cfg
  36. +178 −0 lib/geshi/geshi/css.php
  37. +287 −0 lib/geshi/geshi/d.php
  38. +272 −0 lib/geshi/geshi/delphi.php
  39. +186 −0 lib/geshi/geshi/diff.php
  40. +128 −0 lib/geshi/geshi/div.php
  41. +179 −0 lib/geshi/geshi/dos.php
  42. +397 −0 lib/geshi/geshi/eiffel.php
  43. +158 −0 lib/geshi/geshi/fortran.php
  44. +137 −0 lib/geshi/geshi/freebasic.php
  45. +504 −0 lib/geshi/geshi/gml.php
  46. +256 −0 lib/geshi/geshi/html4strict.php
  47. +125 −0 lib/geshi/geshi/ini.php
  48. +215 −0 lib/geshi/geshi/inno.php
Sorry, we could not display the entire diff because it was too big.
27 CHANGES
@@ -0,0 +1,27 @@
+Pastebin History
+=================
+v0.60 - 10-Jul-07 - Lots of changes inc faster file-based storage, translation
+ support and ability to delete your own posts, also changed
+ licence to Affero GPL
+v0.50 - 07-May-06 - Added option of expiry time to posts - see UPGRADE file
+v0.45 - 28-Apr-06 - Upgraded to latest version of GeSHi
+v0.44 - 26-Apr-06 - Copy to clipboard (IE only at the moment)
+v0.43 - 26-Apr-06 - Fixed download/diff links when script is renamed
+v0.42 - 23-Apr-06 - Bug fix to database wrapper
+v0.40 - 23-Apr-06 - Cleaned up code for wider release
+v0.31 - 14-Jul-05 - Fixed XSS Flaw
+v0.30 - 01-May-05 - Added Geshi text formatter, switch to GPL licence
+ Added diffs
+ Variety of minor layout changes
+v0.24 - 26-May-04 - finally added tab key support within textarea
+ (suggested by Droll a year ago!). Also removed the
+ 80 col word wrapping
+v0.23 - 02-Mar-03 - add Postgres support (thanks Tim Hunter) and a few
+ configuration options to make "non php" pastebins
+ easy to set up.
+v0.22 - 01-Feb-03 - minor tweaks to maintain xhtml compliance
+v0.21 - 23-Jan-03 - prevented more mischief with long poster names
+v0.20 - 22-Jan-03 - heuristic keyword hyperlinking to php manual
+v0.12 - 19-Jan-03 - stripped html tags from poster name
+v0.11 - 14-Jan-03 - textarea entity encoding bug fix (thanks Greedo)
+v0.1 - 04-Sep-02 - First version
93 INSTALL
@@ -0,0 +1,93 @@
+Requirements:
+=============
+- PHP 4.1 or higher (works with register-globals off)
+- MySQL database server (now optional)
+
+- For short url generation, Apache with mod_rewrite available. Something
+ like the following configuration options should be used
+
+ RewriteEngine on
+ RewriteRule /([a-z0-9]+) /pastebin.php?show=$1
+
+ If mod_rewrite is not available, modify the shorturl() function to
+ generate 'normal' urls.
+
+- For instant "private" pastebins on subdomains, you'll need a wildcard
+ DNS entry pointing at your server and ensure that pastebin virtual host
+ is the first virtual host on your server. There may be other ways to
+ accomplish this, this was just the easiest for me.
+
+
+Installation
+============
+
+The tarball contains two main directories. You'll need a virtual host
+set up something like this
+
+<VirtualHost *>
+ DocumentRoot /path/to/pastebin/public_html
+ ServerName your.domain.name.com
+
+ php_value include_path .:/path/to/pastebin/lib
+ php_value register_globals off
+ DirectoryIndex pastebin.php
+ RewriteEngine on
+ RewriteRule /([a-z0-9]+) /pastebin.php?show=$1
+
+</VirtualHost>
+
+The main element here is to ensure that the lib directory is on the search
+path. You could alternatively place your settings in an .htaccess file if
+you wish
+
+You can, if you wish, simply copy the contents of the lib directory into
+the same directory as pastebin.php, but it's better practice to prevent it
+being accessible via HTTP.
+
+
+If using the "mysql" storage engine, setup a new database with the following
+table
+
+CREATE TABLE `pastebin` (
+ `pid` int(11) NOT NULL auto_increment,
+ `poster` varchar(16) default NULL,
+ `posted` datetime default NULL,
+ `code` text,
+ `parent_pid` int(11) default '0',
+ `format` varchar(16) default NULL,
+ `codefmt` mediumtext,
+ `codecss` text,
+ `domain` varchar(255) default '',
+ `expires` DATETIME,
+ `expiry_flag` ENUM('d','m', 'f') NOT NULL DEFAULT 'm',
+
+ PRIMARY KEY (`pid`),
+ KEY `domain` (`domain`),
+ KEY `parent_pid`,
+ KEY `expires`
+ );
+
+create table recent
+(
+ domain varchar(255),
+ pid int not null,
+ seq_no int not null,
+
+ primary key(domain,seq_no)
+);
+
+
+If using the "file" storage engine, make sure the public_html/../posts
+directory is writable by the webserver.
+
+Now you need to edit you base configuration file. Make a copy of
+lib/config/default.conf.php and call the file my.domain.conf.php
+
+For example, if your domain is superpaste.com, you'd call the file
+superpaste.com.conf.php
+
+Edit the file to configure the software to your requirements. You
+can create alternative configurations for other host names simply
+by creating a new configuration file.
+
+That's it, you're good to go. Good luck!
283 LICENCE
@@ -0,0 +1,283 @@
+ The Pastebin software application is a licenced using the Affero GPL
+
+ Vague and completely-non-legally-binding explanation of the Affero GPL and
+ why I've used it: The original GPL guarantees that anyone who gets a binary
+ version of the software also gets the source code so they can modify it.
+ Since users of websites never get the binary, just HTML pages, it is no
+ better a license than a BSD style license would be for them. The Affero GPL
+ adds to the GPL a requirement that anyone else using that code for their own
+ websites also does the courtesy of offering the source code to their users.
+
+ This software 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 Affero
+ General Public License for more details.
+
+ Questions about the Affero GPL: http://www.affero.org/oagf.html
+ Questions about the GPL: http://www.gnu.org/licenses/gpl-faq.html
+
+
+ A copy of the Affero General Public License follows.
+
+
+ Affero General Public License
+
+ Version 1, March 2002
+ Copyright (C) 2002 Affero Inc.
+ 510 Third Street - Suite 225, San Francisco, CA 94107, USA
+
+ This license is a modified version of the GNU General Public License
+ copyright (C) 1989, 1991 Free Software Foundation, Inc. made with
+ their permission. Section 2(d) has been added to cover use of software
+ over a computer network.
+ Everyone is permitted to copy and distribute verbatim copies of this
+ license document, but changing it is not allowed.
+ Preamble
+ The licenses for most software are designed to take away your freedom
+ to share and change it. By contrast, the Affero General Public License
+ is intended to guarantee your freedom to share and change free
+ software--to make sure the software is free for all its users. This
+ Public License applies to most of Affero's software and to any other
+ program whose authors commit to using it. (Some other Affero software
+ is covered by the GNU Library General Public License instead.) You can
+ apply it to your programs, too.
+ When we speak of free software, we are referring to freedom, not
+ price. This General Public License is designed to make sure that you
+ have the freedom to distribute copies of free software (and charge for
+ this service if you wish), that you receive source code or can get it
+ if you want it, that you can change the software or use pieces of it
+ in new free programs; and that you know you can do these things.
+ To protect your rights, we need to make restrictions that forbid
+ anyone to deny you these rights or to ask you to surrender the rights.
+ These restrictions translate to certain responsibilities for you if
+ you distribute copies of the software, or if you modify it.
+ For example, if you distribute copies of such a program, whether
+ gratis or for a fee, you must give the recipients all the rights that
+ you have. You must make sure that they, too, receive or can get the
+ source code. And you must show them these terms so they know their
+ rights.
+ We protect your rights with two steps: (1) copyright the software, and
+ (2) offer you this license which gives you legal permission to copy,
+ distribute and/or modify the software.
+ Also, for each author's protection and ours, we want to make certain
+ that everyone understands that there is no warranty for this free
+ software. If the software is modified by someone else and passed on,
+ we want its recipients to know that what they have is not the
+ original, so that any problems introduced by others will not reflect
+ on the original authors' reputations.
+ Finally, any free program is threatened constantly by software
+ patents. We wish to avoid the danger that redistributors of a free
+ program will individually obtain patent licenses, in effect making the
+ program proprietary. To prevent this, we have made it clear that any
+ patent must be licensed for everyone's free use or not licensed at
+ all.
+ The precise terms and conditions for copying, distribution and
+ modification follow.
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+ 0. This License applies to any program or other work which contains a
+ notice placed by the copyright holder saying it may be distributed
+ under the terms of this Affero General Public License. The "Program",
+ below, refers to any such program or work, and a "work based on the
+ Program" means either the Program or any derivative work under
+ copyright law: that is to say, a work containing the Program or a
+ portion of it, either verbatim or with modifications and/or translated
+ into another language. (Hereinafter, translation is included without
+ limitation in the term "modification".) Each licensee is addressed as
+ "you".
+ Activities other than copying, distribution and modification are not
+ covered by this License; they are outside its scope. The act of
+ running the Program is not restricted, and the output from the Program
+ is covered only if its contents constitute a work based on the Program
+ (independent of having been made by running the Program). Whether that
+ is true depends on what the Program does.
+ 1. You may copy and distribute verbatim copies of the Program's source
+ code as you receive it, in any medium, provided that you conspicuously
+ and appropriately publish on each copy an appropriate copyright notice
+ and disclaimer of warranty; keep intact all the notices that refer to
+ this License and to the absence of any warranty; and give any other
+ recipients of the Program a copy of this License along with the
+ Program.
+ You may charge a fee for the physical act of transferring a copy, and
+ you may at your option offer warranty protection in exchange for a
+ fee.
+ 2. You may modify your copy or copies of the Program or any portion of
+ it, thus forming a work based on the Program, and copy and distribute
+ such modifications or work under the terms of Section 1 above,
+ provided that you also meet all of these conditions:
+ * a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+ * b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any part
+ thereof, to be licensed as a whole at no charge to all third parties
+ under the terms of this License.
+ * c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such interactive
+ use in the most ordinary way, to print or display an announcement
+ including an appropriate copyright notice and a notice that there is
+ no warranty (or else, saying that you provide a warranty) and that
+ users may redistribute the program under these conditions, and telling
+ the user how to view a copy of this License. (Exception: if the
+ Program itself is interactive but does not normally print such an
+ announcement, your work based on the Program is not required to print
+ an announcement.)
+ * d) If the Program as you received it is intended to interact with
+ users through a computer network and if, in the version you received,
+ any user interacting with the Program was given the opportunity to
+ request transmission to that user of the Program's complete source
+ code, you must not remove that facility from your modified version of
+ the Program or work based on the Program, and must offer an equivalent
+ opportunity for all users interacting with your Program through a
+ computer network to request immediate transmission by HTTP of the
+ complete source code of your modified version or other derivative
+ work.
+ These requirements apply to the modified work as a whole. If
+ identifiable sections of that work are not derived from the Program,
+ and can be reasonably considered independent and separate works in
+ themselves, then this License, and its terms, do not apply to those
+ sections when you distribute them as separate works. But when you
+ distribute the same sections as part of a whole which is a work based
+ on the Program, the distribution of the whole must be on the terms of
+ this License, whose permissions for other licensees extend to the
+ entire whole, and thus to each and every part regardless of who wrote
+ it.
+ Thus, it is not the intent of this section to claim rights or contest
+ your rights to work written entirely by you; rather, the intent is to
+ exercise the right to control the distribution of derivative or
+ collective works based on the Program.
+ In addition, mere aggregation of another work not based on the Program
+ with the Program (or with a work based on the Program) on a volume of
+ a storage or distribution medium does not bring the other work under
+ the scope of this License.
+ 3. You may copy and distribute the Program (or a work based on it,
+ under Section 2) in object code or executable form under the terms of
+ Sections 1 and 2 above provided that you also do one of the following:
+ * a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections 1
+ and 2 above on a medium customarily used for software interchange; or,
+ * b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your cost of
+ physically performing source distribution, a complete machine-readable
+ copy of the corresponding source code, to be distributed under the
+ terms of Sections 1 and 2 above on a medium customarily used for
+ software interchange; or,
+ * c) Accompany it with the information you received as to the offer to
+ distribute corresponding source code. (This alternative is allowed
+ only for noncommercial distribution and only if you received the
+ program in object code or executable form with such an offer, in
+ accord with Subsection b above.)
+ The source code for a work means the preferred form of the work for
+ making modifications to it. For an executable work, complete source
+ code means all the source code for all modules it contains, plus any
+ associated interface definition files, plus the scripts used to
+ control compilation and installation of the executable. However, as a
+ special exception, the source code distributed need not include
+ anything that is normally distributed (in either source or binary
+ form) with the major components (compiler, kernel, and so on) of the
+ operating system on which the executable runs, unless that component
+ itself accompanies the executable.
+ If distribution of executable or object code is made by offering
+ access to copy from a designated place, then offering equivalent
+ access to copy the source code from the same place counts as
+ distribution of the source code, even though third parties are not
+ compelled to copy the source along with the object code.
+ 4. You may not copy, modify, sublicense, or distribute the Program
+ except as expressly provided under this License. Any attempt otherwise
+ to copy, modify, sublicense or distribute the Program is void, and
+ will automatically terminate your rights under this License. However,
+ parties who have received copies, or rights, from you under this
+ License will not have their licenses terminated so long as such
+ parties remain in full compliance.
+ 5. You are not required to accept this License, since you have not
+ signed it. However, nothing else grants you permission to modify or
+ distribute the Program or its derivative works. These actions are
+ prohibited by law if you do not accept this License. Therefore, by
+ modifying or distributing the Program (or any work based on the
+ Program), you indicate your acceptance of this License to do so, and
+ all its terms and conditions for copying, distributing or modifying
+ the Program or works based on it.
+ 6. Each time you redistribute the Program (or any work based on the
+ Program), the recipient automatically receives a license from the
+ original licensor to copy, distribute or modify the Program subject to
+ these terms and conditions. You may not impose any further
+ restrictions on the recipients' exercise of the rights granted herein.
+ You are not responsible for enforcing compliance by third parties to
+ this License.
+ 7. If, as a consequence of a court judgment or allegation of patent
+ infringement or for any other reason (not limited to patent issues),
+ conditions are imposed on you (whether by court order, agreement or
+ otherwise) that contradict the conditions of this License, they do not
+ excuse you from the conditions of this License. If you cannot
+ distribute so as to satisfy simultaneously your obligations under this
+ License and any other pertinent obligations, then as a consequence you
+ may not distribute the Program at all. For example, if a patent
+ license would not permit royalty-free redistribution of the Program by
+ all those who receive copies directly or indirectly through you, then
+ the only way you could satisfy both it and this License would be to
+ refrain entirely from distribution of the Program.
+ If any portion of this section is held invalid or unenforceable under
+ any particular circumstance, the balance of the section is intended to
+ apply and the section as a whole is intended to apply in other
+ circumstances.
+ It is not the purpose of this section to induce you to infringe any
+ patents or other property right claims or to contest validity of any
+ such claims; this section has the sole purpose of protecting the
+ integrity of the free software distribution system, which is
+ implemented by public license practices. Many people have made
+ generous contributions to the wide range of software distributed
+ through that system in reliance on consistent application of that
+ system; it is up to the author/donor to decide if he or she is willing
+ to distribute software through any other system and a licensee cannot
+ impose that choice.
+ This section is intended to make thoroughly clear what is believed to
+ be a consequence of the rest of this License.
+ 8. If the distribution and/or use of the Program is restricted in
+ certain countries either by patents or by copyrighted interfaces, the
+ original copyright holder who places the Program under this License
+ may add an explicit geographical distribution limitation excluding
+ those countries, so that distribution is permitted only in or among
+ countries not thus excluded. In such case, this License incorporates
+ the limitation as if written in the body of this License.
+ 9. Affero Inc. may publish revised and/or new versions of the Affero
+ General Public License from time to time. Such new versions will be
+ similar in spirit to the present version, but may differ in detail to
+ address new problems or concerns.
+ Each version is given a distinguishing version number. If the Program
+ specifies a version number of this License which applies to it and
+ "any later version", you have the option of following the terms and
+ conditions either of that version or of any later version published by
+ Affero, Inc. If the Program does not specify a version number of this
+ License, you may choose any version ever published by Affero, Inc.
+
+ You may also choose to redistribute modified versions of this program
+ under any version of the Free Software Foundation's GNU General Public
+ License version 3 or higher, so long as that version of the GNU GPL
+ includes terms and conditions substantially equivalent to those of
+ this license.
+
+ 10. If you wish to incorporate parts of the Program into other free
+ programs whose distribution conditions are different, write to the
+ author to ask for permission. For software which is copyrighted by
+ Affero, Inc., write to us; we sometimes make exceptions for this. Our
+ decision will be guided by the two goals of preserving the free status
+ of all derivatives of our free software and of promoting the sharing
+ and reuse of software generally.
+ NO WARRANTY
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
+ WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+ EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+ OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+ PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
+ THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+ AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+ PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+ FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
+ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ DAMAGES.
33 README
@@ -0,0 +1,33 @@
+PHP Code Pastebin
+=================
+
+This tool was orignally designed to enable collaborative code review via
+the #php IRC channel. Inspired by www.parseerror.com/paste, but more
+streamlined and capable of allowing collabation via IRC by allowing easy
+modification of posted code. Another benefit is short urls - e.g.
+http://pastebin.com/333
+
+Since then it has found uses in many developer communities and has been
+constantly improved.
+
+The latest version of this code can always be found at http://pastebin.com
+
+News about updates will be made on my blog http://blog.dixo.net
+
+If you have any fixes or feature suggestions, please get in touch.
+
+Paul Dixon
+
+email: paul@elphin.com
+msn : lordelph@hotmail.com
+irc : LordElph on EFNet and FreeNode
+blog : http://blog.dixo.net
+
+
+
+Further documentation
+=====================
+See INSTALL for installation instructions
+See UPGRADE for information on upgrading pastebin from an older verion
+See CHANGES for version history
+See LICENCE for licencing terms
13 UPGRADE
@@ -0,0 +1,13 @@
+Upgrading Pastebin
+------------------
+
+v0.4x to 0.5
+------------
+
+The database has some extra columns, add and initialise them as follows:
+
+ALTER TABLE pastebin
+ ADD COLUMN expires DATETIME,
+ ADD COLUMN expiry_flag ENUM('d','m', 'f') NOT NULL DEFAULT 'm';
+
+UPDATE pastebin SET expires=DATE_ADD(posted, INTERVAL 1 MONTH) where expires is null and expiry_flag='m';
207 lib/config/default.conf.php
@@ -0,0 +1,207 @@
+<?php
+/**
+ * $Project: Pastebin $
+ * $Id: default.conf.php,v 1.3 2006/04/27 16:19:24 paul Exp $
+ *
+ * Pastebin Collaboration Tool
+ * http://pastebin.com/
+ *
+ * This file copyright (C) 2005 Paul Dixon (paul@elphin.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the Affero General Public License
+ * Version 1 or any later version.
+ *
+ * This program 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
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the Affero General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/**
+* This is the main configuration file containing typical defaults.
+*
+* For ease of upgrading, DO NOT MODIFY THIS FILE!
+*
+* Create an override file with a name matching your domain or element of
+* of it. For example for the domain 'banjo.pastebin.com', the code will
+* attempt to include these config files in order
+*
+* default.conf.php
+* com.conf.php
+* pastebin.com.conf.php
+* banjo.pastebin.com.conf.php
+*
+* The purpose of this to allow you to specific global options lower down,
+* say in com.conf.php, but domain-specific overrides in higher up files like
+* banjo.pastebin.com.conf.php
+*/
+
+
+
+/**
+* Site title
+*/
+$CONF['title']='pastebin - collaborative debugging tool';
+
+/**
+* Email address feedback should be sent to
+*/
+$CONF['feedback_to']='lordelph@gmail.com';
+
+/**
+* Apparent sender address for feedback email
+*/
+$CONF['feedback_sender']='pastebin.com <no-reply@pastebin.com>';
+
+/**
+* database type - can be file or mysql
+*/
+$CONF['dbsystem']='mysql';
+
+/**
+* db credentials
+*/
+$CONF['dbhost']='localhost';
+$CONF['dbname']='pastebin';
+$CONF['dbuser']='pastebin';
+$CONF['dbpass']='banjo';
+
+/**
+ * format of urls to pastebin entries - %d is the placeholder for
+ * the entry id.
+ *
+ * 1. for shortest possible url generation in conjuction with mod_rewrite:
+ * $CONF['url_format']='/%s';
+ *
+ * 2. if using pastebin with mod_rewrite, but within a subdir, you'd use
+ * something like this:
+ * $CONF['url_format']="/mysubdir/%s";
+ *
+ * 3. if not using mod_rewrite, you'll need something more like this:
+ * $CONF['url_format']="/pastebin.php?show=%s";
+ */
+$CONF['url_format']='/%s';
+
+
+
+/**
+* default expiry time d (day) m (month) or f (forever)
+*/
+$CONF['default_expiry']='m';
+
+/**
+* this is the path to the script - you may want to
+* to use / for even shorter urls if the main script
+* is renamed to index.php
+*/
+$CONF['this_script']='/pastebin.php';
+
+/**
+* what's the maximum number of posts we want to keep?
+* Set this to 0 to have no limit on retained posts
+*/
+$CONF['max_posts']=0;
+
+/**
+* what's the highlight char?
+*/
+$CONF['highlight_prefix']='@@';
+
+/**
+* how many elements in the base domain name? This is used to determine
+* what makes a "private" pastebin, i.e. for pastebin.com there are 2
+* elements 'pastebin' and 'com' - for pastebin.mysite.com there 3. Got it?
+* Good!
+*/
+$CONF['base_domain_elements']=2;
+
+
+/**
+* Google Adsense, clear this to remove ads.
+*/
+$CONF['google_ad_client']='pub-3281640380846080';
+
+/**
+* maintainer mode enables some code used to aid translation - unless you
+* are involved in developing pastebin, leave this as false
+*/
+$CONF['maintainer_mode']=false;
+
+/**
+* default syntax highlighter
+*/
+$CONF['default_highlighter']='text';
+
+/**
+* available formats
+*/
+$CONF['all_syntax']=array(
+ 'text'=>'None',
+ 'actionscript'=>'ActionScript',
+ 'ada'=>'Ada',
+ 'apache'=>'Apache Log File',
+ 'applescript'=>'AppleScript',
+ 'asm'=>'ASM (NASM based)',
+ 'asp'=>'ASP',
+ 'bash'=>'Bash',
+ 'c'=>'C',
+ 'c_mac'=>'C for Macs',
+ 'caddcl'=>'CAD DCL',
+ 'cadlisp'=>'CAD Lisp',
+ 'cpp'=>'C++',
+ 'csharp'=>'C#',
+ 'cfm'=>'ColdFusion',
+ 'css'=>'CSS',
+ 'd'=>'D',
+ 'delphi'=>'Delphi',
+ 'diff'=>'Diff',
+ 'dos'=>'DOS',
+ 'eiffel'=>'Eiffel',
+ 'fortran'=>'Fortran',
+ 'freebasic'=>'FreeBasic',
+ 'gml'=>'Game Maker',
+ 'html4strict'=>'HTML',
+ 'ini'=>'INI file',
+ 'java'=>'Java',
+ 'javascript'=>'Javascript',
+ 'lisp'=>'Lisp',
+ 'lua'=>'Lua',
+ 'matlab'=>'MatLab',
+ 'mpasm'=>'MPASM',
+ 'mysql'=>'MySQL',
+ 'nsis'=>'NullSoft Installer',
+ 'objc'=>'Objective C',
+ 'ocaml'=>'OCaml',
+ 'oobas'=>'Openoffice.org BASIC',
+ 'oracle8'=>'Oracle 8',
+ 'pascal'=>'Pascal',
+ 'perl'=>'Perl',
+ 'php'=>'PHP',
+ 'python'=>'Python',
+ 'qbasic'=>'QBasic/QuickBASIC',
+ 'robots'=>'Robots',
+ 'ruby'=>'Ruby',
+ 'scheme'=>'Scheme',
+ 'smarty'=>'Smarty',
+ 'sql'=>'SQL',
+ 'tcl'=>'TCL',
+ 'vb'=>'VisualBasic',
+ 'vbnet'=>'VB.NET',
+ 'visualfoxpro'=>'VisualFoxPro',
+ 'xml'=>'XML',
+
+);
+
+/**
+* popular formats, listed first
+*/
+$CONF['popular_syntax']=array(
+ 'text','bash', 'c', 'cpp', 'html4strict',
+ 'java','javascript','php','perl', 'python', 'ruby', 'lua');
+
+?>
460 lib/geshi/contrib/cssgen.php
@@ -0,0 +1,460 @@
+<?php
+/*************************************************************************************
+ * cssgen.php
+ * ----------
+ * Author: Nigel McNie (oracle.shinoda@gmail.com)
+ * Copyright: (c) 2004 Nigel McNie
+ * Release Version: 1.0.7.3
+ * CVS Revision Version: $Revision: 1.1.1.2 $
+ * Date Started: 2004/05/20
+ * Last Modified: $Date: 2006/04/27 19:54:04 $
+ *
+ * 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> &copy; 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
+ *
+ * The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation
+ * at http://qbnz.com/highlighter/documentation.php for more information about how to
+ * use this class.') !== 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 &quot;submit&quot; 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, '.'));
+ echo "<input type=\"checkbox\" name=\"langs[$lang]\" checked=\"checked\" />&nbsp;$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();
+}
+
+?>
193 lib/geshi/contrib/example.php
@@ -0,0 +1,193 @@
+<?php
+/**
+ * GeSHi example script
+ *
+ * Just point your browser at this script (with geshi.php in the parent directory,
+ * and the language files in subdirectory "../geshi/")
+ *
+ * @author Nigel McNie
+ * @version $Id: example.php,v 1.1.1.2 2006/04/27 19:54:04 paul Exp $
+ */
+
+// 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 (!@include '../geshi.php') {
+ if (!@include 'geshi.php') {
+ die('Could not find geshi.php - make sure it is in your include path!');
+ } else {
+ $path = './';
+ }
+} else {
+ $path = '../';
+}
+
+if ( isset($_POST['submit']) )
+{
+ if ( get_magic_quotes_gpc() ) $_POST['source'] = stripslashes($_POST['source']);
+ if ( !strlen(trim($_POST['source'])) )
+ {
+ $_POST['language'] = preg_replace('#[^a-zA-Z0-9\-_]#', '', $_POST['language']);
+ $_POST['source'] = implode('', @file($path . 'geshi/' . $_POST['language'] . '.php'));
+ $_POST['language'] = 'php';
+ }
+
+ // Here's a free demo of how GeSHi works.
+
+ // First the initialisation: source code to highlight and the language to use. Make sure
+ // you sanitise correctly if you use $_POST of course - this very script has had a security
+ // advisory against it in the past because of this. Please try not to use this script on a
+ // live site.
+ $geshi =& new GeSHi($_POST['source'], $_POST['language']);
+
+ // Use the PRE header. This means less output source since we don't have to output &nbsp;
+ // everywhere. Of course it also means you can't set the tab width.
+ $geshi->set_header_type(GESHI_HEADER_PRE);
+
+ // Enable CSS classes. You can use get_stylesheet() to output a stylesheet for your code. Using
+ // CSS classes results in much less output source.
+ $geshi->enable_classes();
+
+ // Enable line numbers. We want fancy line numbers, and we want every 5th line number to be fancy
+ $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5);
+
+ // Set the style for the PRE around the code. The line numbers are contained within this box (not
+ // XHTML compliant btw, but if you are liberally minded about these things then you'll appreciate
+ // the reduced source output).
+ $geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true);
+
+ // Set the style for line numbers. In order to get style for line numbers working, the <li> element
+ // is being styled. This means that the code on the line will also be styled, and most of the time
+ // you don't want this. So the set_code_style reverts styles for the line (by using a <div> on the line).
+ // So the source output looks like this:
+ //
+ // <pre style="[set_overall_style styles]"><ol>
+ // <li style="[set_line_style styles]"><div style="[set_code_style styles]>...</div></li>
+ // ...
+ // </ol></pre>
+ $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;');
+
+ // Styles for hyperlinks in the code. GESHI_LINK for default styles, GESHI_HOVER for hover style etc...
+ // note that classes must be enabled for this to work.
+ $geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
+ $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
+
+ // Use the header/footer functionality. This puts a div with content within the PRE element, so it is
+ // affected by the styles set by set_overall_style. So if the PRE has a border then the header/footer will
+ // appear inside it.
+ $geshi->set_header_content('GeSHi &copy; 2004, Nigel McNie. View source of example.php for example of using GeSHi');
+ $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;');
+
+ // You can use <TIME> and <VERSION> as placeholders
+ $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>GeSHi examples</title>
+ <style type="text/css">
+ <!--
+ <?php
+ if ( isset($_POST['submit']) )
+ {
+ // 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>
+<h2>GeSHi Example 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>Enter your source and a language to highlight the source in and submit, or just choose a language to
+have that language file highlighted in PHP.</p>
+<?php
+if ( isset($_POST['submit']) )
+{
+ // The fun part :)
+ echo $geshi->parse_code();
+ echo '<hr />';
+}
+?>
+<form action="example.php" method="post">
+<h3>Source to highlight</h3>
+<textarea rows="10" cols="60" name="source"></textarea>
+<h3>Choose a language</h3>
+<select name="language">
+<?php
+if (!($dir = @opendir(dirname(__FILE__) . '/geshi'))) {
+ if (!($dir = @opendir(dirname(__FILE__) . '/../geshi'))) {
+ echo '<option>No languages available!</option>';
+ }
+}
+$languages = array();
+while ( $file = readdir($dir) )
+{
+ if ( $file == '..' || $file == '.' || !stristr($file, '.') || $file == 'css-gen.cfg' ) continue;
+ $lang = substr($file, 0, strpos($file, '.'));
+ $languages[] = $lang;
+}
+closedir($dir);
+sort($languages);
+foreach ($languages as $lang) {
+ echo '<option value="' . $lang . '">' . $lang . "</option>\n";
+}
+
+?>
+</select><br />
+<input type="submit" name="submit" value="Highlight Source">
+</form>
+<div id="footer">GeSHi &copy; Nigel McNie, 2004, released under the GNU GPL<br />
+For a better demonstration, check out the <a href="http://qbnz.com/highlighter/demo.php">online demo</a>
+</body>
+</html>
32 lib/geshi/docs/BUGS
@@ -0,0 +1,32 @@
+
+ BUGS - list of known bugs in GeSHi
+ Version 1.0.7.9
+
+- Putting a > inside an HTML comment will close the comment abruptly. There's nothing that
+ can be done about this (at least in the 1.0.X series of GeSHi), but version 1.2 will fix
+ this bug. Likewise for putting ?> inside a PHP string when in strict mode.
+- Number highlighting is quite poor [possibly better now]
+- I'm not happy with URLS - there still could be extra bugs, and it's rather unflexible
+ (see TODO for a possible fix)
+- "Important" sections for some reason seem to have their spans added after every
+ newline up until the next lexic, instead of stopping at the <END GeSHi> part. In fact,
+ context sensitiveness is quite poor...
+- Using the extra line number highlighting feature without actually using line numbers
+ will result in malformed XHTML (not sure about this one though...)
+- Slow!!! Especially for source with lots of strings in it. GeSHi will work acceptably
+ for sourcecode under 5K (for simple language files like SQL, a 100K file can be
+ highlighted in just 6 seconds), but above about 25K things get a little slow... If
+ you're using this as part of some larger software, you may want to think about
+ making some sort of "cache" effect to speed things up and reduce server load.
+- Using encoding other than ISO-8859-1 is a problem, however it hasn't quite been pinpointed yet
+- The result is built by string replacement instead of by building another string based
+ on the source, that would be much safer. The focus of releases beyond 1.0.7 will be on
+ changing this behaviour, which may well fix some of the other bugs mentioned above.
+- As of 1.0.7.1, dots (.) are allowed before keywords. This may change highlighting of some
+ things slightly, if you notice anything odd about the highlighting then please report
+ it to me.
+- Perl/Javascript /.../ regex syntax isn't supported.
+Send any bug reports to nigel@geshi.org, or submit them via the bug tracker at
+sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231)
+
+ $Id: BUGS,v 1.1.1.2 2006/04/27 19:54:04 paul Exp $
251 lib/geshi/docs/CHANGES
@@ -0,0 +1,251 @@
+
+ CHANGES - Changelog for GeSHi (geshi.php only)
+
+Changes to the code are listed under the version they occured in, with who suggested
+it by each one (if there's nobody listed as suggesting it I dreamed it up :)). Users
+who suggested an idea often also provided the code that was used as a basis for the
+changes - thanks to all who suggested these ideas and gave me the code to show me how!
+
+Language files listed under each version were made by the author beside them, and then
+modified by me for consistency/bug fixing.
+
+Please send any bug reports to nigel@geshi.org, or use the bug report tracker
+at sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231)
+
+Version 1.0.7.9
+ - Added language files
+ * Fortran (Cedric Arrabie)
+ * SAS (Galen Johnson)
+ * CFDG (John Horigan)
+ - Fixed & in URL in java5 (ClemensWeiß)
+ - Added MD5 and SHA1 to mysql keywords (polarina)
+ - Fixes for highlight_lines_extra with line numbers (ithcy)
+ - Fixed backslash characters being removed (ArTourter)
+Version 1.0.7.8
+ - Fixed blank at start of MySQL file (W. Tasin)
+ - Fixed smarty functions being broken (ultrabob)
+ - Changed keyword and regexp detection and parsing
+ slightly to allow more "meta characters" (like #) in
+ keywords
+ - Minor fixes for XML and GML
+Version 1.0.7.7
+ - Added language files
+ * T-SQL (Duncan Lock)
+ * Robots.txt (Christian Lescuyer)
+ * AutoIT (mastrboy)
+ * Java 5 (Clemens Bruckmann)
+ * ColdFusion (Diego)
+ - A few keyword changes in java, removed :: object splitter (amphi)
+ - Now using a simpler regular expression for numbers (Brice Bernard)
+ - Fixed ah, bh etc. regs being highlighted as numbers (Unknown)
+Version 1.0.7.6
+ - Fix backtick-string highlighting in ruby (Juan J. Mart�nez)
+ - Add =begin multiline comments in ruby (Juan J. Mart�nez)
+ - Added support for :keywords and ::access in lisp (Denis Mashkevich)
+ - Prevented number highlighting if they are just after underscores (Joce)
+ - Removed escape characters for strings in XML and HTML (floele)
+ - Added instanceof keyword to java (jgottschling)
+ - Fixed comments in ASP (SBD)
+ - Removed unnecessary keyword style index from ini
+ - Added support for " strings in ini
+ - Removed unnecessary regex style index from blitzbasic
+ - Keyword case of URL-ed keywords should be defined by language file (Benny Baumann)
+ - Added "Hardquote" feature, provides more accurate string highlighting (Cliff Stanford)
+ - Used hardquote support for @"..." strings in C# (Cliff Stanford)
+ - Used hardquote support for ' strings in perl (Cliff Stanford)
+ - Fixed setting of language path (Cliff Stanford)
+ - Display source correctly formatted with line numbers (if requested) if an error
+ has occured (several people)
+ - Having no source to highlight is not an error condition anymore
+ - Delphi language updated to include more keywords and types (BenBE)
+ - Updated NSIS to version 2.11 (deguix)
+Version 1.0.7.5
+ - Fix for using escape characters to escape newlines breaking XHTML compliance (Yves Goergen)
+ - Fixed method highlighting in VB (Matt Beale)
+ - Fixed multiline comment highlighting in SQL (MrBaseball34)
+ - Fixed two ">" symbols being outputted when using a footer but not CSS classes (MrBaseball34)
+ - Marked important block stuff as deprecated
+ - Some documentation tidyup
+ - Updated GML language file (Jos� Jorge Enr�quez Rodr�guez)
+ - THANKS file tidied up
+ - Fixed double </a> for elements in HTML (Yves Goergen)
+ - Added some keywords for ASM (Dreuzzo)
+Version 1.0.7.4
+ - Added language files
+ * MySQL (Carl F�rstenberg)
+ * BlitzBasic (P�draig O`Connel)
+ - Fixed up geshi_highlight function: it now correctly uses <code> instead of <div> (Remi Faure)
+ - When using GESHI_HEADER_NONE, remove the <ol> if line numbering is not enabled
+ - Commented example.php so people can use it as a guide better
+ - Fixed extra newline being generated if a comment is at the end
+ of the source (many people, including Yves Goergen)
+ - Fixed up some documentation issues
+ - Some minor language file fixes (C++, Lua) (Lua fixes by chromix)
+ - Fixed up no </span> in XML and other strict languages (regression from 1.0.7.3 fix: removed
+ unnecessary </span> when using strict mode) (Daniel Ecer, drskrud),
+Version 1.0.7.3
+ - Added language files
+ * Scheme (Jon Raphaelson)
+ * Ocaml and Ocaml-brief (Flaie)
+ * Ruby (Amit Gupta)
+ - Make urls generated for java highlighting XHTML compliant (Tim Van Wassenhove)
+ - Removed unnecessary </span> when using strict mode (Tim Van Wassenhove)
+ - Fixed warning in dos.php about undefined constant (Tim Van Wassenhove)
+ - Fixed security hole in contrib/example.php - able to view any file if source
+ not set and language is set to wierd value (Maksymilian Arciemowicz)
+Version 1.0.7.2
+ - Added language files
+ * Inno (Thomas Klinger)
+ * Ini (Deguix)
+ * DOS (Batchfile) (Alessandro Staltali)
+ * Applescript (Stephan Klimek)
+ * Freebasic (Roberto Rossi)
+ * SDLBasic (Roberto Rossi)
+ * ActionScript (links to French documentation) (NikO)
+ - NSIS language file updated (deguix)
+ - Lua language file updated (Roberto Rossi)
+ - Bugfix: Styles incorrectly overriding default styles instead of being merged
+ in set_*_styles methods (Stebastian Werner)
+ - Added GESHI_HEADER_NONE as valid header type. This still allows header content.
+Version 1.0.7.1
+ - Added language files:
+ * Div (Gabriel Lorenzo)
+ * GML (Jos� Jorge Enr�quez Rodr�guez)
+ * Eiffel (Zoran Simic)
+ - Minor change to rules regarding when keywords can appear - now dots (.) are
+ allowed before keywords. (NikO)
+ - Bugfix: the line style for non-fancy lines when fancy highlighting is enabled
+ is now applied (Amit Gupta)
+Version 1.0.7
+ - Added language files:
+ * Diff (Conny Brunnkvist)
+ * VHDL (Alexander Krause)
+ * D (Thomas Kuehne)
+ * Matlab (Florian Knorn)
+ - Python highlighting improved (thither, Federico Quagliata)
+ - Changed file comments to use phpdoc syntax, and changed code style to be more
+ like PEAR
+ - Fixed bug in set_code_style: Second parameter is now optional
+ - The $_GESHI_ERRORS array is gone, error messages are internal to the GeSHi class
+ - Changed name of XML language to XML from HTML
+ - Removed min and max tab width checks
+ - Backported GeSHi 1.1.X's automatic language file path detection so you no longer
+ need to use the third parameter of the constructor or set_language_path except for
+ special circumstances.
+ - Source is checked to make sure it is not empty else an error occurs
+ - Removed excess characters after ?> in ada.php, apache.php and cpp.php that caused
+ http headers to be sent (psichron)
+ - Removed second "foreach" keyword for smarty language file that was causing
+ duplication (Iss)
+ - Added underscore to allowed characters in match for XML tags (anonymous)
+ - Added some missing java keywords like "abstract" and "transient"
+ - Added "list" and "continue" PHP keywords
+ - set_language resets error status and strict mode (Andrew Black)
+ - Removed margin:0 declaration from cssgen.php (Andrzej Kubaszek)
+ - Fixed multiline comment selector in cssgen.php (Andrzej Kubaszek)
+Version 1.0.6
+ - Added support for smart tabs - tabs that behave just like normal tabs when in
+ GESHI_HEADER_DIV mode.
+ - Partial patch for UTF-8 encoding applied (doesn't quite work however...)
+Version 1.0.5
+ - Added language files:
+ * MPASM (Bakalex)
+ * Oracle 8 (Guy Wicks)
+ - Fixed bug where not using an encoding type would sometime result in warnings (although
+ there still seems to be issues with encoding in general that I'm trying to gather more
+ data on) (Alexander Spennemann)
+ - Removed "margin: 0" from <ol> in an attempt to make line numbers visible in IE again
+ by default (untested, but I don't really care if it works... get firefox! ;))
+ - Added note on php5 support (Karim Scheik)
+ - Added two new methods: load_from_file and get_language_name_from_extension, that can
+ help automate file highlighting (though the extension array at this time is quite bare)
+ (David Gartner, Brian Cheesman)
+Version 1.0.4
+ - Fixed many version-reporting bugs (Jack Lloyd)
+ - Fixed bug where methods were not having the correct CSS generated for them
+ by get_stylesheet() (Jack Lloyd)
+ - Added new keywords to C and C++ files (Jack Lloyd)
+ - Added section on case sensitivity to documentation that wasn't in the other versions
+Version 1.0.3
+ - Added language files:
+ * Smarty (Alan Juden)
+ * C# (Alan Juden)
+ * VB.NET (Alan Juden)
+ * C for Macs (M. Uli Kusterer)
+ * Objective C (M. Uli Kusterer)
+ - Links can have a target attribute (Andreas Gohr)
+ - Fixed multiline string bug if not using classes
+ - Added method set_encoding that allows you to set the character
+ set used by calls to htmlentities() in GeSHi
+ - You can now specify an array of object splitters, and each
+ type of method separated by each object splitter can be highlighted
+ differently
+ - If a language uses a case sensitive keyword group and that group
+ has a URL associated with it, the keyword will not be lowercased
+ in the URL (M. Uli Kusterer)
+Version 1.0.2
+ - Added language files:
+ * Actionscript (Steffen Krause)
+ * ASP (Amit Gupta)
+ * Bash (Andreas Gohr)
+ * CADDCL (Roberto Rossi)
+ * CadLisp (Roberto Rossi)
+ * C++ (Dennis Bayer)
+ * Delphi (J�rja Norbert)
+ * Javascript (Ben Keen)
+ * Lisp (Roberto Rossi)
+ * OpenOffice.org BASIC (Roberto Rossi)
+ * Perl (Andreas Gohr and Ben Keen)
+ * Python (Roberto Rossi)
+ * VisualFoxPro (Roberto Armellin)
+ * XML (Nigel McNie, from an idea/file by Christian Weiske)
+ - Added contrib/ directory with script to create one external stylesheet
+ from many languages(base script by Andreas Gohr, modified by Nigel McNie),
+ and an example script (needs lotsa work...)
+ - Code lines can have their own unique ID (for use with javascript)
+ (suggested by Andreas von Oettingen)
+ - Certain rows can be specified to be highlighted differently (suggested by
+ Andreas von Oettingen)
+ - Getter available for human-readable language name (suggested by Simon Patterson)
+ - Line numbers aren't highlighted when a user selects the code
+ - Contextual highlighting with <BEGIN GeSHi> ... <END GeSHi> in the code (which
+ can be disabled)
+ - Functions can be made into URLs to appropriate documentation (suggested
+ by cybot_tm). Also thanks to Marcin Gryszkalis for the links for C, Java
+ and Perl.
+ - Code can have a header and footer
+ - Time taken to parse the code is recorded and made available with the get_time()
+ method
+ - error() now returns a human-readable error message
+ - Function geshi_highlight added to make it even easier to highlight on the fly
+ - Advanced regular expression handling
+ - Bug fixes to lexic_permission handling
+
+Version 1.0.1
+ - Added methods set_symbols_style() and set_symbols_highlighting(). These should be used
+ instead of set_brackets_style and set_brackets_highlighting respectively.
+ - Added a new field - language_path - that can be set either when the constructor is
+ called, or by the new method set_language_path(), that specifies a path to the directory
+ containing the language files (bug reported by bbspliff)
+ - Added a new method set_case_keywords(), that allows the auto-casing feature to be
+ changed on the fly instead of simply being specified in the language file
+ - If there is an error the source that is outputted is now handled much better
+ - Lines are broken in the source only by \n now, not by \r\n (to save on output source)
+ - Indentation moved into its own method
+ - Method header() modified to allow the user to choose whether the code is surrounded in
+ a <div> or a <pre> (see documentation for benefits of both). Method footer() likewise
+ modified.
+ - Method get_stylesheet() modified so that a smaller comment is outputted in economy mode,
+ and bugs with when line number classes are outputted in economy mode have been fixed
+ - Bug where spans had two quotes at the end of the attributes fixed (ie. <span style=".."">)
+ - Added language files:
+ * Ada (Tux)
+ * Apache log file (Tux)
+ * ASM (Tux)
+ * NSIS (Tux)
+ * Pascal (Tux)
+
+Version 1.0.0
+ - Initial Release
+
+ $Id: CHANGES,v 1.1.1.2 2006/04/27 19:54:04 paul Exp $
340 lib/geshi/docs/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program 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.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
35 lib/geshi/docs/README
@@ -0,0 +1,35 @@
+
+ GeSHi - GEneric Syntax HIlighter
+ --------------------------------
+ Version 1.0.7.9
+
+Author: Nigel McNie
+Email: nigel@geshi.org
+GeSHi Website: http://qbnz.com/highlighter
+
+GeSHi is a generic syntax highlighter, written in PHP. You simply
+input the source code you wish to highlight with the language you
+wish to use, and the output will be a file syntax highlighted to
+XHTML standards.
+
+For more information on how to use GeSHi, please consult the
+documentation. If you got this readme from a GeSHi package, then
+the documentation is available in the docs/ directory. Documentation
+is also available at http://qbnz.com/highlighter/documentation.php
+
+If you think you've found a bug in GeSHi, contact me with a bug
+report at nigel@geshi.org, or submit it to the bug tracker at
+http://sourceforge.net/tracker/?group_id=114997&atid=670231. Be
+aware that minor highlighting errors may well just be incorrect
+language files, but if you do find something major please contact me.
+
+And if you're using GeSHi as a plugin/mod for some other software,
+please tell me about it! It's worth a link to you, and I can give
+you specialist help if you need it.
+
+GeSHi is free software, released under the GNU GPL. Please see the
+COPYING file for more information. If you do modify this program,
+please tell me about it! Perhaps you've made a good improvement that
+I can learn from :)
+
+ $Id: README,v 1.1.1.2 2006/04/27 19:54:04 paul Exp $
99 lib/geshi/docs/THANKS
@@ -0,0 +1,99 @@
+
+ THANKS - List of credits for GeSHi
+
+I owe these people/groups my thanks for help with GeSHi. Thanks, guys!
+
+- Amit Gupta - Thanks for all that constructive criticism - it's
+ a great help for making GeSHi even better. And
+ thanks for the Wordpress plugin! (Anyone who is
+ interested in the plugin can visit:
+ http://blog.igeek.info/still-fresh/category/wp-plugins/igsyntax-hiliter/)
+- Andreas Gohr - Thanks for language files and for using GeSHi for DokuWiki
+ (http://www.splitbrain.org/dokuwiki/wiki:dokuwiki). And thanks
+ for all your criticisms and for that stylesheet-maker code :).
+ Also, thanks for the UTF-8 patch.
+- Andreas von Oettingen - Thanks for those great ideas! :)
+- bbspliff - Thanks for pointing out that bug (pity I already
+ found it though ;))
+- Benny Baumann - Thanks for your innumerable suggestions for improvements, and your
+ work on Delphi support :)
+- Ben Keen - Thanks for the language files and pointing out some
+ ideas for future releases. Lookin' forward to seeing that
+ software soon! ;)
+- Brian Cheesman - Thanks for using GeSHi in phpCvsView, and for the suggestion about
+ extension => language lookup
+- Christian Weiske - Thanks for the inspiration for creating advanced regexp
+ highlighting :D
+- Cliff Stanford - Thanks for the hardquote support for C# and Perl (can be used elsewhere
+ I'm sure)
+- David Gartner - Thanks for using GeSHi in net2ftp, and for the idea about a load_from_file
+ method
+- forum.qbasicnews.com - Thanks for putting up with the crappy versions
+ that I "forced" on you guys before ;)
+- Jack Lloyd - Thanks for pointing out the versioning and method CSS bugs, and giving
+ me the extra C/C++ keywords
+- Karim Scheik - Thanks for the php5 support report
+- Marcin Gryszkalis - Thanks for those links for C, Java, Perl
+- M. Uli Kusterer - Thanks for the idea about URL case conversion
+- Roberto Armellin - Thanks for pointing out some flaws in GeSHi (that will be solved
+ in 1.2 guaranteed)
+- Sterling Christensen - Thanks for those links to language specs
+- Tux - Thanks for making all those language files :D
+- zbw - Thanks for proving a phpBB port was possible
+
+PEOPE WHO MADE LANGUAGE FILES
+
+- Actionscript Steffen Krause (french translation by NikO)
+- Ada Tux
+- Apache Tux
+- Applescript Stephan Klimek
+- ASM Tux
+- ASP Amit Gupta
+- AutoIT mastrboy
+- Bash Andreas Gohr
+- BlitzBasic P�draig O`Connel
+- C++ Dennis Bayer, M. Uli Kusterer
+- C# Alan Juden
+- C for Macs M. Uli Kusterer
+- CADDCL Roberto Rossi
+- CadLisp Roberto Rossi
+- CDFG John Horigan
+- ColdFusion Diego
+- Delphi J�rja Norbert
+- Div Gabriel Lorenzo
+- DOS Alessandro Staltari
+- Eiffel Zoran Simic
+- FreeBasic Roberto Rossi
+- Fortran Cedric Arrabie
+- GML Jos� Jorge Enr�quez Rodr�guez
+- Ini Deguix
+- Inno Thomas Klinger
+- Java 5 Clemens Bruckmann
+- Javascript Ben Keen
+- Lisp Roberto Rossi
+- Lua Roberto Rossi
+- MPASM Bakalex
+- MySQL Carl F�rstenberg
+- NSIS Tux (updated by Deguix)
+- Objective C M. Uli Kusterer
+- Ocaml Flaie
+- Ocaml-brief Flaie
+- OpenOffice.org BASIC Roberto Rossi
+- Oracle 8 Guy Wicks
+- Pascal Tux
+- Perl Andreas Gohr, Ben Keen
+- Python Roberto Rossi
+- Robots Christian Lescuyer
+- Ruby Amit Gupta
+- SAS Galen Johnson
+- SDLBasic Roberto Rossi
+- Scheme Jon Raphaelson
+- Smarty Alan Juden
+- T-SQL Duncan Lock
+- VB.NET Alan Juden
+- VisualFoxPro Roberto Armellin
+
+Do you want your name in here? Help me out! Make a language file, or suggest a new
+feature, or make a plugin for GeSHi for some other software, then tell me about it!
+
+ $Id: THANKS,v 1.1.1.2 2006/04/27 19:54:04 paul Exp $
66 lib/geshi/docs/TODO
@@ -0,0 +1,66 @@
+
+ TODO - List of things to do as of 2005/01/29
+
+Suggestions for things to add are welcome, if you have a feature request you
+can either post it to the forums:
+
+http://qbnz.com/highlighter/forum.php
+
+Or to the feature request tracker:
+
+http://sourceforge.net/tracker/?group_id=114997&atid=670234
+
+
+ TODO for version 1.0.8
+
+- Rewrite parse_code method and parse_non_string_part method to use build
+ rather than replace method of highlighting. This should speed things up
+ while making highlighting much "safer"
+- Rework the load_from_file method and the one for getting a file extension,
+ as documented in the source.
+- Add option for "standards compliant" or "default" modes, where standards
+ compliance generates the <pre> tags within the <li>s and non compliant mode
+ does what happens currently.
+
+
+ TODO for version 1.2.0
+
+- Rewrite engine to use remove/replace method (will hopefully almost
+ eliminate the need for regular expressions except for numbers/methods
+ etc). This will also assist for making different output formats [DONE]
+- "Intelligent" output format - eg if the user doesn't want lines to
+ wrap and wants line numbers don't use <ol>, use the <table> method
+ instead. (This saves on output)
+- Clear split between "public" and "private" methods [DONE]
+- PHP5 version
+- "Themes" for styles - basically pre-made stylesheets that can be used
+ to highlight code of any language in a similar manner [DONE]
+- "Dialects" for languages - eg php4, php5. One master language definition
+ file, and a bunch of "specialised" dialect files for each language
+ Ability to specify a "specialised" dialect as default? [DONE]
+- Look at load/memory usage and try to reduce
+- Make tabs into tab-stops like a normal editor [DONE]
+- Ability to add more than one multiline comment or string [DONE]
+- Ability to specify that strings cannot be multiline [DONE]
+- Create a "wrapper" class for ultra-easy use
+- Code written in a style that conforms to a phpdoc utility [DONE, PEAR]
+- Dig functions/methods out of code and where they are called make an internal
+ link back to their definition
+
+
+ TODO for version 2.0.0
+
+- Support for multiple output formats (XHTML, XML, PDF, RTF etc) [DONE IN 1.2]
+- Support for auto-indent/code "beautifing"
+- Option for "Lite" highlighting - aims for speed and low server load
+- "Intelligent" highlighting inside comments, and ability to highlight
+ source in multiple languages at once (eg PHP+HTML) [DONE IN 1.2]
+- Perhaps a script on the GeSHi site that would map urls to appropriate
+ definitions and relocate the user? (eg, java documentation is
+ structured in such a way that urls are not able to be used with GeSHi.
+ Instead the URL could become:
+ http://qbnz.com/highlighter/redirect.php?lang=java&kw=KeyWord
+ and that script would redirect to the correct location.
+ [BETTER FIX IN 1.2]
+
+ $Id: TODO,v 1.1.1.2 2006/04/27 19:54:04 paul Exp $
5 lib/geshi/docs/geshi-doc.txt
@@ -0,0 +1,5 @@
+To keep the size of the pastebin source distribution small, the GeSHi
+documentation has been removed. GeShi comes with copious documentation,
+see http://qbnz.com/highlighter/ for details.
+
+
2,712 lib/geshi/geshi.php
2,712 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
957 lib/geshi/geshi/actionscript-french.php
@@ -0,0 +1,957 @@
+<?php
+/*************************************************************************************
+ * actionscript.php
+ * ----------------
+ * Author: Steffen Krause (Steffen.krause@muse.de)
+ * Copyright: (c) 2004 Steffen Krause, Nigel McNie (http://qbnz.com/highlighter)
+ * Release Version: 1.0.7.9
+ * CVS Revision Version: $Revision: 1.1.1.1 $
+ * Date Started: 2004/06/20
+ * Last Modified: $Date: 2006/04/27 19:54:11 $
+ *
+ * Actionscript language file for GeSHi.
+ *
+ * CHANGES
+ * -------
+ * 2005/08/25 (1.0.2)
+ * Author [ NikO ] - http://niko.informatif.org
+ * - add full link for myInstance.methods to http://wiki.media-box.net/documentation/flash
+ * 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' => 'Actionscript',
+ 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
+ 'COMMENT_MULTI' => array('/*' => '*/'),
+ 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+ 'QUOTEMARKS' => array("'", '"'),
+ 'ESCAPE_CHAR' => '\\',
+ 'KEYWORDS' => array(
+ 1 => array(
+ '#include',
+ 'for',
+ 'foreach',
+ 'if',
+ 'elseif',
+ 'else',
+ 'while',
+ 'do',
+ 'dowhile',
+ 'endwhile',
+ 'endif',
+ 'switch',
+ 'case',
+ 'endswitch',
+ 'break',
+ 'continue',
+ 'in',
+ 'null',
+ 'false',
+ 'true',
+ 'var',
+ 'default',
+ 'new',
+ '_global',
+ 'undefined',
+ 'super'
+ ),
+ 2 => array(
+ 'static',
+ 'private',
+ 'public',
+ 'class',
+ 'extends',
+ 'implements',
+ 'import',
+ 'return',
+ 'trace',
+ '_quality',
+ '_root',
+ 'set',
+ 'setInterval',
+ 'setProperty',
+ 'stopAllSounds',
+ 'targetPath',
+ 'this',
+ 'typeof',
+ 'unescape',
+ 'updateAfterEvent'
+ ),
+ 3 => array (
+ 'Accessibility',
+ 'Array',
+ 'Boolean',
+ 'Button',
+ 'Camera',
+ 'Color',
+ 'ContextMenuItem',
+ 'ContextMenu',
+ 'Cookie',
+ 'Date',
+ 'Error',
+ 'function',
+ 'FWEndCommand',
+ 'FWJavascript',
+ 'Key',
+ 'LoadMovieNum',
+ 'LoadMovie',
+ 'LoadVariablesNum',
+ 'LoadVariables',
+ 'LoadVars',
+ 'LocalConnection',
+ 'Math',
+ 'Microphone',
+ 'MMExecute',
+ 'MMEndCommand',
+ 'MMSave',
+ 'Mouse',
+ 'MovieClipLoader',
+ 'MovieClip',
+ 'NetConnexion',
+ 'NetStream',
+ 'Number',
+ 'Object',
+ 'printAsBitmapNum',
+ 'printNum',
+ 'printAsBitmap',
+ 'printJob',
+ 'print',
+ 'Selection',
+ 'SharedObject',
+ 'Sound',
+ 'Stage',
+ 'String',
+ 'System',