From: garvinhicking Date: Mon, 15 Aug 2005 09:50:10 +0000 (+0000) Subject: Serendipity can now be used without the bundled-libs directory. X-Git-Tag: 0.9~213 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=554b57b9971b188f24d30c7291551cd668abdfdf;p=s9y.git Serendipity can now be used without the bundled-libs directory. 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 --- diff --git a/include/admin/images.inc.php b/include/admin/images.inc.php index 3921cab..0a57641 100644 --- a/include/admin/images.inc.php +++ b/include/admin/images.inc.php @@ -158,7 +158,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 04a9142..9ae649b 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 068e685..b91f5ca 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -135,7 +135,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 51a3698..abc17cb 100644 --- a/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php +++ b/plugins/serendipity_event_spartacus/serendipity_event_spartacus.php @@ -211,7 +211,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_event_weblogping/serendipity_event_weblogping.php b/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php index 522b62f..eca9b13 100644 --- a/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php +++ b/plugins/serendipity_event_weblogping/serendipity_event_weblogping.php @@ -1,6 +1,6 @@ sendRequest()) || $req->getResponseCode() != '200') { @@ -405,7 +405,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 c3c4a7f..a2269a7 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; @@ -145,6 +149,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 */ @@ -261,9 +279,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']; }