egroupware_official/phpgwapi/inc/class.egw_tail.inc.php

35 lines
1.0 KiB
PHP
Raw Normal View History

2012-02-15 22:32:45 +01:00
<?php
/**
* EGroupware - Ajax log file viewer (tail -f)
*
* @link http://www.egroupware.org
* @author Ralf Becker <RalfBecker@outdoor-training.de>
2016-04-02 12:44:17 +02:00
* @copyright 2012-16 by RalfBecker@outdoor-training.de
2012-02-15 22:32:45 +01:00
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
2016-04-02 12:44:17 +02:00
* @package api
* @subpackage json
2012-02-15 22:32:45 +01:00
* @version $Id$
*/
2016-04-02 12:44:17 +02:00
use EGroupware\Api\Json\Tail;
2012-02-15 22:32:45 +01:00
/**
* Ajax log file viewer (tail -f)
*
* To not allow to view arbitrary files, allowed filenames are stored in the session.
* Class fetches log-file periodically in chunks for 8k.
* If fetch returns no new content next request will be in 2s, otherwise in 200ms.
* As logfiles can be quiet huge, we display at max the last 32k of it!
*
* Example usage:
*
* $error_log = new egw_tail('/var/log/apache2/error_log');
* echo $error_log->show();
*
* Strongly prefered for security reasons is to use a path relative to EGroupware's files_dir,
* eg. new egw_tail('groupdav/somelog')!
2016-04-02 12:44:17 +02:00
*
* @deprecated use Api\Json\Tail
2012-02-15 22:32:45 +01:00
*/
2016-04-02 12:44:17 +02:00
class egw_tail extends Tail {}