The Components package is a developer tool focused on handling PEAR packages. While it may offer a few functionalities that can be of general use to people maintaining PEAR based packages the primary focus of the tool is to deal with the various Horde components.
The tool provides different modules each of which allow to perform a specific action. The most important ones are documented below.
The tool is a pure Horde 4/5 tool and has not seen a real release yet. You are currently encouraged to run it directly from a git checkout.
You must have the Horde framework installed within your PHP include path or supply an include path on the commandline. The standard procedure for this is detailed on this page. If it does not work, consider installing the `components` module with PEAR:
pear install horde/components/package.xml
Now you should be able to run the tool with:
php horde/components/bin/horde-components.php --help
If the installed Horde framework packages do not reside in your default include_path you can explicitly add the corresponding path on the command line by adding -D include_path=PATH.
The qc module performs various quality checks, including phpunit, phpmd (Mess Detector) and phpcpd (copy paste detector).
The qc module also has integration for PHP_CodeSniffer 2.x.
CodeSniffer is not shipped along with the component tool. If no CodeSniffer is older or CodeSniffer is 3.0 or newer, this part will be skipped.
This module offers the -u command line option. It will automatically update the package.xml manifest of a PEAR package. This primarily handles the content list of the package. So whenever you add new source code files or move existing ones you can easily generate an updated package list.
php horde/components/script/horde-components.php -u horde/framework/PACKAGE
Make sure you only add the path to the directory of the package. The package.xml element should not be added.
The command given above overwrites the old version of the file! If you only want a preview of what the command would generate you can use the -p option. But since the Horde components are maintained in git it is usually quite okay to just overwrite the old content. The git diff can be then used to validate that the changes introduced by the Components tool do not create any problems.
The dependency module offers the -D option and produces a dependency graph for a Horde component.
php horde/components/script/horde-components.php -L horde/framework/Mime List only contains required dependencies! Dependencies on PEAR itself are not displayed. |_Mime [pear.horde.org] |_idn [pecl.php.net] (EXTERNAL) ***STOP*** |_Net_SMTP [pear.php.net] (EXTERNAL) ***STOP*** |_Exception [pear.horde.org] |_Mail [pear.horde.org] |_Net_SMTP [pear.php.net] (EXTERNAL) ***STOP*** |_Exception [pear.horde.org] (ALREADY LISTED WITH Mime) ***STOP*** |_Stream_Filter [pear.horde.org] |_Support [pear.horde.org] |_Stream_Wrapper [pear.horde.org] |_Util [pear.horde.org] |_Url [pear.horde.org] |_Exception [pear.horde.org] (ALREADY LISTED WITH Mime) ***STOP***
As indicated in the output of the command this listing only lists the dependencies that are declared to be required within the package.xml manifests. If you want to have a list of all dependencies including the optional once you need to add the --verbose option.
If you need a really terse list of just the required elements you can add the --quiet option:
php horde/components/script/horde-components.php -L horde/framework/Mime --quiet List only contains required dependencies! Dependencies on PEAR itself are not displayed. Exception [pear.horde.org] Mail [pear.horde.org] Mime [pear.horde.org] Stream_Filter [pear.horde.org] Stream_Wrapper [pear.horde.org] Support [pear.horde.org] Url [pear.horde.org] Util [pear.horde.org] Net_SMTP [pear.php.net] idn [pecl.php.net]
For pear related functions like "snapshot" to work as expected, you MUST have the pear horde channel registered, the Horde_Role package installed and the horde_dir properly configured
Nothing reported yet.
Nothing added yet.
Back to the Developer Documentation