]> git.mjollnir.org Git - s9y.git/commitdiff
Serendipity can now be used without the bundled-libs directory.
authorgarvinhicking <garvinhicking>
Mon, 15 Aug 2005 09:50:10 +0000 (09:50 +0000)
committergarvinhicking <garvinhicking>
Mon, 15 Aug 2005 09:50:10 +0000 (09:50 +0000)
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

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_event_weblogping/serendipity_event_weblogping.php
plugins/serendipity_plugin_remoterss/serendipity_plugin_remoterss.php
serendipity_config.inc.php

index 3921cab025fb7cc1a48f3c47d2cb5e5adf5e49f4..0a57641fada3238a28d75b710c5154ec2e82d4a8 100644 (file)
@@ -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
 
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 04a9142389b040c08daf410c19db321b5e1fa6a9..9ae649b1a23317c9dccef6d1e34ff34a1ace6a33 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 068e685c6682e2eb89b73847353cf0da38481728..b91f5ca0a10139defcb84826d580096ded1a3e9e 100644 (file)
@@ -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') {
index 51a36985ed858549dcef011f1ab3c91889b2bedc..abc17cb147cfa8b8f5e8ade7b602d7d1a7b870c3 100644 (file)
@@ -211,7 +211,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 522b62fc062f3f0d415060ab6bed769c71c4ac38..eca9b13e7c01ec42ea3078dcf35ec10a92fe69b8 100644 (file)
@@ -1,6 +1,6 @@
 <?php # $Id$
 
-require_once S9Y_INCLUDE_PATH . 'bundled-libs/HTTP/Request.php';
+require_once S9Y_PEAR_PATH . 'HTTP/Request.php';
 
 // Probe for a language include with constants. Still include defines later on, if some constants were missing
 $probelang = dirname(__FILE__) . '/' . $serendipity['charset'] . 'lang_' . $serendipity['lang'] . '.inc.php';
index e0fdbb5aac2bbb4534ba5dc473360055d30eecad..b0b34e68d5b32feb61bae3666c100d8fc254f694 100644 (file)
@@ -64,7 +64,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') {
@@ -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);
 
index c3c4a7f55a9d78f1cfa5af726c13ad8b77282a24..a2269a7d176e3b27ad0d85ea87c83a95376f0c7d 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;
 
@@ -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'];
 }