Re: cvs: php4 /pear/scripts pearwin.php
| From: | Stig S. Bakken | Date: | Wed, 13 Feb 2002 10:44:45 +0000 |
| Subject: | Re: cvs: php4 /pear/scripts pearwin.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-2419@lists.php.net to get a copy of this message | ||
On Wed, 2002-02-13 at 09:50, Vincent Blavet wrote:
> vblavet Wed Feb 13 03:50:07 2002 EDT
>
> Modified files:
> /php4/pear/scripts pearwin.php
> Log:
> - Adding support for remote-list command (with XML-RPC installed)
> - Start support of show-config (still work to do ...)
We need to come up with a way to avoid this double effort.
I suggest making a more abstract command API (replacing the
pearcmd-xxx.php stuff) with a factory on top. The command API should be
generic enough to support command-line on Unix and Windows as well as
web and Gtk installer, it has to define options that the different front
ends map to their own format (getopt flags for the command-line, forms
for web and dialogs for Gtk), and it has to provide simple
documentation.
Example:
$command = PEAR_Command::factory("package.listAll");
$command->setParams(true);
$command->setOptions(array('server' => 'no.mirrors.pear.php.net'));
$result = $command->run();
or
$command = PEAR_Command::factory("package.install");
$command->setParams("HTTP_Upload");
$result = $command->run();
The factory makes it possible to use a generic class for all "remote"
commands, and have special handler classes for commands that do a lot of
local processing (like "install"). It will also enable us to add
caching of package/release lists for offline use, and install files from
mirrors or the local filesystem.
- Stig