]> git.mjollnir.org Git - s9y.git/commitdiff
Backport support of local PEAR installation
authorgarvinhicking <garvinhicking>
Mon, 15 Aug 2005 09:59:41 +0000 (09:59 +0000)
committergarvinhicking <garvinhicking>
Mon, 15 Aug 2005 09:59:41 +0000 (09:59 +0000)
docs/NEWS
include/admin/images.inc.php
include/admin/importers/generic.inc.php
include/functions.inc.php
include/functions_smarty.inc.php
plugins/serendipity_event_spartacus/serendipity_event_spartacus.php
plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php
serendipity_config.inc.php

index 606529c954d4e708ff0d27d0c0ed7e48fa822835..495b1a488d720adeac74f44a3706ea4e96852ae8 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,24 @@
 Version 0.8.4 ()
 ------------------------------------------------------------------------
 
+    * Unbundle Serendipity XML-RPC functions from the bundled distribution.
+      You will now need to install the additional plugin "Post via XML-RPC"
+      (serendipity_event_xmlrpc) to make entry posts via this interface.
+      The ongoing security issues with this interface and the little usage
+      of this functionality by the broad public have forced this move.
+      After installing this plugin you can use the same URL and nothing
+      will change for XML-RPC users. (garvinhicking)
+
+   * Optionally allow using a local PEAR installation. Set 
+     $serendipity['use_PEAR'] = true
+     in your serendipity_config_local.inc.php or serendipity_config.inc.php
+     file. The required packages can be found in the 
+     bundled-libs/.current_version file. (garvinhicking)
+
+   * Append the comment id to the mail that is sent to subscribers of
+     an entry, so that they can jump to the submitted comment immediately.
+     (garvinhicking)
+   
 Version 0.8.3 (August 4th, 2004)
 ------------------------------------------------------------------------
 
