3 /********************************************************************************
4 * spoolgen.php : spool generation
7 * This file is part of the banana distribution
8 * Copyright: See COPYING files that comes with this distribution
9 ********************************************************************************/
11 require_once("banana/banana.inc.php");
13 $opt = getopt('u:p:h');
15 if(isset($opt['h'])) {
17 usage: spoolgen.php [ -u user ] [ -p pass ]
18 create all spools, using user user and pass pass
23 class MyBanana
extends Banana
25 public function __construct()
28 Banana
::$host = "news://{$opt['u']}:{$opt['p']}@localhost:119/\n";
30 parent
::__construct();
33 private function checkErrors()
35 if (Banana
::$protocole->lastErrno()) {
36 echo "\nL'erreur suivante s'est produite : "
37 . Banana
::$protocole->lastErrno() . " "
38 . Banana
::$protocole->lastError() . "\n";
43 public function createAllSpool()
46 $groups = Banana
::$protocole->getBoxList();
49 foreach (array_keys($groups) as $g) {
50 print "Generating spool for $g : ";
52 $spool = $this->loadSpool($g);
61 $banana = new MyBanana();
62 $banana->createAllSpool();
64 // vim:set et sw=4 sts=4 ts=4