Fix conflicts from rebase, using inet_aton with pgsql, PHP strict standards violations, CS compliance

refs #4255
This commit is contained in:
Eric Lippmann 2013-09-17 11:24:05 +02:00
parent c6db0067ec
commit 24f64e6d30
12 changed files with 17 additions and 53 deletions

View File

@ -274,7 +274,10 @@ class Module
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName, $moduleLibraryDir);
if (is_dir($this->getFormDir())) {
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName. '\\Form', $this->getFormDir());
$this->app->getLoader()->registerNamespace(
'Icinga\\Module\\' . $moduleName. '\\Form',
$this->getFormDir()
);
}
}

View File

@ -66,7 +66,9 @@ class Query extends AbstractQuery
protected function createQueryObjects()
{
$this->beforeCreatingCountQuery();
$this->beforeCreatingSelectQuery();
$this->selectQuery = clone($this->baseQuery);
$this->selectQuery->columns($this->columns);
if ($this->hasOrder()) {
@ -79,7 +81,6 @@ class Query extends AbstractQuery
}
}
$this->beforeCreatingCountQuery();
if ($this->uglySlowConservativeCount) {
$query = clone($this->selectQuery);
if ($this->maxCount === null) {

View File

@ -112,8 +112,7 @@ class PivotTable
->where($ycol, $listY)
->where($xcol, $listX)
->order($ycol)
->order($xcol)
;
->order($xcol);
$pivot = array();
$emptyrow = (object) array();
foreach ($this->query->listColumns() as $col) {

View File

@ -160,4 +160,3 @@ interface QueryInterface extends Countable
*/
public function paginate($limit = null, $page = null);
}

View File

@ -163,49 +163,6 @@ class Monitoring_ListController extends ActionController
'host_address' => 'Host Address',
'host_last_check' => 'Last Host Check'
));
$this->inheritCurrentSortColumn();
}
/**
* Display hostgroup list
*
* @TODO Implement hostgroup overview (feature #4184)
*/
public function hostgroupsAction()
{
$this->view->hostgroups = $this->query('hostgroup', array(
'hostgroup_name',
'hostgroup_alias',
));
}
/**
* Display servicegroup list
*
* @TODO Implement servicegroup overview (feature #4185)
*/
public function servicegroupsAction()
{
$this->view->servicegroups = $this->backend->select()
->from('servicegroup', array(
'servicegroup_name',
'servicegroup_alias',
));
}
/**
* Display contactgroups overview
*
*
*/
public function contactgroupsAction()
{
$this->view->contactgroups = $this->query('contactgroup', array(
'contactgroup_name',
'contactgroup_alias',
>>>>>>> Slight changes in the ListController... more tbd
));
}
/**

View File

@ -199,7 +199,6 @@ class Monitoring_ShowController extends ActionController
->fetchPairs();
Benchmark::measure('Service action done');
$object = $this->view->object->prefetch();
$this->prepareGrapherHook();
}
/**
@ -300,7 +299,6 @@ class Monitoring_ShowController extends ActionController
->where('object_type', 'host')
->fetchPairs();
$this->view->object->prefetch();
$this->prepareGrapherHook();
}
/**

View File

@ -56,6 +56,7 @@ abstract class AbstractQuery extends Query
foreach ($this->columnMap as $table => & $columns) {
foreach ($columns as $key => & $value) {
$value = preg_replace('/ COLLATE .+$/', '', $value);
$value = preg_replace('/inet_aton\(([[:word:].]+)\)/i', '$1::inet - \'0.0.0.0\'', $value);
}
}
}
@ -120,7 +121,8 @@ abstract class AbstractQuery extends Query
protected function joinBaseTables()
{
$table = array_shift(array_keys($this->columnMap));
reset($this->columnMap);
$table = key($this->columnMap);
$this->baseQuery = $this->db->select()->from(
array($table => $this->prefix . $table),

View File

@ -2,6 +2,7 @@
namespace Icinga\Module\Monitoring\Backend\Ido\Query;
use \Zend_Db_Select;
use Icinga\Exception\ProgrammingError;
class EventHistoryQuery extends AbstractQuery

View File

@ -119,7 +119,7 @@ class NotificationQuery extends AbstractQuery
array(
'cmd_m' => $this->prefix . 'contactnotificationmethods'
),
'cmd_c.notification_id = cmd_m.contactnotification_id',
'cmd_c.contactnotification_id = cmd_m.contactnotification_id',
array()
);
$this->baseQuery->join(

View File

@ -241,7 +241,8 @@ class AbstractView extends AbstractQuery
if (empty($this->sortDefaults)) {
return $this->availableColumns[0];
} else {
return array_shift(array_keys($this->sortDefaults));
reset($this->sortDefaults);
return key($this->sortDefaults);
}
}

View File

@ -2,6 +2,8 @@
namespace Icinga\Monitoring\View;
use Icinga\Module\Monitoring\View\AbstractView;
class StatehistoryView extends AbstractView
{
protected $availableColumns = array(

View File

@ -1,6 +1,7 @@
<?php
namespace Tests\Icinga\Protocol\Statusdat;
require_once("../../library/Icinga/Data/QueryInterface.php");
require_once("../../library/Icinga/Data/AbstractQuery.php");
require_once("../../library/Icinga/Protocol/Statusdat/Query.php");
require_once(dirname(__FILE__)."/ReaderMock.php");