summaryrefslogtreecommitdiffstats
path: root/paste
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-12-11 03:19:53 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2009-12-11 03:19:53 +0100
commit77e5a85ff8fbf372cee3b2ded3fc2aab3f4377f0 (patch)
treea9066eb08923ee0715510d0624678c4333c98726 /paste
parente98422a09892675f23852320e0d46b4071bf22b4 (diff)
downloadrafb-nopaste-77e5a85ff8fbf372cee3b2ded3fc2aab3f4377f0.tar.gz
rafb-nopaste-77e5a85ff8fbf372cee3b2ded3fc2aab3f4377f0.tar.xz
rafb-nopaste-77e5a85ff8fbf372cee3b2ded3fc2aab3f4377f0.zip
updated config
Diffstat (limited to '')
-rw-r--r--paste/config.php31
-rw-r--r--paste/paste.php8
2 files changed, 22 insertions, 17 deletions
diff --git a/paste/config.php b/paste/config.php
index 66d655a..49117eb 100644
--- a/paste/config.php
+++ b/paste/config.php
@@ -4,6 +4,7 @@ This software is licensed through a BSD-style License.
http://www.opensource.org/licenses/bsd-license.php
Copyright (c) 2002 - 2009 Jacob D. Cohen
+Copyright (c) 2009 Alexander Sulfrian
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -32,25 +33,23 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
- $Config = array(
- # This is the domain where this pastebin is running
- 'site_domain' => 'www.example.net',
+$config = array(
+ // This is the domain where this pastebin is running
+ 'site_domain' => 'www.example.net',
- # This is the part after the domain where this pastebin will be found.
- 'site_path' => '/paste/',
+ // This is the part after the domain where this pastebin will be found.
+ 'site_path' => '/paste/',
- # This is the directory where pastes will be stored
- 'results_dir' => 'results',
+ // This is the path of the URL that will be generated for sharing (allows
+ // shorter URLs to be used if you've set something up on your web server
+ // to support this.
+ // short_results_path' => 'http://www.example.net/p/'
- # This is the path of the URL that will be generated for sharing (allows
- # shorter URLs to be used if you've set something up on your web server
- # to support this.
- #'short_results_path' => 'http://www.example.net/p/'
+ // Change this to a unique value
+ 'token_salt' => 'saltsaltsalt',
- # Change this to a unique value
- 'token_salt' => 'saltsaltsalt',
- );
+ // StorageEngine to save pastes
+ 'storage' => NULL,
+);
-require_once('include/storage/FileStorage.php');
-$storage = new MysqlStorage('mysql', 'rafb', 'rafb', 'paste', 'rafb');
?>
diff --git a/paste/paste.php b/paste/paste.php
index 17cec80..fbcdf2c 100644
--- a/paste/paste.php
+++ b/paste/paste.php
@@ -32,8 +32,14 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+require_once("config.php");
require_once("include/pastify.inc");
-require_once("include/createpage.inc");
+
+if (!is_subclass_of($config['storage'], 'StorageEngine'))
+{
+ header('HTTP/1.0 503 Service Unavailable');
+ die('Invalid config');
+}
$refererurl = $_SERVER['HTTP_REFERER'];
$refererurl = preg_replace("/\/[^\/]*$/", "", $refererurl);