function showUploadProcess() { global $CONFIG; $dataArr['file'] = "PHPTail"; $dataArr['path'] = LIBS . 'phptail/'; require './' . LIBS . 'phptail/PHPTail.php'; // $phpTail = $this->load($dataArr); $fileName = $CONFIG['default']['root_path'] . "/logs/" . $this->user['login']['username']; $phpTail = new PHPTail($fileName); // pr($phpTail); if (isset($_GET['ajax'])) { echo $phpTail->getNewLines($_GET['lastsize']); die; } else { echo json_encode(array('size' => filesize($fileName))); } // echo $phpTail->getNewLines(); // $phpTail->ada(); // $phpTail->generateTemplate(); exit; }
<?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();
<?php /** * Require the library */ require 'PHPTail.php'; if (!isset($_REQUEST['file'])) { die; } /** * Initilize a new instance of PHPTail * @var PHPTail */ $tail = new PHPTail($_REQUEST['file']); /** * We're getting an AJAX call */ if (isset($_GET['ajax'])) { echo $tail->getNewLines($_GET['lastsize'], $_GET['grep'], $_GET['invert']); die; } /** * We're getting an AJAX call */ if (isset($_REQUEST['fileSize'])) { echo $tail->getFileSize(); die; }
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; }