<?php /** * Require the library */ require 'PHPTail.php'; /** * Initilize a new instance of PHPTail * @var PHPTail */ $tail = new PHPTail("/home/ovancop/Data/htdocs/florakb/flora-kalbar.info/logs/Log-18-05-2014.txt"); /** * We're getting an AJAX call */ if (isset($_GET['ajax'])) { echo $tail->getNewLines($_GET['lastsize'], $_GET['grep'], $_GET['invert']); die; } /** * Regular GET/POST call, print out the GUI */ $tail->generateGUI();
public function ajax_wplister_tail_log() { require_once WPLISTER_PATH . '/includes/php-tail/PHPTail.php'; // Initilize a new instance of PHPTail - 3 sec reload, 512k max $tail = new PHPTail(WPLE()->logger->file, 3000, 524288); // handle ajax call if (isset($_GET['ajax'])) { echo $tail->getNewLines(@$_GET['lastsize'], $_GET['grep'], $_GET['invert']); die; } // else show gui $tail->generateGUI(); die; }