.. contents:: Contents .. section-numbering:: ======================== 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 `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`_. .. _`Git repositories`: https://www.horde.org/source/ .. _`PEAR server`: https://pear.horde.org .. _`Github`: https://github.com/horde .. _`PEAR`: https://pear.php.net/ .. _`Composer packages`: http://getcomposer.org -------------- 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 ============================== InstallInstructInstallInstruct You should use the `Horde Git Tools`_ to download and install multiple libraries or the whole framework at once. .. _`Horde Git Tools`: https://github.com/horde/git-tools Installing individual libraries from Git ======================================== 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: .. _`GitHub`: https://github.com/horde :: 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 `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_path`: https://php.net/manual/en/ini.core.php#ini.include-path :: // 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 `GitHub`_. Each library has its own subdirectory. The library package names are ALWAYS Horde_, and the directory names are . .. _`GitHub`: https://github.com/horde 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. .. _`package.xml`: https://pear.php.net/manual/en/guide.developers.package2.php .. _`PEAR`: https://pear.php.net .. _`PEAR installer`: https://pear.php.net/manual/en/installation.php 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.