index 2182ff680228c52224bb7df41488bb79bf752963..4919a7540fd4cfb1e671c622cd98ce2a2bbbd036 100644 (file)
@@ -136,7 +136,7 @@ switch ($serendipity['GET']['adminAction']) {
         if (file_exists($target)) {
             echo '(' . $target . ') ' . ERROR_FILE_EXISTS_ALREADY;
         } else {
-            require_once S9Y_INCLUDE_PATH . 'bundled-libs/HTTP/Request.php';
+            require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
             $req = &new HTTP_Request($serendipity['POST']['imageurl']);
             // Try to get the URL
 
index 55a4a772105113da707ecf9bee8b3cd8e6af9b18..5ea05a59a5fd26e4afeb160527fa79dcef768120 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team)
 # All rights reserved.  See LICENSE file for licensing details
 
-require_once 'bundled-libs/Onyx/RSS.php';
+require_once S9Y_PEAR_PATH . 'Onyx/RSS.php';
 
 class Serendipity_Import_Generic extends Serendipity_Import {
     var $info        = array('software' => IMPORT_GENERIC_RSS);
index c4d532ef19623f4da07c18df5d1c240b01912289..79d6d9b2be91a610ae6969319d8cca210a63e7b5 100644 (file)
@@ -6,7 +6,7 @@ $serendipity['imageList'] = array();
 include_once(S9Y_INCLUDE_PATH . "include/db/db.inc.php");
 include_once(S9Y_INCLUDE_PATH . "include/compat.inc.php");
 include_once(S9Y_INCLUDE_PATH . "include/functions_config.inc.php");
-include_once(S9Y_INCLUDE_PATH . "bundled-libs/XML/RPC.php");
+include_once(S9Y_PEAR_PATH . "XML/RPC.php");
 include_once(S9Y_INCLUDE_PATH . "include/plugin_api.inc.php");
 include_once(S9Y_INCLUDE_PATH . "include/functions_images.inc.php");
 include_once(S9Y_INCLUDE_PATH . "include/functions_installer.inc.php");
index f1e5c504bc276660026b55ea81fac3b6a055be4e..a0670610a9de6f9ec9de8151b23862b4b1429304 100644 (file)
@@ -131,7 +131,7 @@ function serendipity_smarty_init() {
     global $serendipity;
 
     if (!isset($serendipity['smarty'])) {
-        @define('SMARTY_DIR', S9Y_INCLUDE_PATH . 'bundled-libs/Smarty/libs/');
+        @define('SMARTY_DIR', S9Y_PEAR_PATH . 'Smarty/libs/');
         require_once SMARTY_DIR . 'Smarty.class.php';
         $serendipity['smarty'] = new Smarty;
         if ($serendipity['production'] === 'debug') {
index b9bd09ebd834a8ec42c3f6fa2f1c51c96e95663f..23d09de4ab605ca1e414f9c41c22980757f80ba1 100644 (file)
@@ -135,7 +135,7 @@ class serendipity_event_spartacus extends serendipity_event
             printf(PLUGIN_EVENT_SPARTACUS_FETCHED_BYTES_CACHE, strlen($data), $target);
             echo '<br />';
         } else {
-            require_once S9Y_INCLUDE_PATH . 'bundled-libs/HTTP/Request.php';
+            require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
             $req = &new HTTP_Request($url);
 
             if (PEAR::isError($req->sendRequest()) || $req->getResponseCode() != '200') {
index 187a45c6b5c9f3c4832429541b0df48f30b55470..e52fe203a20b85ef23b3df3b1f9fbd1f10e84681 100644 (file)
@@ -94,7 +94,7 @@ class s9y_remoterss_XMLTree {
     }
 
     function GetXMLTree($file) {
-        require_once S9Y_INCLUDE_PATH . 'bundled-libs/HTTP/Request.php';
+        require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
         $req = &new HTTP_Request($file);
 
         if (PEAR::isError($req->sendRequest()) || $req->getResponseCode() != '200') {
@@ -438,7 +438,7 @@ class serendipity_plugin_remoterss extends serendipity_plugin {
             if (!file_exists($feedcache) || filesize($feedcache) == 0 || filemtime($feedcache) < (time() - $cachetime)) {
 
                 if ($feedtype == 'rss') {
-                    require_once 'bundled-libs/Onyx/RSS.php';
+                    require_once S9Y_PEAR_PATH . 'Onyx/RSS.php';
                     $c = &new Onyx_RSS();
                     $c->parse($rssuri);
 
index d9e2d359529b1d90bdcb2533b0b494a66ff5c9eb..843dd84c1a0ad1fd08da6207d42f867257253d1f 100644 (file)
@@ -64,6 +64,10 @@ if (!isset($serendipity['fetchLimit'])) {
     $serendipity['fetchLimit'] = 15;
 }
 
+if (!isset($serendipity['use_PEAR'])) {
+    $serendipity['use_PEAR'] = false;
+}
+
 // Should IFRAMEs be used for previewing entries and sending trackbacks?
 $serendipity['use_iframe'] = true;
 
@@ -185,6 +189,20 @@ if (file_exists($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/se
 
 define('IS_up2date', version_compare($serendipity['version'], $serendipity['versionInstalled'], '<='));
 
+// Check whether local or global PEAR should be used. You can put a
+// $serendipity['use_PEAR'] = true;
+// in your serendipity_config_local.inc.php file to enable this.
+// The required PEAR (and other) packages are mentioned in the file
+// bundled-libs/.current_version
+$old_include = @ini_get('include_path');
+if (@ini_set('include_path', $old_include . PATH_SEPARATOR . $serendipity['serendipityPath'] . PATH_SEPARATOR . $serendipity['serendipityPath'] . 'bundled-libs/') && $serendipity['use_PEAR']) {
+    @define('S9Y_PEAR', true);
+    @define('S9Y_PEAR_PATH', '');
+} else {
+    @define('S9Y_PEAR', false);
+    @define('S9Y_PEAR_PATH', S9Y_INCLUDE_PATH . 'bundled-libs/');
+}
+
 /*
  *  Include main functions
  */
@@ -291,9 +309,6 @@ if (!isset($_SESSION['serendipityAuthedUser'])) {
     $_SESSION['serendipityAuthedUser'] = false;
 }
 
-$old_include = @ini_get('include_path');
-@ini_set('include_path', $serendipity['serendipityPath'] . PATH_SEPARATOR . $serendipity['serendipityPath'] . 'bundled-libs/' . PATH_SEPARATOR . $old_include);
-
 if (isset($_SESSION['serendipityUser'])) {
     $serendipity['user']  = $_SESSION['serendipityUser'];
 }