コード例 #1
0
ファイル: TmuxOutput.php プロジェクト: RickDB/newznab-tmux
 protected function _getHeader()
 {
     $buffer = '';
     $state = $this->runVar['settings']['is_running'] == 1 ? 'Running' : 'Disabled';
     $version = $this->_vers->versions->git->tag . 'r' . $this->_git->commits();
     $buffer .= sprintf($this->tmpMasks[2], "Monitor {$state} v{$version} [" . $this->runVar['constants']['sqlpatch'] . "]: ", $this->relativeTime($this->runVar['timers']['timer1']));
     $buffer .= sprintf($this->tmpMasks[1], "USP Connections:", sprintf("%d active (%d total) - %s:%d", $this->runVar['conncounts']['primary']['active'], $this->runVar['conncounts']['primary']['total'], $this->runVar['connections']['host'], $this->runVar['connections']['port']));
     if ($this->runVar['constants']['alternate_nntp']) {
         $buffer .= sprintf($this->tmpMasks[1], "USP Alternate:", sprintf("%d active (%d total) - %s:%d)", $this->runVar['conncounts']['alternate']['active'], $this->runVar['conncounts']['alternate']['total'], $this->runVar['connections']['host_a'], $this->runVar['connections']['port_a']));
     }
     $buffer .= sprintf($this->tmpMasks[1], "Newest Release:", $this->runVar['timers']['newOld']['newestrelname']);
     $buffer .= sprintf($this->tmpMasks[1], "Release Added:", sprintf("%s ago", isset($this->runVar['timers']['newOld']['newestrelease']) ? $this->relativeTime($this->runVar['timers']['newOld']['newestrelease']) : 0));
     $buffer .= sprintf($this->tmpMasks[1], "Prehash Updated:", sprintf("%s ago", isset($this->runVar['timers']['newOld']['newestprehash']) ? $this->relativeTime($this->runVar['timers']['newOld']['newestprehash']) : 0));
     if (($this->runVar['settings']['post'] == "1" || $this->runVar['settings']['post'] == "3") && $this->runVar['constants']['sequential'] != 2) {
         $buffer .= sprintf($this->tmpMasks[1], "Postprocess:", "stale for " . $this->relativeTime($this->runVar['timers']['timer3']));
     }
     return $buffer . PHP_EOL;
 }