예제 #1
0
<?php

require_once dirname(__FILE__) . '/../../../../www/config.php';
use newznab\db\Settings;
use newznab\utility\Utility;
$pdo = new Settings();
$tRun = new \TmuxRun($pdo);
$tOut = new \TmuxOutput($pdo);
$runVar['paths']['misc'] = NN_MISC;
$runVar['paths']['lib'] = NN_LIB;
$db_name = DB_NAME;
$dbtype = DB_TYPE;
$tmux = $tRun->get('niceness');
$tmux_niceness = isset($tmux->niceness) ? $tmux->niceness : 2;
$runVar['constants'] = $pdo->queryOneRow($tRun->getConstantSettings());
$PHP = $tRun->command_exist("php5") ? 'php5' : 'php';
$PYTHON = $tRun->command_exist("python3") ? 'python3 -OOu' : 'python -OOu';
//assign shell commands
$show_time = NN_DEBUG ? "/usr/bin/time" : "";
$runVar['commands']['_php'] = $show_time . " nice -n{$tmux_niceness} {$PHP}";
$runVar['commands']['_phpn'] = "nice -n{$tmux_niceness} {$PHP}";
$runVar['commands']['_python'] = $show_time . " nice -n{$tmux_niceness} {$PYTHON}";
$runVar['commands']['_sleep'] = "{$runVar['commands']['_phpn']} {$runVar['paths']['misc']}update_scripts/nix_scripts/tmux/bin/showsleep.php";
//spawn IRCScraper as soon as possible
$tRun->runPane('scraper', $runVar);
//get list of panes by name
$runVar['panes'] = $tRun->getListOfPanes($runVar['constants']);
//totals per category in db, results by parentid
$catcntqry = "SELECT c.parentid AS parentid, COUNT(r.id) AS count FROM category c, releases r WHERE r.categoryid = c.id GROUP BY c.parentid";
//create timers and set to now
$runVar['timers']['timer1'] = $runVar['timers']['timer2'] = $runVar['timers']['timer3'] = $runVar['timers']['timer4'] = $runVar['timers']['timer5'] = time();