mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
31 lines
991 B
PHP
31 lines
991 B
PHP
<?php
|
|
|
|
require_once(dirname(__FILE__).'/config.php');
|
|
require_once(WWW_DIR.'/lib/nntp.php');
|
|
require_once(WWW_DIR.'/lib/Tmux.php');
|
|
require_once(dirname(__FILE__).'/../lib/ColorCLI.php');
|
|
require_once(dirname(__FILE__).'/../lib/functions.php');
|
|
|
|
$c = new ColorCLI();
|
|
if (!isset($argv[1])) {
|
|
exit($c->error("This script is not intended to be run manually, it is called from backfill_threaded.py."));
|
|
} else if (isset($argv[1])) {
|
|
// Create the connection here and pass
|
|
$nntp = new NNTP();
|
|
if ($nntp->doConnect() !== true) {
|
|
exit($c->error("Unable to connect to usenet."));
|
|
}
|
|
|
|
$pieces = explode(' ', $argv[1]);
|
|
if (isset($pieces[1]) && $pieces[1] == 1) {
|
|
$functions = new Functions();
|
|
$functions->backfillAllGroups($nntp, $pieces[0]);
|
|
} else if (isset($pieces[1]) && $pieces[1] == 2) {
|
|
$tmux = new Tmux();
|
|
$count = $tmux->get()->backfill_qty;
|
|
$functions = new Functions();
|
|
$functions->backfillPostAllGroups($nntp, $pieces[0], $count, $type = '');
|
|
}
|
|
$nntp->doQuit();
|
|
}
|