diff --git a/public/index.php b/public/index.php index dbba41e6604d56c0e193924359ba5ee098ce7d4c..65c50db2961530bffed8f0bee2ccf91bdb351293 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';