Using PEAR package Horde_Text_Diff

2020-02-14 08:18发布

问题:

I installed Horde_Text_Diff, which supersedes Text_Diff. Here's the problem: when I try to use it, it gives me:

Class 'Horde_Text_Diff_Engine_Native' not found

I looked at the files, and it looks like there are fifteen or so classes that depend on each other, and none of the files include each other. Do I have to do this manually? Again, there are about fifteen files.

Is this how PEAR packages are supposed to work?

回答1:

You need to use a PSR-0 compatible autoloader that automatically includes classes when they are available from your include path. Horde provides one, Horde_Autoloader.