From 8aa52544c933d0dc3b0f0b72ece15bb3cc28f7a6 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 15 Aug 2005 09:59:41 +0000 Subject: [PATCH] Backport support of local PEAR installation --- docs/NEWS | 18 ++++++++++++++++ include/admin/images.inc.php | 2 +- include/admin/importers/generic.inc.php | 2 +- include/functions.inc.php | 2 +- include/functions_smarty.inc.php | 2 +- .../serendipity_event_spartacus.php | 2 +- .../serendipity_plugin_remoterss.php | 4 ++-- serendipity_config.inc.php | 21 ++++++++++++++++--- 8 files changed, 43 insertions(+), 10 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 606529c..495b1a4 100644 --- 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) ------------------------------------------------------------------------ diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index 2182ff6..4919a75 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -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 diff --git a/include/admin/importers/generic.inc.php b/include/admin/importers/generic.inc.php index 55a4a77..5ea05a5 100644 --- a/include/admin/importers/generic.inc.php +++ b/include/admin/importers/generic.inc.php @@ -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); diff --git a/include/functions.inc.php b/include/functions.inc.php index c4d532e..79d6d9b 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -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"); diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index f1e5c50..a067061 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -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') { diff --git a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php index b9bd09e..23d09de 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -135,7 +135,7 @@ class serendipity_event_spartacus extends serendipity_event printf(PLUGIN_EVENT_SPARTACUS_FETCHED_BYTES_CACHE, strlen($data), $target); echo '
'; } 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') { diff --git a/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php b/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php index 187a45c..e52fe20 100644 --- a/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php +++ b/plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php @@ -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); diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index d9e2d35..843dd84 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -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']; } -- 2.39.5