cvs: peardoc /en/pyrus about.xml /en/pyrus/differences customcommands.xml customroles.xml customtasks.xml
| From: | Greg Beaver | Date: | Fri, 26 Jun 2009 03:25:48 +0000 |
| Subject: | cvs: peardoc /en/pyrus about.xml /en/pyrus/differences customcommands.xml customroles.xml customtasks.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11691@lists.php.net to get a copy of this message | ||
cellog Fri Jun 26 03:25:48 2009 UTC
Added files:
/peardoc/en/pyrus/differences customcommands.xml
Modified files:
/peardoc/en/pyrus about.xml
/peardoc/en/pyrus/differences customroles.xml customtasks.xml
Log:
document differences between custom command, roles and tasks in Pyrus
http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/about.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/pyrus/about.xml diff -u peardoc/en/pyrus/about.xml:1.1 peardoc/en/pyrus/about.xml:1.2 --- peardoc/en/pyrus/about.xml:1.1 Thu Jun 18 04:50:40 2009 +++ peardoc/en/pyrus/about.xml Fri Jun 26 03:25:48 2009 @@ -12,6 +12,7 @@ &pyrus.differences.frompear; &pyrus.differences.postinstallscripts; + &pyrus.differences.customcommands; &pyrus.differences.customroles; &pyrus.differences.customtasks; </chapter> http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/differences/customroles.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/pyrus/differences/customroles.xml diff -u peardoc/en/pyrus/differences/customroles.xml:1.1 peardoc/en/pyrus/differences/customroles.xml:1.2 --- peardoc/en/pyrus/differences/customroles.xml:1.1 Thu Jun 18 04:50:40 2009 +++ peardoc/en/pyrus/differences/customroles.xml Fri Jun 26 03:25:48 2009 @@ -4,6 +4,97 @@ <section xml:id="pyrus.differences.customroles.overview"> <info><title>Overview</title></info> - <para>This is a work in progress.</para> + <para> + Custom file roles (documented <link linkend="guide.migrating.customroles">here</link>) + have changed substantially in Pyrus. Fortunately, the usage of roles in package.xml + remains unchanged, and Pyrus's expectation of custom role implementation does not conflict + or overlap with PEAR's at all, so custom role packages can easily be designed + to work with both PEAR and Pyrus. + </para> + <para> + The biggest difference between how a custom role is implemented in Pyrus has + to do with the new plugin system (documented <link linkend="pyrus.plugins">here</link>). + Before reading any further, it may be a good idea to familiarize yourself with + the way that plugins work in Pyrus by reading the documentation on plugins, + then return back to finish reading about custom roles. + </para> + <para> + Pyrus modifies the XML description file for custom file roles slightly, here + is the PEAR version of a role: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>php_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile>1</phpfile> + <executable /> + <phpextension /> + <config_vars /> +</role> ]]> + </programlisting> + </para> + <para> + And the same role as implemented in Pyrus: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +<role version="2.0" xmlns="http://pear2.php.net/dtd/customrole-2.0"> + <name>php</name> + <classprefix>PEAR2_Pyrus_Installer_Role</classprefix> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>php_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile>1</phpfile> + <executable /> + <phpextension /> +</role> + ]]> + </programlisting> + </para> + <para> + The most obvious difference is that Pyrus now includes the name of the role, + PEAR extracts the role name from the name of the file (which in the + example above was <literal>Php.xml</literal>). + </para> + <para> + The details of new tags like <classprefix> and <autoloadpath> are + documented in the full documentation of custom roles + <link linkend="pyrus.plugins.role">here</link>. + </para> + <para> + This XML metadata file is identified by Pyrus through the use of the file role + <literal>customrole</literal>, which is used in the custom role's package.xml. + Here is an example from the <contents> of a package.xml: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +... + <contents> + <dir name="data"> + <file name="myrole.xml" role="customrole"/> + <file name="someotherdata.csv" role="data"/> + </dir> + </contents> +... + ]]> + </programlisting> + </para> </section> </section> http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/differences/customtasks.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/pyrus/differences/customtasks.xml diff -u peardoc/en/pyrus/differences/customtasks.xml:1.1 peardoc/en/pyrus/differences/customtasks.xml:1.2 --- peardoc/en/pyrus/differences/customtasks.xml:1.1 Thu Jun 18 04:50:40 2009 +++ peardoc/en/pyrus/differences/customtasks.xml Fri Jun 26 03:25:48 2009 @@ -4,6 +4,65 @@ <section xml:id="pyrus.differences.customtasks.overview"> <info><title>Overview</title></info> - <para>This is a work in progress.</para> + <para> + Custom file tasks (documented <link linkend="guide.migrating.customtasks">here</link>) + have changed substantially in Pyrus. Fortunately, the XML format of tasks + used in package.xml remains the + same, and Pyrus's expectation of custom task implementation does not conflict + or overlap with PEAR's at all, so custom task packages can easily be designed + to work with both PEAR and Pyrus. + </para> + <para> + The biggest difference between how a custom task is implemented in Pyrus has + to do with the new plugin system (documented <link linkend="pyrus.plugins">here</link>). + Before reading any further, it may be a good idea to familiarize yourself with + the way that plugins work in Pyrus by reading the documentation on plugins, + then return back to finish reading about custom tasks. + </para> + <para> + In PEAR, custom tasks are detected simply by scanning the + <literal>PEAR/Tasks</literal> directory, and no differentiation is made between + tasks built into PEAR, and external custom tasks. + </para> + <para> + Pyrus custom tasks are detected through the use a new XML metadata format. + The format is simple, and looks like this: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +<?xml version="1.0" encoding="UTF-8"?> +<task xmlns="http://pear2.php.net/dtd/customtask-2.0" version="2.0"> + <name>mytask</name> + <classprefix>vendor_PackageName</classprefix> + <autoloadpath/> +</task> + ]]> + </programlisting> + </para> + <para> + The details of what <classprefix> and <autoloadpath> mean are + revealed in the full documentation of custom tasks + <link linkend="pyrus.plugins.task">here</link>. + </para> + <para> + This XML metadata file is identified by Pyrus through the use of the file role + <literal>customtask</literal>, which is used in the custom task's package.xml. + Here is an example from the <contents> of a package.xml: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +... + <contents> + <dir name="data"> + <file name="mytask.xml" role="customtask"/> + <file name="someotherdata.csv" role="data"/> + </dir> + </contents> +... + ]]> + </programlisting> + </para> </section> </section> http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/differences/customcommands.xml?view=markup&rev=1.1 Index: peardoc/en/pyrus/differences/customcommands.xml +++ peardoc/en/pyrus/differences/customcommands.xml <?xml version="1.0" encoding="utf-8"?> <section xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="pyrus.differences.customcommands"> <info><title>Pyrus Custom Commands: differences from PEAR</title></info> <section xml:id="pyrus.differences.customcommands.overview"> <info><title>Overview</title></info> <para> Custom commands have changed substantially in Pyrus. PEAR commands draw their information from Xml files located in the directory <literal>PEAR/Command</literal> and require all commands to be implemented in a single file. Pyrus is much more flexible on this account, and extends the custom XML format used to define commands. Because of this difference, it is theoretically possible to create custom commands that will work in both the PEAR Installer and in Pyrus, although the internal implementation of these commands will necessarily be quite different. </para> <para> The biggest difference between how a custom command is implemented in Pyrus has to do with the new plugin system (documented <link linkend="pyrus.plugins">here</link>). Before reading any further, it may be a good idea to familiarize yourself with the way that plugins work in Pyrus by reading the documentation on plugins, then return back to finish reading about custom commands. </para> <para> Here is PEAR's version of the xml for the <literal>install</literal> command: </para> <para> <programlisting role="xml"> <![CDATA[ <commands version="1.0"> <install> <summary>Install Package</summary> <function>doInstall</function> <shortcut>i</shortcut> <options> <force> <shortopt>f</shortopt> <doc>will overwrite newer installed packages</doc> </force> <loose> <shortopt>l</shortopt> <doc>do not check for recommended dependency version</doc> </loose> <nodeps> <shortopt>n</shortopt> <doc>ignore dependencies, install anyway</doc> </nodeps> <register-only> <shortopt>r</shortopt> <doc>do not install files, only register the package as installed</doc> </register-only> <soft> <shortopt>s</shortopt> <doc>soft install, fail silently, or upgrade if already installed</doc> </soft> <nobuild> <shortopt>B</shortopt> <doc>don't build C extensions</doc> </nobuild> <nocompress> <shortopt>Z</shortopt> <doc>request uncompressed files when downloading</doc> </nocompress> <installroot> <shortopt>R</shortopt> <doc>root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM</doc> <arg>DIR</arg> </installroot> <packagingroot> <shortopt>P</shortopt> <doc>root directory used when packaging files, like RPM packaging</doc> <arg>DIR</arg> </packagingroot> <ignore-errors> <shortopt></shortopt> <doc>force install even if there were errors</doc> </ignore-errors> <alldeps> <shortopt>a</shortopt> <doc>install all required and optional dependencies</doc> </alldeps> <onlyreqdeps> <shortopt>o</shortopt> <doc>install all required dependencies</doc> </onlyreqdeps> <offline> <shortopt>O</shortopt> <doc>do not attempt to download any urls or contact channels</doc> </offline> <pretend> <shortopt>p</shortopt> <doc>Only list the packages that would be downloaded</doc> </pretend> </options> <doc>[channel/]<package> ... Installs one or more PEAR packages. You can specify a package to install in four ways: "Package-1.0.tgz" : installs from a local file "http://example.com/Package-1.0.tgz" : installs from anywhere on the net. "package.xml" : installs the package described in package.xml. Useful for testing, or for wrapping a PEAR package in another package manager such as RPM. "Package[-version/state][.tar]" : queries your default channel's server ({config master_server}) and downloads the newest package with the preferred quality/state ({config preferred_state}). To retrieve Package version 1.1, use "Package-1.1," to retrieve Package state beta, use "Package-beta." To retrieve an uncompressed file, append .tar (make sure there is no file by the same name first) To download a package from another channel, prefix with the channel name like "channel/Package" More than one package may be specified at once. It is ok to mix these four ways of specifying packages. </doc> </install> </commands> ]]> </programlisting> </para> <para> And the same command as implemented in Pyrus: </para> <para> <programlisting role="xml"> <![CDATA[ <?xml version="1.0" encoding="UTF-8"?> <commands version="2.0" xmlns="http://pear2.php.net/dtd/customcommand-2.0"> <command> <name>install</name> <class>PEAR2_Pyrus_ScriptFrontend_Commands</class> <function>install</function> <summary>Install a package. Use install --plugin to install plugins</summary> <shortcut>i</shortcut> <options> <option> <name>plugin</name> <shortopt>p</shortopt> <type><bool/></type> <doc>Manage plugin installation only</doc> </option> <option> <name>packagingroot</name> <shortopt>r</shortopt> <type><string/></type> <doc>Install the package in a directory in preparation for packaging with tools like RPM</doc> </option> <option> <name>optionaldeps</name> <shortopt>o</shortopt> <type><bool/></type> <doc>Automatically download and install all optional dependencies</doc> </option> <option> <name>force</name> <shortopt>f</shortopt> <type><bool/></type> <doc>Force the installation to proceed independent of errors. USE SPARINGLY.</doc> </option> </options> <arguments> <argument> <name>package</name> <multiple>1</multiple> <optional>0</optional> <doc>package.xml, local package archive, remove package archive, or abstract package.</doc> </argument> </arguments> <doc>Installs listed packages. local package.xml example: php pyrus.phar install package.xml local package archive example: php pyrus.phar install PackageName-1.2.0.tar remote package archive example: php pyrus.phar install http://www.example.com/PackageName-1.2.0.tgz Examples of an abstract package: php pyrus.phar install PackageName installs PackageName from the default channel with stability preferred_state php pyrus.phar pear/PackageName installs PackageName from the pear.php.net channel with stability preferred_state php pyrus.phar install channel://doc.php.net/PackageName installs PackageName from the doc.php.net channel with stability preferred_state php pyrus.phar install PackageName-beta installs PackageName from the default channel, beta or stable stability php pyrus.phar install PackageName-1.2.0 installs PackageName from the default channel, version 1.2.0</doc> </command> </commands> ]]> </programlisting> </para> <para> The format for commands in Pyrus is much more fine-grained, and provides both better validation and better presentation of options and arguments as passed in from the user. In addition, Pyrus allows fine-grained specification of where a command is located, and automatically registers an autoloader to load the class implementing the command, and any dependent classes in the same location. </para> <para> The details of new tags like <classprefix> and <autoloadpath> are documented in the full documentation of custom roles <link linkend="pyrus.plugins.command">here</link>. </para> <para> This XML metadata file is identified by Pyrus through the use of the file role <literal>customcommand</literal>, which is used in the custom command's package.xml. Here is an example from the <contents> of a package.xml: </para> <para> <programlisting role="xml"> <![CDATA[.... <contents> <dir name="data"> <file name="commands.xml" role="customcommand"/> <file name="someotherdata.csv" role="data"/> </dir> </contents>.... ]]> </programlisting> </para> </section> </section>
http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/about.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/pyrus/about.xml diff -u peardoc/en/pyrus/about.xml:1.1 peardoc/en/pyrus/about.xml:1.2 --- peardoc/en/pyrus/about.xml:1.1 Thu Jun 18 04:50:40 2009 +++ peardoc/en/pyrus/about.xml Fri Jun 26 03:25:48 2009 @@ -12,6 +12,7 @@ &pyrus.differences.frompear; &pyrus.differences.postinstallscripts; + &pyrus.differences.customcommands; &pyrus.differences.customroles; &pyrus.differences.customtasks; </chapter> http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/differences/customroles.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/pyrus/differences/customroles.xml diff -u peardoc/en/pyrus/differences/customroles.xml:1.1 peardoc/en/pyrus/differences/customroles.xml:1.2 --- peardoc/en/pyrus/differences/customroles.xml:1.1 Thu Jun 18 04:50:40 2009 +++ peardoc/en/pyrus/differences/customroles.xml Fri Jun 26 03:25:48 2009 @@ -4,6 +4,97 @@ <section xml:id="pyrus.differences.customroles.overview"> <info><title>Overview</title></info> - <para>This is a work in progress.</para> + <para> + Custom file roles (documented <link linkend="guide.migrating.customroles">here</link>) + have changed substantially in Pyrus. Fortunately, the usage of roles in package.xml + remains unchanged, and Pyrus's expectation of custom role implementation does not conflict + or overlap with PEAR's at all, so custom role packages can easily be designed + to work with both PEAR and Pyrus. + </para> + <para> + The biggest difference between how a custom role is implemented in Pyrus has + to do with the new plugin system (documented <link linkend="pyrus.plugins">here</link>). + Before reading any further, it may be a good idea to familiarize yourself with + the way that plugins work in Pyrus by reading the documentation on plugins, + then return back to finish reading about custom roles. + </para> + <para> + Pyrus modifies the XML description file for custom file roles slightly, here + is the PEAR version of a role: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +<role version="1.0"> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>php_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile>1</phpfile> + <executable /> + <phpextension /> + <config_vars /> +</role> ]]> + </programlisting> + </para> + <para> + And the same role as implemented in Pyrus: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +<role version="2.0" xmlns="http://pear2.php.net/dtd/customrole-2.0"> + <name>php</name> + <classprefix>PEAR2_Pyrus_Installer_Role</classprefix> + <releasetypes>php</releasetypes> + <releasetypes>extsrc</releasetypes> + <releasetypes>extbin</releasetypes> + <releasetypes>zendextsrc</releasetypes> + <releasetypes>zendextbin</releasetypes> + <installable>1</installable> + <locationconfig>php_dir</locationconfig> + <honorsbaseinstall>1</honorsbaseinstall> + <unusualbaseinstall /> + <phpfile>1</phpfile> + <executable /> + <phpextension /> +</role> + ]]> + </programlisting> + </para> + <para> + The most obvious difference is that Pyrus now includes the name of the role, + PEAR extracts the role name from the name of the file (which in the + example above was <literal>Php.xml</literal>). + </para> + <para> + The details of new tags like <classprefix> and <autoloadpath> are + documented in the full documentation of custom roles + <link linkend="pyrus.plugins.role">here</link>. + </para> + <para> + This XML metadata file is identified by Pyrus through the use of the file role + <literal>customrole</literal>, which is used in the custom role's package.xml. + Here is an example from the <contents> of a package.xml: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +... + <contents> + <dir name="data"> + <file name="myrole.xml" role="customrole"/> + <file name="someotherdata.csv" role="data"/> + </dir> + </contents> +... + ]]> + </programlisting> + </para> </section> </section> http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/differences/customtasks.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/pyrus/differences/customtasks.xml diff -u peardoc/en/pyrus/differences/customtasks.xml:1.1 peardoc/en/pyrus/differences/customtasks.xml:1.2 --- peardoc/en/pyrus/differences/customtasks.xml:1.1 Thu Jun 18 04:50:40 2009 +++ peardoc/en/pyrus/differences/customtasks.xml Fri Jun 26 03:25:48 2009 @@ -4,6 +4,65 @@ <section xml:id="pyrus.differences.customtasks.overview"> <info><title>Overview</title></info> - <para>This is a work in progress.</para> + <para> + Custom file tasks (documented <link linkend="guide.migrating.customtasks">here</link>) + have changed substantially in Pyrus. Fortunately, the XML format of tasks + used in package.xml remains the + same, and Pyrus's expectation of custom task implementation does not conflict + or overlap with PEAR's at all, so custom task packages can easily be designed + to work with both PEAR and Pyrus. + </para> + <para> + The biggest difference between how a custom task is implemented in Pyrus has + to do with the new plugin system (documented <link linkend="pyrus.plugins">here</link>). + Before reading any further, it may be a good idea to familiarize yourself with + the way that plugins work in Pyrus by reading the documentation on plugins, + then return back to finish reading about custom tasks. + </para> + <para> + In PEAR, custom tasks are detected simply by scanning the + <literal>PEAR/Tasks</literal> directory, and no differentiation is made between + tasks built into PEAR, and external custom tasks. + </para> + <para> + Pyrus custom tasks are detected through the use a new XML metadata format. + The format is simple, and looks like this: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +<?xml version="1.0" encoding="UTF-8"?> +<task xmlns="http://pear2.php.net/dtd/customtask-2.0" version="2.0"> + <name>mytask</name> + <classprefix>vendor_PackageName</classprefix> + <autoloadpath/> +</task> + ]]> + </programlisting> + </para> + <para> + The details of what <classprefix> and <autoloadpath> mean are + revealed in the full documentation of custom tasks + <link linkend="pyrus.plugins.task">here</link>. + </para> + <para> + This XML metadata file is identified by Pyrus through the use of the file role + <literal>customtask</literal>, which is used in the custom task's package.xml. + Here is an example from the <contents> of a package.xml: + </para> + <para> + <programlisting role="xml"> + <![CDATA[ +... + <contents> + <dir name="data"> + <file name="mytask.xml" role="customtask"/> + <file name="someotherdata.csv" role="data"/> + </dir> + </contents> +... + ]]> + </programlisting> + </para> </section> </section> http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/differences/customcommands.xml?view=markup&rev=1.1 Index: peardoc/en/pyrus/differences/customcommands.xml +++ peardoc/en/pyrus/differences/customcommands.xml <?xml version="1.0" encoding="utf-8"?> <section xmlns="http://docbook.org/ns/docbook" version="lillet" xml:id="pyrus.differences.customcommands"> <info><title>Pyrus Custom Commands: differences from PEAR</title></info> <section xml:id="pyrus.differences.customcommands.overview"> <info><title>Overview</title></info> <para> Custom commands have changed substantially in Pyrus. PEAR commands draw their information from Xml files located in the directory <literal>PEAR/Command</literal> and require all commands to be implemented in a single file. Pyrus is much more flexible on this account, and extends the custom XML format used to define commands. Because of this difference, it is theoretically possible to create custom commands that will work in both the PEAR Installer and in Pyrus, although the internal implementation of these commands will necessarily be quite different. </para> <para> The biggest difference between how a custom command is implemented in Pyrus has to do with the new plugin system (documented <link linkend="pyrus.plugins">here</link>). Before reading any further, it may be a good idea to familiarize yourself with the way that plugins work in Pyrus by reading the documentation on plugins, then return back to finish reading about custom commands. </para> <para> Here is PEAR's version of the xml for the <literal>install</literal> command: </para> <para> <programlisting role="xml"> <![CDATA[ <commands version="1.0"> <install> <summary>Install Package</summary> <function>doInstall</function> <shortcut>i</shortcut> <options> <force> <shortopt>f</shortopt> <doc>will overwrite newer installed packages</doc> </force> <loose> <shortopt>l</shortopt> <doc>do not check for recommended dependency version</doc> </loose> <nodeps> <shortopt>n</shortopt> <doc>ignore dependencies, install anyway</doc> </nodeps> <register-only> <shortopt>r</shortopt> <doc>do not install files, only register the package as installed</doc> </register-only> <soft> <shortopt>s</shortopt> <doc>soft install, fail silently, or upgrade if already installed</doc> </soft> <nobuild> <shortopt>B</shortopt> <doc>don't build C extensions</doc> </nobuild> <nocompress> <shortopt>Z</shortopt> <doc>request uncompressed files when downloading</doc> </nocompress> <installroot> <shortopt>R</shortopt> <doc>root directory used when installing files (ala PHP's INSTALL_ROOT), use packagingroot for RPM</doc> <arg>DIR</arg> </installroot> <packagingroot> <shortopt>P</shortopt> <doc>root directory used when packaging files, like RPM packaging</doc> <arg>DIR</arg> </packagingroot> <ignore-errors> <shortopt></shortopt> <doc>force install even if there were errors</doc> </ignore-errors> <alldeps> <shortopt>a</shortopt> <doc>install all required and optional dependencies</doc> </alldeps> <onlyreqdeps> <shortopt>o</shortopt> <doc>install all required dependencies</doc> </onlyreqdeps> <offline> <shortopt>O</shortopt> <doc>do not attempt to download any urls or contact channels</doc> </offline> <pretend> <shortopt>p</shortopt> <doc>Only list the packages that would be downloaded</doc> </pretend> </options> <doc>[channel/]<package> ... Installs one or more PEAR packages. You can specify a package to install in four ways: "Package-1.0.tgz" : installs from a local file "http://example.com/Package-1.0.tgz" : installs from anywhere on the net. "package.xml" : installs the package described in package.xml. Useful for testing, or for wrapping a PEAR package in another package manager such as RPM. "Package[-version/state][.tar]" : queries your default channel's server ({config master_server}) and downloads the newest package with the preferred quality/state ({config preferred_state}). To retrieve Package version 1.1, use "Package-1.1," to retrieve Package state beta, use "Package-beta." To retrieve an uncompressed file, append .tar (make sure there is no file by the same name first) To download a package from another channel, prefix with the channel name like "channel/Package" More than one package may be specified at once. It is ok to mix these four ways of specifying packages. </doc> </install> </commands> ]]> </programlisting> </para> <para> And the same command as implemented in Pyrus: </para> <para> <programlisting role="xml"> <![CDATA[ <?xml version="1.0" encoding="UTF-8"?> <commands version="2.0" xmlns="http://pear2.php.net/dtd/customcommand-2.0"> <command> <name>install</name> <class>PEAR2_Pyrus_ScriptFrontend_Commands</class> <function>install</function> <summary>Install a package. Use install --plugin to install plugins</summary> <shortcut>i</shortcut> <options> <option> <name>plugin</name> <shortopt>p</shortopt> <type><bool/></type> <doc>Manage plugin installation only</doc> </option> <option> <name>packagingroot</name> <shortopt>r</shortopt> <type><string/></type> <doc>Install the package in a directory in preparation for packaging with tools like RPM</doc> </option> <option> <name>optionaldeps</name> <shortopt>o</shortopt> <type><bool/></type> <doc>Automatically download and install all optional dependencies</doc> </option> <option> <name>force</name> <shortopt>f</shortopt> <type><bool/></type> <doc>Force the installation to proceed independent of errors. USE SPARINGLY.</doc> </option> </options> <arguments> <argument> <name>package</name> <multiple>1</multiple> <optional>0</optional> <doc>package.xml, local package archive, remove package archive, or abstract package.</doc> </argument> </arguments> <doc>Installs listed packages. local package.xml example: php pyrus.phar install package.xml local package archive example: php pyrus.phar install PackageName-1.2.0.tar remote package archive example: php pyrus.phar install http://www.example.com/PackageName-1.2.0.tgz Examples of an abstract package: php pyrus.phar install PackageName installs PackageName from the default channel with stability preferred_state php pyrus.phar pear/PackageName installs PackageName from the pear.php.net channel with stability preferred_state php pyrus.phar install channel://doc.php.net/PackageName installs PackageName from the doc.php.net channel with stability preferred_state php pyrus.phar install PackageName-beta installs PackageName from the default channel, beta or stable stability php pyrus.phar install PackageName-1.2.0 installs PackageName from the default channel, version 1.2.0</doc> </command> </commands> ]]> </programlisting> </para> <para> The format for commands in Pyrus is much more fine-grained, and provides both better validation and better presentation of options and arguments as passed in from the user. In addition, Pyrus allows fine-grained specification of where a command is located, and automatically registers an autoloader to load the class implementing the command, and any dependent classes in the same location. </para> <para> The details of new tags like <classprefix> and <autoloadpath> are documented in the full documentation of custom roles <link linkend="pyrus.plugins.command">here</link>. </para> <para> This XML metadata file is identified by Pyrus through the use of the file role <literal>customcommand</literal>, which is used in the custom command's package.xml. Here is an example from the <contents> of a package.xml: </para> <para> <programlisting role="xml"> <![CDATA[.... <contents> <dir name="data"> <file name="commands.xml" role="customcommand"/> <file name="someotherdata.csv" role="data"/> </dir> </contents>.... ]]> </programlisting> </para> </section> </section>