Wrap Pear Packages Into Module [Solved]

I’m trying to make module that contains a selection of Pear packages:

Here is a sample of directory structure I’m using


protected/

   modules/

      pear/

 		components/

 		controllers/

 		lib/

            pear/

   			Genealogy/

                    Gedcom/

           			Genealogy_Gedcom.php

           			Genealogy_Parse.php

Inside the file Genealogy_Gedcom.php at line 34 there is this line: “require_once ‘Gedcom/Parser.php’;” This file does not exist! Take a look at the files belonging to this package, they are all prefixed “Genealogy_”, but there are many references in the beginning of the files where they skip this prefix.

I’ve made an autoloader that adds the protected/modules/lib/pear/ to include_path and will try to locate a class Genealogy_Gedcom as “Genealogy/Gedcom.php”, and that works. But when that class (Genealogy_Gedcom) again wants to require file references that are wrong, it fails.

It obviously works when Pear is properly installed on a system, but I am unable to wrap parts of Pear into a Yii module.

So what am I missing here? :)

I found a solution. The files are listed in the repository with names like Genealogy_Object.php and Genealogy_Individual.php, but in code they are required with the names "Gedcom/Object.php" and "Gedcom/Individual.php". I found out that when you install Pear Package Manager, it installs the packages with the file names that are asked for (required), and the include_path in php.ini has the path to the packages added.

So to make a module for my Yii project where I only have the Pear packages that I need available, I had to add the path to the packages to the include_path, for example through the function Yii::import.