Permalink
Browse files

Initial checkin of old 6.0 pastebin code.

  • Loading branch information...
Christian Höltje
Christian Höltje committed Apr 22, 2010
0 parents commit 8e98696a9d5d54e472ed9ce9fdfd8aa24d047bb5
Showing with 24,919 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
  49. +1,390 −0 lib/geshi/geshi/java.php
  50. +1,023 −0 lib/geshi/geshi/java5.php
  51. +146 −0 lib/geshi/geshi/javascript.php
  52. +135 −0 lib/geshi/geshi/lisp.php
  53. +137 −0 lib/geshi/geshi/lua.php
  54. +869 −0 lib/geshi/geshi/matlab.php
  55. +160 −0 lib/geshi/geshi/mpasm.php
  56. +176 −0 lib/geshi/geshi/mysql.php
  57. +354 −0 lib/geshi/geshi/nsis.php
  58. +241 −0 lib/geshi/geshi/objc.php
  59. +114 −0 lib/geshi/geshi/ocaml-brief.php
  60. +163 −0 lib/geshi/geshi/ocaml.php
  61. +132 −0 lib/geshi/geshi/oobas.php
  62. +489 −0 lib/geshi/geshi/oracle8.php
  63. +145 −0 lib/geshi/geshi/pascal.php
  64. +169 −0 lib/geshi/geshi/perl.php
  65. +162 −0 lib/geshi/geshi/php-brief.php
  66. +348 −0 lib/geshi/geshi/php.php
  67. +226 −0 lib/geshi/geshi/python.php
  68. +147 −0 lib/geshi/geshi/qbasic.php
  69. +100 −0 lib/geshi/geshi/robots.php
  70. +149 −0 lib/geshi/geshi/ruby.php
  71. +359 −0 lib/geshi/geshi/sas.php
  72. +172 −0 lib/geshi/geshi/scheme.php
  73. +163 −0 lib/geshi/geshi/sdlbasic.php
  74. +168 −0 lib/geshi/geshi/smarty.php
  75. +137 −0 lib/geshi/geshi/sql.php
  76. +94 −0 lib/geshi/geshi/tcl.php
  77. +57 −0 lib/geshi/geshi/text.php
  78. +385 −0 lib/geshi/geshi/tsql.php
  79. +150 −0 lib/geshi/geshi/vb.php
  80. +199 −0 lib/geshi/geshi/vbnet.php
  81. +140 −0 lib/geshi/geshi/vhdl.php
  82. +444 −0 lib/geshi/geshi/visualfoxpro.php
  83. +147 −0 lib/geshi/geshi/xml.php
  84. +65 −0 lib/pastebin/config.inc.php
  85. +499 −0 lib/pastebin/db.file.class.php
  86. +479 −0 lib/pastebin/db.mysql.class.php
  87. +270 −0 lib/pastebin/diff.class.php
  88. +436 −0 lib/pastebin/pastebin.class.php
  89. BIN public_html/favicon.ico
  90. +529 −0 public_html/layout.php
  91. +229 −0 public_html/legacy.php
  92. +241 −0 public_html/pastebin.css
  93. +271 −0 public_html/pastebin.js
  94. +346 −0 public_html/pastebin.php
  95. +147 −0 public_html/translate.php
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

Large diffs are not rendered by default.

Oops, something went wrong.
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';
@@ -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');
+
+?>
Oops, something went wrong.

0 comments on commit 8e98696

Please sign in to comment.