RE: [PEAR] download all packages
| From: | ThE PhP_KiD | Date: | Mon, 24 Mar 2003 14:38:54 +0000 |
| Subject: | RE: [PEAR] download all packages | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-4398@lists.php.net to get a copy of this message | ||
nice!
Thank you
Mac
-> -----Mensaje original-----
-> De: alexander.merz@web.de [mailto:alexander.merz@web.de]
-> Enviado el: Domingo, 23 de Marzo de 2003 19:39
-> Para: ThE PhP_KiD
-> CC: pear-general@lists.php.net
-> Asunto: Re: [PEAR] download all packages
->
->
-> ThE PhP_KiD wrote:
-> > there is a way to download all lastest stables
-> > packages from PEAR ?
->
-> <?php
-> require_once 'PEAR.php';
-> require_once 'PEAR/Config.php';
-> require_once 'PEAR/Command.php';
-> require_once 'PEAR/Registry.php';
-> require_once 'PEAR/Remote.php';
->
-> PEAR_Command::setFrontendType("CLI");
-> $ui = &PEAR_Command::getFrontendObject();
-> $config = &PEAR_Config::singleton();
-> $config->set("master_server", "pear.php.net");
-> $config->set("preferred_state", "stable");
-> $config->set("php_dir", ".");
-> $config->set("verbose", 0);
->
-> $remote = &new PEAR_Remote($config);
-> $remoteInfo = $remote->call("package.listAll");
-> $cmd = &PEAR_Command::factory("download", $config);
-> foreach($remoteInfo as $pkgn=>$pkg) {
-> $cmd->run("download", array(), array($pkgn));
-> }
-> ?>