From 2c880402ed59bc95801223836de4a05af6e5d31e Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 23 Jul 2012 13:56:40 -0400
Subject: [PATCH] Workaround for "Cannot redeclare class" PEAR bug.

---
 public/index.php | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/public/index.php b/public/index.php
index dbba41e6604..65c50db2961 100644
--- a/public/index.php
+++ b/public/index.php
@@ -25,6 +25,14 @@ defined('LOCAL_OVERRIDE_DIR')
 
 chdir(APPLICATION_PATH);
 
+// Ensure vendor/ is on include_path; some PEAR components may not load correctly
+// otherwise (i.e. File_MARC may cause a "Cannot redeclare class" error by pulling
+// from the shared PEAR directory instead of the local copy):
+$pathParts = array();
+$pathParts[] = APPLICATION_PATH . '/vendor';
+$pathParts[] = get_include_path();
+set_include_path(implode(PATH_SEPARATOR, $pathParts));
+
 // Composer autoloading
 if (file_exists('vendor/autoload.php')) {
     $loader = include 'vendor/autoload.php';
-- 
GitLab