X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=examples%2Fspoolgen.php;h=16663ee904abd20581d36a0e8c4d350afcd5d7a2;hb=b052aab700be8ff1e786df137be250bc4f51b4c5;hp=6c2c7dabc49e02d0ffdfaa4950175b3f2d11d3e0;hpb=703b83c31a629203814ea1498e276b4e2133e7f1;p=banana.git diff --git a/examples/spoolgen.php b/examples/spoolgen.php index 6c2c7da..16663ee 100644 --- a/examples/spoolgen.php +++ b/examples/spoolgen.php @@ -20,46 +20,8 @@ EOF; exit; } -class MyBanana extends Banana -{ - public function __construct() - { - global $opt; - Banana::$host = "news://{$opt['u']}:{$opt['p']}@localhost:119/\n"; - echo Banana::$host; - parent::__construct(); - } - - private function checkErrors() - { - if (Banana::$protocole->lastErrno()) { - echo "\nL'erreur suivante s'est produite : " - . Banana::$protocole->lastErrno() . " " - . Banana::$protocole->lastError() . "\n"; - exit; - } - } - - public function createAllSpool() - { - $this->checkErrors(); - $groups = Banana::$protocole->getBoxList(); - $this->checkErrors(); - - foreach (array_keys($groups) as $g) { - print "Generating spool for $g : "; - Banana::$group = $g; - $spool = $this->loadSpool($g); - $this->checkErrors(); - print "done.\n"; - unset($spool); - } - } -} - - -$banana = new MyBanana(); -$banana->createAllSpool(); +Banana::$nntp_host = "news://{$opt['u']}:{$opt['p']}@localhost:119/\n"; +Banana::createAllSpool(array('NNTP')); // vim:set et sw=4 sts=4 ts=4 ?>