6.0.0-beta13
4/11/26
  • Backlinks
  • Similar Pages
  • Attachments
  • History
  • Back to

[[toc]]

  • Horde Framework Module

The //Horde Framework// modules, also known as //Horde Libraries//, are an integral part of the //Horde Application Framework//. These modules are managed in our [https://www.horde.org/source/ Git repositories] and can be downloaded either from our [https://pear.horde.org PEAR server] or from [https://github.com/horde 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 [https://pear.php.net/ PEAR] and [http://getcomposer.org Composer packages].

++ Installation

Most of these methods require that you first tell your PEAR installation about the Horde PEAR channel:

pear channel-discover pear.horde.org

+++ Installing everything from Git

[[# InstallInstruct]] You should use the [https://github.com/horde/git-tools Horde Git Tools] to download and install multiple libraries or the whole framework at once.

+++ Installing individual libraries from Git

You can checkout and install individual packages directly from [https://github.com/horde 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 https://pear.horde.org/

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.

+++ If you already have a Horde release

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.

++ Use

If PHP has been set up properly, the local PEAR repository should be in PHP's {{[https://php.net/manual/en/ini.core.php#ini.include-path 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.

++ Development

+++ Git organization

All libraries are managed in [https://github.com/horde GitHub]. Each library has its own subdirectory. The library package names are ALWAYS {{Horde_}}, and the directory names are {{}}.

Each package directory contains a [https://pear.php.net/manual/en/guide.developers.package2.php package.xml] file with package descriptions, file listings, dependencies, change logs etc. As all Horde Libraries are following the [https://pear.php.net PEAR] standard, they can be installed using the [https://pear.php.net/manual/en/installation.php PEAR installer] or may be symlinked to a subdirectory of the Horde installation. For further instructions, see the Installation Instructions located above.

+++ Directory structure

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.