X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=examples%2Fspoolgen.php;h=2c017eb1076e66318a00f0224057bce192239a36;hb=2b974d09ad89f90c04fe281ef653a34bf6d2c47f;hp=fad7ef5041dfc9ec15afef22ac94a489ddb13ba9;hpb=f8af7e38cd0054a340dbbf64581c177b04757d82;p=banana.git diff --git a/examples/spoolgen.php b/examples/spoolgen.php index fad7ef5..2c017eb 100644 --- a/examples/spoolgen.php +++ b/examples/spoolgen.php @@ -1,4 +1,4 @@ -#! /usr/bin/php4 +#!/usr/bin/php5 host = "http://{$opt['u']}:{$opt['p']}@localhost:119/"; - echo $this->host; - parent::Banana(); - } - - function createAllSpool() - { - $this->_require('groups'); - $this->_require('spool'); - $this->_require('misc'); - - $groups = new BananaGroups(BANANA_GROUP_ALL); - - foreach (array_keys($groups->overview) as $g) { - print "Generating spool for $g : "; - $spool = new BananaSpool($g); - print "done.\n"; - unset($spool); - } - $this->nntp->quit(); - } +if (!isset($opt['P'])) { + $opt['P'] = '119'; } - -$banana = new MyBanana(); -$banana->createAllSpool(); +Banana::$nntp_host = "news://{$opt['u']}:{$opt['p']}@localhost:{$opt['P']}/\n"; +if (isset($opt['r'])) { + Banana::$spool_root = $opt['r']; +} +if (isset($opt['f'])) { + Banana::createAllSpool(array('NNTP')); +} else { + Banana::refreshAllFeeds(array('NNTP')); +} +// vim:set et sw=4 sts=4 ts=4 ?>