Write more class documentation

This commit is contained in:
Alexander Klimov 2014-04-02 13:23:18 +02:00
parent 241fda1196
commit cdf1a0b683
4 changed files with 57 additions and 2 deletions

View File

@ -28,7 +28,7 @@
*/
// {{{ICINGA_LICENSE_HEADER}}}
# namespace Icinga\Application\Controllers;
// namespace Icinga\Application\Controllers;
use Icinga\Web\Controller\ActionController;
use Icinga\Application\Icinga;

View File

@ -34,16 +34,32 @@ use Icinga\Application\Config as IcingaConfig;
use Icinga\Web\Url;
use Icinga\Data\ResourceFactory;
/**
* Class ListController
*
* Application wide controller for various listing actions
*/
class ListController extends Controller
{
/**
* Add title tab
*
* @param string $action
*/
protected function addTitleTab($action)
{
$this->getTabs()->add($action, array(
'title' => ucfirst($action),
'url' => Url::fromPath('monitoring/list/' . $action)
'url' => Url::fromPath(
'list/'
. str_replace(' ', '', $action)
)
))->activate($action);
}
/**
* Display the application log
*/
public function applicationlogAction()
{
$this->addTitleTab('application log');

View File

@ -6,10 +6,27 @@ namespace Icinga\Protocol\File;
use Icinga\Data\BaseQuery;
/**
* Class Query
*
* Query for Datasource Icinga\Protocol\File\Reader
*
* @package Icinga\Protocol\File
*/
class Query extends BaseQuery
{
/**
* Sort direction
*
* @var int
*/
private $sortDir;
/**
* Filters to apply on result
*
* @var array
*/
private $filters = array();
/**

View File

@ -6,12 +6,32 @@ namespace Icinga\Protocol\File;
use Icinga\Data\DatasourceInterface;
/**
* Class Reader
*
* Read file line by line
*
* @package Icinga\Protocol\File
*/
class Reader implements DatasourceInterface
{
/**
* Name of the file to read
*
* @var string
*/
private $filename;
/**
* Configuration for this Datasource
*
* @var \Zend_Config
*/
private $config;
/**
* @param \Zend_Config $config
*/
public function __construct($config)
{
$this->config = $config;
@ -157,6 +177,7 @@ class Reader implements DatasourceInterface
/**
* Backend for $this->read
* Direction: LIFO
*/
public function readFromEnd($skip_lines, $read_lines, Query $query)
{
@ -194,6 +215,7 @@ class Reader implements DatasourceInterface
/**
* Backend for $this->read
* Direction: FIFO
*/
public function readFromStart($skip_lines, $read_lines, Query $query)
{