The Horde Framework modules, also known as Horde Libraries, are an integral part of the Horde Application Framework. These modules are managed in our Git repositories and can be downloaded either from our PEAR server or from Github directly. The modules are general purpose libraries that are being used by several Horde applications or the framework itself, but can also be utilized outside the Framework in custom PHP solutions. They are developed, packaged, and distributed as PEAR and Composer packages.
Most of these methods require that you first tell your PEAR installation about the Horde PEAR channel:
pear channel-discover pear.horde.org
You should use the Horde Git Tools to download and install multiple libraries or the whole framework at once.
You can checkout and install individual packages directly from GitHub or with the Horde Git Tools like above. For example, to install the Horde_Compress package, in the Compress directory, you would run:
pear install Compress/package.xml
Installing from pear.horde.org is simple. Once you have "discovered" the channel as described above, you can install Horde packages just like other PEAR packages. For example to install the Compress package:
pear install horde/Horde_Compress
To view the available packages, their states (alpha, beta, stable), dependencies, and other information about them, visit https://pear.horde.org.
Horde releases come with all of the required framework libraries installed, and also include the necessary code to make everything available to Horde without any further installation or PHP configuration.
If PHP has been set up properly, the local PEAR repository should be in PHP's include_path. If installing the Horde Libraries either separately with the PEAR installer or using the Horde Git Tools, they are available alongside PEAR's packages, and can be included in your custom code the same way:
// Include PEAR's DB package. require_once 'DB.php'; // Include PEAR's Text_Wiki package. require_once 'Text/Wiki.php'; // Include Horde's Horde_Tree package. require_once 'Horde/Tree.php'; // Include Horde's Horde_Text_Flowed package. require_once 'Horde/Text/Flowed.php';
If using the Horde environment, these require_once statements are not needed as the libraries will be autoloaded the first time they are used.
All libraries are managed in GitHub. Each library has its own subdirectory. The library package names are ALWAYS Horde_<Name>, and the directory names are <Name>.
Each package directory contains a package.xml file with package descriptions, file listings, dependencies, change logs etc. As all Horde Libraries are following the PEAR standard, they can be installed using the PEAR installer or may be symlinked to a subdirectory of the Horde installation. For further instructions, see the Installation Instructions located above.
Name/ package.xml lib/ Horde/ Name.php Name/ foo.php bar.php ...
After installation:
lib/ Horde/ Name.php Name/ foo.php bar.php ...
A rule of thumb is that each underscore in a package name is translated to an additional directory after installation.