Commit Graph

355 Commits

Author SHA1 Message Date
Johannes Meyer 524c449649 Merge branch 'master' into feature/user-and-group-management-8826 2015-05-18 11:28:07 +02:00
Johannes Meyer 130fea3146 Revert "Merge Queryable into QueryInterface"
This reverts commit ca5ef2da2b.
A perfect example of a change as a result of being mentally deranged.
2015-05-18 11:25:02 +02:00
Johannes Meyer fbf0ad4339 Drop interface Browsable
We're not required to handle objects of Zend_Paginator in any way, so
creating such as part of a query is not necessary since QueryAdapter
accepts any instance of QueryInterface. (gets enforced in the near future)

refs #8339
2015-05-15 14:37:41 +02:00
Johannes Meyer ed5f646b6f SimpleQuery: Implement interface IteratorAggregate
I'd like to foreach such.
2015-05-15 14:37:41 +02:00
Johannes Meyer 7d08dd2765 DbConnection: Adjust insert and update to support custom type definitions
This strips the custom insert and update implementataions in
DbUserBackend down so that it does not need to do such low level stuff...

refs #8826
2015-05-13 09:15:18 +02:00
Johannes Meyer 3aaa6d39a1 DbConnection: Make it possible to insert, update and delete table rows
refs #8826
2015-05-11 13:25:50 +02:00
Johannes Meyer 8690056e1c Introduce interface Updatable
refs #8826
2015-05-08 15:18:56 +02:00
Johannes Meyer 2c1fac9da8 Introduce interface Reducible
refs #8826
2015-05-08 15:18:42 +02:00
Johannes Meyer 84f20ecb5f Introduce interface Extensible
refs #8826
2015-05-08 15:18:28 +02:00
Johannes Meyer 16a7b010bc SimpleQuery: Ignore limit and offset when counting 2015-05-06 10:41:39 +02:00
Johannes Meyer cfa9176192 ArrayDatasource: use array_shift in fetchRow() instead of index access
Since associative arrays are supported, the numeric index 0 might not be
the first entry in the result.
2015-05-06 10:10:29 +02:00
Johannes Meyer 7b2ed3bef7 ArrayDatasource: Create a new result when counting
There is usually no limit and offset when a query is going to be counted
so the cached result must not be used.
2015-05-06 10:08:07 +02:00
Johannes Meyer f2ad2838f4 ArrayDatasource: Apply a query's limit and offset when creating the result 2015-05-06 09:39:43 +02:00
Johannes Meyer d63381c002 ArrayDatasource: Add missing and fix existing documentation 2015-05-06 09:12:48 +02:00
Johannes Meyer b1cbc1422b ArrayDatasource: Add support for associative arrays
Keys are now preserved in case a non-numeric one is found. By using
setKeyColumn() it is now also possible to map such a key to a specific
column of a row generated by createResult().
2015-05-06 08:40:02 +02:00
Johannes Meyer 5cc7f26728 ConfigObject: Extend ArrayDatasource
This makes it possible to use a ini file as repository!!!1
One thing is missing: Section names are currently ignored and should be
mapped to a virtual column.

refs #8826
2015-05-05 15:21:34 +02:00
Johannes Meyer bd136d39f4 SimpleQuery: Make compare() alias aware
refs #8826
refs #7693
2015-05-05 07:31:50 +02:00
Johannes Meyer d71df6a9b8 Revert "SimpleQuery: Make compare() alias aware"
This reverts commit 6612e4c1ae.
2015-05-05 07:30:42 +02:00
Johannes Meyer 6612e4c1ae SimpleQuery: Make compare() alias aware
refs #8826
refs #7693
2015-05-04 11:34:39 +02:00
Johannes Meyer ecd059dec5 DbConnection: select() returns a DbQuery, not a Query 2015-05-04 11:13:38 +02:00
Johannes Meyer e7789ed640 SimpleQuery: Rename unused property `table' to `target'
`target' is already in use, but was not declared. `table' was declared but not
used anywhere. So `table' is now `target'.
2015-05-04 11:12:43 +02:00
Johannes Meyer ca5ef2da2b Merge Queryable into QueryInterface
A *Query*Interface describes an object as being queryable, now.

refs #8826
2015-05-04 11:07:50 +02:00
Johannes Meyer 97caeb27f7 UserBackend: Add missing and fix existing method documentation
refs #8826
2015-04-21 13:59:35 +02:00
Eric Lippmann 45d1230b28 Merge branch 'master' into bugfix/significant-whitespaces-8777 2015-04-08 10:19:53 +02:00
Eric Lippmann 6e6aabedf2 Don't trim filter expressions
Leading and trailing whitespaces may be significant for comparison.

refs #8777
2015-04-08 09:31:11 +02:00
Alexander Klimov 967a2e82dc Use (only) "@return $this" in fluent interfaces' documentation 2015-04-07 14:24:11 +02:00
Eric Lippmann 949438d753 lib: Add SimpleQuery::splitOrder() ...
... for supporting specifying the sort direction next to the column, e.g.
'service_display_name ASC'

refs #8716
2015-03-13 17:09:32 +01:00
Eric Lippmann 8563d5ed3f PHPDoc: Use @var instead of @type
Becasue of too many kittens PSR-5 backed off of deprecating @var.
So that's the way we go too.
2015-03-12 16:08:47 +01:00
Eric Lippmann 760819f239 lib: Remove TreeNode::getIterator()
Its the tree who has the iterator.

refs #6630
2015-02-10 17:01:32 +01:00
Eric Lippmann b18405e99f lib: Add SimpleTree
Simple tree implementation for TreeNodes.

refs #6630
2015-02-10 17:00:47 +01:00
Eric Lippmann fd38e5b2e1 lib: Use @inheritdoc in the TreeNodeIterator
refs #6630
2015-02-10 16:59:43 +01:00
Eric Lippmann 3a4c6e45b8 Fix Fatal error: Interface 'Identifiable' not found
refs #6630
2015-02-06 17:32:51 +01:00
Eric Lippmann 0d63e14baf lib: Rename Node to TreeNode
refs #6630
2015-02-06 17:27:14 +01:00
Eric Lippmann 828cb8d23a lib: Add iterator over a tree node's children
refs #6630
2015-02-06 17:23:07 +01:00
Eric Lippmann f331c03f63 lib/tree: Save child nodes into an array instead of using SplDoublyLinkedList
refs #6630
2015-02-06 17:20:23 +01:00
Eric Lippmann c8da05d0a7 lib: Remove NodeInterface
I'll create an iterator for nodes and drop that every node is a SplDoublyLinkedList.

refs #6630
2015-02-06 17:17:41 +01:00
Eric Lippmann 6bae2e0a53 Note that our license is GPL v2 or any later version in our license header instead of pointing to the license's URL 2015-02-04 10:52:27 +01:00
Eric Lippmann 5b4fab0750 Add license header
This time without syntax errors hopefully :)
2015-02-03 16:27:59 +01:00
Eric Lippmann 5fa2e3cfdc Revert "Add license header"
This reverts commit 338d067aba.
2015-02-03 16:16:26 +01:00
Eric Lippmann 338d067aba Add license header
fixes #7788
2015-02-03 15:51:04 +01:00
Eric Lippmann 52c40bdc5b lib/SimpleQuery: Increase default limit to 25
Please follow the referenced issues.

fixes #8337
refs #8339
2015-02-02 14:16:27 +01:00
Eric Lippmann c53b1d27e9 lib: Deprecate Data\Filterable because of ...
addFilter and applyFilter do the same in all usages.
addFilter could be replaced w/ getFilter()->add().
We must no require classes implementing this interface to implement redundant methods over and over again.
The interface must be moved to the namespace Icinga\Data\Filter.
It lacks documentation.
2015-01-27 14:33:46 +01:00
Johannes Meyer 38957e340b Fix that DbQuery::renderFilter produces invalid filters
fixes #7749
2014-11-20 11:58:22 +01:00
Johannes Meyer 7621f6642d Adjust usages of Icinga\Application\Config
refs #7147
2014-11-18 13:11:52 +01:00
Johannes Meyer 0c84bf614d Split config functionality into two classes
There is now Icinga\Application\Config as our ini configuration handler and
Icinga\Data\ConfigObject as our general configuration container.

refs #7147
2014-11-18 13:02:56 +01:00
Thomas Gelf 40c4562fe4 Data\SimpleQuery: don't fail on missing columns...
...for now
2014-11-16 18:24:16 +01:00
Thomas Gelf b2a55f0998 Db\DbQuery: do not expose applyFilterSql 2014-11-16 17:09:51 +01:00
Thomas Gelf 5ea2f33efb Db\DbQuery: add NOT LIKE support 2014-11-16 17:08:50 +01:00
Thomas Gelf 90f1ab06b4 Db\DbQuery: add "deep" clone support
Still far from being complete, Zend_Db_Select makes life really hard for
us. More to come...
2014-11-16 17:06:26 +01:00
Thomas Gelf e89d4642e3 Merge remote-tracking branch 'origin/master' into feature/livestatus-playground-4787 2014-11-16 10:12:34 +01:00
Thomas Gelf 9e0e3f12e3 FilterChain: addFilter should return itself 2014-11-16 02:49:33 +01:00
Thomas Gelf 44c96f0410 FilterOr: override operator change for NOT
Replacing an OR filter with a NOT operator should return a NOT OR
when the OR contains more than one entry
2014-11-15 22:37:12 +01:00
Thomas Gelf 1f74c462d4 FilterChain: add and use count() function 2014-11-15 22:34:18 +01:00
Thomas Gelf 925348d171 Data\Filter: add or/andFilter implementations
Those shortcuts make it easy to correctly add or/and conditions
regardless of the original filter type
2014-11-14 23:06:20 +01:00
Thomas Gelf 6aefc4b491 Data\Filter: fix $self VS $this 2014-11-14 22:53:46 +01:00
Thomas Gelf 178ddaade7 Data\Filter: add missing abstract function type 2014-11-14 22:44:04 +01:00
Thomas Gelf 53bca911fb Data\Filter: enforce isEmpty() implementation 2014-11-14 22:43:30 +01:00
Thomas Gelf ce7aea5df7 Data\Filter: add isChain() and isExpression()
This makes node type distiction easier
2014-11-14 22:41:30 +01:00
Eric Lippmann 94f8597271 Add existing GROUPBYs to count queries 2014-11-13 16:42:11 +01:00
Eric Lippmann 0e34001568 Use automatically a subquery when counting with groups 2014-11-13 16:42:11 +01:00
Johannes Meyer 77f5bc3932 Use GROUPBY instead of DISTINCT and subqueries when counting 2014-11-13 16:42:11 +01:00
Thomas Gelf f0ca81d7af Data\Filter: SORT_NATURAL only for PHP >= 5.4 2014-11-12 11:47:42 +01:00
Thomas Gelf 0d4d4930a9 Db\DbConnection: benchmark single row fetches 2014-11-11 21:07:02 +01:00
Thomas Gelf 6d705721e3 Filters: try to give meaningful results for...
...missing columns

refs #4787
2014-11-11 19:26:37 +01:00
Thomas Gelf 8987b69d55 Filter: allow to list all filtered columns
This is important for backends that need to know which additional columns
to fetch.

refs #4787
2014-11-11 19:09:59 +01:00
Johannes Meyer 7b99b74ae1 Prefer Icinga\Application\Config instead of Zend_Config
refs #7147
2014-11-07 13:53:03 +01:00
Eric Lippmann 2b67683e00 DbConnection::__construct(): Set prefix if configured 2014-10-20 13:43:03 +02:00
Eric Lippmann 79ade944de Resources: Support type 'ini' yet only in the resources.ini
Configuring the resource type 'ini' via the web interface is not yet possible.
2014-10-20 13:40:35 +02:00
Alexander Fuhr 4c23d98575 Merge branch 'master' into bugfix/monitoring-list-dup-entries-7057 2014-10-08 12:45:14 +02:00
Alexander Fuhr afc97b1cac Fix the duplicate entries in monitoring list shows
refs #7057
refs #7344
fixes #7057
2014-10-08 12:30:08 +02:00
Eric Lippmann 1b23fd7fbe monitoring: Don't support status.dat as backend
Icinga Web 2 will not support status.dat for now and maybe forever.
2014-10-07 13:22:07 +02:00
Eric Lippmann 865ef76cb8 filter: Fix whitespace sanitizing 2014-10-06 13:19:25 +02:00
Alexander Fuhr 97d2a920db Implement GROUP BY clause functionality 2014-10-06 11:34:04 +02:00
Eric Lippmann 64d41ac5a3 filter: Make `DbQuery::applyFilterSql()' public
I want to use that function in a module :)
2014-10-01 12:51:28 +02:00
Eric Lippmann ebde422824 filter: Fix whitepsace sanitation when expression is an array 2014-10-01 04:00:43 +02:00
Eric Lippmann 46078f50db filter: Fix that leading and trailing whitespaces for columns and expressions let filters fail
Before, filtering for "host = localhost" issued "got invalid column host".
2014-10-01 03:13:27 +02:00
Eric Lippmann 90dbcdbbfb The stupid `DbQuery::isTimestamp()' hack must return false
This a fix for modules using our query / filter combination since `return $this;' renders all columns as timestamps.
2014-09-19 14:29:29 +02:00
Alexander Klimov 36a3c36c1b Rename Icinga\Protocol\File\Reader to ...\File\FileReader 2014-09-04 16:37:24 +02:00
Thomas Gelf 3d352ba446 Filter: add FilterNotEqual and FilterMatch
fixes #6557
2014-09-02 19:51:56 +02:00
Marius Hein 30f391035c Postgres/DbQuery: Add orderfields to select
refs #6896
2014-09-01 10:00:04 +02:00
Marius Hein 9d0037a53a ResourceFactory: Add function create(<name>)
The ConfigAwareFactory is an interface forcing "backend-type" classes to call
ResourceFactory::createResource() passing a config they got in the constructor.

That's kind of overdesigned, if the ResourceFactory wants to be something like
a service locator it's responsabilities should include object instantiation.

refs #5514
2014-08-28 12:14:54 +02:00
Marius Hein 9b83074cc9 Class doc for ResourceFactory
refs #5514
2014-08-28 12:14:54 +02:00
Marius Hein 22e17e9901 ResourceFactory: Move available function to platform
refs #5514
2014-08-28 12:14:54 +02:00
Alexander Klimov e6612fefe7 FilterParseException: extend IcingaException
refs #6931
2014-08-27 16:26:43 +02:00
Alexander Klimov afd0c20c42 FilterException: extend IcingaException
refs #6931
2014-08-27 16:23:44 +02:00
Alexander Klimov 45638b218c Throw IcingaException rather than Exception
fixes #7014
2014-08-27 16:03:15 +02:00
Alexander Klimov febb2d1ae2 ProgrammingError: extend IcingaException
refs #6931
2014-08-26 11:15:19 +02:00
Alexander Klimov 9c5878cbbe ConfigurationError: extend IcingaException
refs #6931
2014-08-22 11:46:11 +02:00
Eric Lippmann edc89d6ad6 lib: Remove `NodeRenderer'
`NodeRenderer' is superseded by `TocRenderer'.
2014-07-28 19:12:35 +02:00
Eric Lippmann e26d360561 lib/Node: Remove method `findNodeBy()'
The new `DocTree' class provides `getNode()'.
2014-07-28 19:07:13 +02:00
Eric Lippmann bbcdcb4609 lib: Add `Identifiable' interface for objects that are identifiable by an ID of any type 2014-07-28 19:05:37 +02:00
Eric Lippmann e005333806 Merge branch 'master' into feature/display-documentation-4820 2014-07-22 12:25:58 +02:00
Thomas Gelf 2a204897b4 DbQuery: improve method description
Not English mine this was, copy paste did I ;)
2014-07-18 16:48:52 +02:00
Thomas Gelf 209894d857 DbQuery: add dummy isTimestamp function
Not the best solution, but helps for now.

fixes #6675
2014-07-18 16:35:29 +02:00
Johannes Meyer 3105c2059e Remove license headers from all files
refs #6309
2014-07-15 13:43:52 +02:00
Eric Lippmann db5c6631d9 Merge branch 'master' into feature/display-documentation-4820
Conflicts:
	modules/doc/library/Doc/Controller.php
2014-07-01 12:42:55 +02:00
Thomas Gelf 7ebdb2d378 FilterQueryString: add hidden debug feature
Might help to track down potential problems in the future, should
not be enabled by default
2014-06-25 10:47:03 +02:00
Thomas Gelf 9359f527db FilterQueryString: fix issues with not
NOT is a "chain" with just one subfilter and therefore behaves a little
bit different. Should work fine now.

fixes #6554
2014-06-25 10:39:48 +02:00
Thomas Gelf b3cdeee35d monitoring/timeline: should benefit from new filter
Different changes have been applied:

* Allow integer unix timestamps as parameters for timestamp columns
* Remove alias-rewriting from Url class
* Remove all traces of raw_timestamp
* Use new filters
2014-06-21 03:09:40 +02:00
Thomas Gelf 78193137f0 config/modules: show metadata, improve usability
Well... I didn't want to commit this before creating single-button
forms for enabling/disabling modules. However part of this accidentally
made it through, so let's finish it.

Still some work to do, but it already looks far better like this.

refs #4095
2014-06-21 02:27:27 +02:00
Thomas Gelf a904ff51aa monitoring/eventhistory: improve query performance
This takes care of timestamp columns, modifies queries in a way not
depending on db functions, filters are passed through to subqueries
for better performance.
2014-06-20 19:14:34 +02:00
Thomas Gelf ecbdb07bea FilterQueryString: fix handling encoded <> signs
Those signs are URL-encoded and therefore not "seen" before decoding
the "key" part when the sit in front of the = sign. Same goes for
standalone ones. Fixed.
2014-06-20 13:06:07 +02:00
Thomas Gelf f2605b89ff FilterQueryString: fix parsing expression lists
The parser sometimes failed when reaching a=b&b=(c|d|e) - fixed.
2014-06-20 13:04:53 +02:00
Thomas Gelf 1ea15e1f66 FilterQueryString: fix sub-expression parsing
In a string like !(b=c)&a=d the parser used to fail once it reached
the &, fixed now.
2014-06-20 13:02:02 +02:00
Thomas Gelf a3a2e97f18 FilterQueryString: just cleaning up a little bit 2014-06-20 13:01:10 +02:00
Thomas Gelf 644dd5e33e Widget\FilterEditor: improve the filter editor
This adds quite a bunch of changes. Part of the filter-modifying
complexity has been moved to the filter, the editor widget itself
now makes use of new filter capabilities such as changing operator
or expression type.
2014-06-20 12:03:22 +02:00
Thomas Gelf 1bfc4058f2 Data\Filter: automagically handle hierarchy
This adds a few more functions assisting filters in replacing
themselves or subnodes. Introducing Filter::chain().
2014-06-20 12:00:29 +02:00
Thomas Gelf 18e49f6b9a Data\Filter: add setters for all properties
To keep our filter editor simple we want our filters to handle also
operations replacing themselves.
2014-06-20 11:57:31 +02:00
Thomas Gelf 97f88bf636 Data\Filter: clean up a few things
* throw useful exceptions
* our "id" should always be treated as a string
2014-06-20 11:55:27 +02:00
Thomas Gelf 7cd696b31b Data/queries: adjust to fit new filters
Slight changes to get our queries working with new filter implementation.
2014-06-17 12:34:02 +00:00
Thomas Gelf d1b2d47fed Data\Filter: rework fitting new URLs
A bunch of things happened here. We distinct FilterChains (or, and,
not) from FilterExpressions (less, greater, equal...). We make use of
our new URL-Parser. We can directly address anonymous filter components
for editing filters. Too much things to explain them in detail, a filter
documentation will follow.
2014-06-17 12:28:28 +00:00
Thomas Gelf 7b77083c89 Data\Db\DbConnection: relax timeout, persistance
Raised connection timeout, helps when talking to DB servers behind
weak links. Please note that I'm not sure whether this really is a
better default.

While it doesn't matter with local sockets, connection overhead will
have an impact with remote database servers. We have to reconnect with
every single request. Persistent connections seem to be no longer as
errorprone as they used to be, but I'd still refuse to switch them on
by default.

What we need is a config setting for connection persistancy and wizards
strongly suggesting to use this when working with remote db servers.
2014-06-17 09:53:59 +00:00
Thomas Gelf e056310378 Data\Db\DbConnection: one more legacy class name
Fixed, Query is now DbQuery
2014-06-17 09:52:32 +00:00
Thomas Gelf 9e1e502fc8 Data\Db\DbConnection: implement fromResourceName
This allows to instantiate DB connections with less code in our
controllers.
2014-06-17 09:51:37 +00:00
Eric Lippmann 7f6010e1f8 lib/tree: Add PHPDoc to Node's methods 2014-06-13 17:22:43 +02:00
Eric Lippmann 6c8d35c667 lib: Add a not yet customizable node renderer 2014-06-06 13:58:40 +02:00
Eric Lippmann ce0aee5e41 lib: Add Data/Tree/Node.php 2014-06-06 13:58:14 +02:00
Eric Lippmann d84532d593 lib: Remove TreeIterator
Nodes implementing the NodeInterface (which extends the RecursiveIterator interface)
are already iterable.
2014-06-06 13:57:18 +02:00
Eric Lippmann 794ae141fa lib: Let NodeInterface extend RecursiveIterator
Since a node may have children and they should be iterable, the Nodefinterface
now extends RecursiveIterator.
2014-06-06 13:55:58 +02:00
Thomas Gelf 1e9bc6c7d4 Data\PivotTable: should work with new queries
There is still some work to do be done here. And we should/could
rethink columns() VS getColumns().
2014-06-06 06:47:49 +00:00
Thomas Gelf db3accc704 Data\Db: rename Query and Connection to Db...
Class names in namespaces should not be chosen as once we didn't have
such. The fact that we already did "use Db\Connection as DbConnection"
is the best hint that naming was wrong.

So this patch renames Db\Connection to Db\DbConnection and does the
same with DbQuery. DbQuery has been adjusted to fit our new SimpleQuery
and to handle the new Filter implementation.
2014-06-06 06:43:13 +00:00
Thomas Gelf 1fbca25d99 Data\DataArray: use SimpleQuery and new interfaces
Removed ArrayQuery implementation as SimpleQuery is enough here.
Renamed the Datasource class to ArrayDatasource.

refs #6418
2014-06-06 06:21:35 +00:00
Thomas Gelf 31047e8082 Data\SimpleQuery: concrete implementation
SimpleQuery is no longer abstract, implements the Filterable interface
and should now be usable as a basic Query implemenation as is.
2014-06-06 06:12:17 +00:00
Thomas Gelf 85605597cc Data/interfaces: add Filterable, extend Connection
New interface ConnectionInterface attempts to aggregate things.
Extended Filterable interface, added Filter-related functions. Please
note that apply will probably get dropped later on, I'll keep it for
compatibility reasons right now.

refs #6418
2014-06-06 06:07:33 +00:00
Thomas Gelf f438cb30e1 Data\Filter: initial commit basic implementation
Basic operators are there, still missing: subclassed "where" to distinct
comparison operators like greater/less than on a class level.

refs #6418
2014-06-06 06:04:24 +00:00
Thomas Gelf d44a87717d Data\SimpleQuery: implement column handling
We want SimpleQuery to be able to run standalone
2014-06-06 05:49:39 +00:00
Thomas Gelf 4b8e09b12a Data\SimpleQuery: get front controller without ZF 2014-06-06 05:48:29 +00:00
Eric Lippmann 9edaaa82e8 lib: Add TreeIterator 2014-05-28 17:14:33 +02:00
Eric Lippmann 040473f986 lib: Add NodeInterface 2014-05-28 17:13:42 +02:00
Thomas Gelf 12b57c6d95 Merge remote-tracking branch 'origin/master' into feature/query-interfaces-6018
Conflicts:
	modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php
	modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php
	modules/monitoring/library/Monitoring/Backend/Ido/Query/StatusQuery.php
	modules/monitoring/library/Monitoring/Controller.php
2014-05-20 23:15:11 +00:00
Thomas Gelf e6d80ae1f6 IDO Queries: performance quickfixes
Will be obsoleted by the new filter implementation, but for now it
helps a little bit
2014-05-20 13:27:58 +00:00
Thomas Gelf 820b6b7a8d Data\BaseQuery: rename to Data\SimpleQuery
BaseQuery should no longer be abstract but be usable as is as soon as
we stripped ResultSet-specific tasks. As "Base" suggests something that
must be extended, the name no longer fits. So this is SimpleQuery right
now.
2014-05-07 11:55:35 +00:00
Eric Lippmann ecbd9b8616 Sortable: Fix PHPDoc for parameter `$direction'
`$direction' must be a string instead of an integer because
the direction constants `SORT_ASC' and `SORT_DESC' are strings.
2014-05-07 10:00:41 +02:00
Eric Lippmann d87788b9c1 Merge branch 'master' into feature/query-interfaces-6018
Conflicts:
	modules/monitoring/library/Monitoring/Backend/Ido/Query/ContactgroupQuery.php
2014-05-06 18:45:12 +02:00
Matthias Jentsch 085025ba7d Icingaweb shoul work without optional extensions when they are not used
When optional classes and php extensions like pgsql and additonal Zend-Pdos are
actually required by creating a new resource or authentication backend,
perform a check and display a warning instead of just throwing an exception.

refs #4788
2014-04-28 17:13:40 +02:00
Johannes Meyer aaa6a56146 Refactor authentication config form tests and fix auth backend validation
refs #6011
fixes #5712
2014-04-28 14:06:38 +02:00
Eric Lippmann 026145356b Add interface "QueryInterface" implementing Browsable, Fetchable, Filterable, Limitable, Sortable, Countable (WIP)
This interface is intended to be used within the data views and monitoring controllers. The monitoring list
and show controllers should only query data views instead of the actual query. Thus a data view is required to
implement the QueryInterface, which will be changed later.
The name is not final because it somehow conflicts with the Queryable interface which is also marked as work in progress.
2014-04-17 14:21:01 +02:00
Eric Lippmann 8532622fab Db: Implement missing fetch*() functions on connection level
The BaseQuery forwards fetch*() function calls to its datasource with the
query as first parameter since the datasource implements the actual fetching functionality.
There's no interface for fetch*() functions on the datasource level yet.
2014-04-15 17:44:34 +02:00
Eric Lippmann e525688383 Replace DatasourceInterface with Selectable 2014-04-15 17:43:45 +02:00
Eric Lippmann 1a2577dd47 Db/Connection: Replace getConnection() with getDpAdapter()
For readability getConnection() is deprecated in favor of getDpAdapter()
since Db/Connection is already the connection.
2014-04-15 17:37:44 +02:00
Eric Lippmann c85ade39c0 Create count and select database queries separately
The previous implementation always created both the count
and the select query.
For readability the property baseQuery has been renamed to select which the
IDO queries must take into account.
2014-04-15 17:21:10 +02:00
Eric Lippmann d94170372d Let the BaseQuery implement the query interfaces and remove filter functionality
This commit breaks the application as it introduces incompatible changes which
will be adopted bit by bit.

Since the filter functionality is subject to change it's removed from the BaseQuery.
The functions setOrderColumns() and getOrderColumns() are deprecated because they're
replaced by functions in the Sortable interface.
Further the Sortable interface now defines the sort constants ASC and DESC and are
thus removed from the BaseQuery. In addition the sort constants are no longer integers
but strings.
The distinct() and isDistinct() functions are removed because they're database specific.
They have been introduced with changes in the PivotTable implementation which should
actually not call distinct blindly anyway.
2014-04-15 16:40:25 +02:00
Eric Lippmann 659e6f774e Add interface "Queryable" (WIP)
Interface for classes which act as a data source and thus return or are a Fetchable.
The name of the interface is not yet final though.
2014-04-15 16:23:17 +02:00
Eric Lippmann 0f3d70c437 Add interface "Filterable" (WIP)
This interface is empty yet. It's meant to define how to filter a result set.
2014-04-15 16:20:11 +02:00
Eric Lippmann e5e3dc9c43 Add interface "Sortable" defining how a result set can be sorted
This interface should be used to ensure that sorting a result set
is standardized among the different query implementations.
2014-04-15 16:07:27 +02:00
Eric Lippmann 3e0d254dfd Implement "Limitable" interface for retrieving just a portion of a result set
Defines how to set a limit count and offset and should be used everywhere
where setting limit and offset is supported.
2014-04-15 15:48:51 +02:00
Eric Lippmann c083747f67 Add "Fetchable" interface for classes providing data retrieval
Classes for retrieving data must implement the Fetchable interface
which defines the usual fetch*() functions.
2014-04-15 15:40:07 +02:00
Eric Lippmann 2cc3823a95 Implement interface "Browsable" for classes providing page turning
This interface is intended to be used everywhere a Zend_Paginator
is returned within our code.
2014-04-15 15:36:13 +02:00
Alexander Klimov 933a851f65 Initial commit
refs #4514
2014-04-02 13:47:01 +02:00
Johannes Meyer 862b50264a Fix that the queryfilter parser cannot handle integer values 2014-04-01 11:44:24 +02:00
Johannes Meyer b168cf878d Fix type specification in DowntimestarthistoryQuery
refs #4190
2014-04-01 11:44:23 +02:00
Johannes Meyer ea473cf08a Fix sorting of pivot tables 2014-03-20 13:21:28 +01:00
Johannes Meyer bf717654f0 Add more consistency to the servicematrix when switching pages 2014-03-20 11:30:55 +01:00
Johannes Meyer 1604f4728b Fix that the TreeToSqlParser cannot handle partial conjunction nodes 2014-03-19 09:11:25 +01:00
Johannes Meyer e355415164 Fix that queryfilters are being ignored by the parser 2014-03-19 09:11:25 +01:00
Johannes Meyer 617b6822d7 Add pagination support to the servicematrix
refs #4180
2014-03-19 09:11:24 +01:00
Johannes Meyer dbab546f0a Make page/limit params work if either of those is hardcoded 2014-03-19 09:11:24 +01:00
Johannes Meyer eae4cd3b2a Add support for distinct database queries
refs #4180
2014-03-19 09:11:24 +01:00
Johannes Meyer 13b509bf4b Do not display hosts without any services in the servicematrix
refs #4180
2014-03-19 09:11:24 +01:00
Johannes Meyer 0a5c2c5bd7 Make filtering/sorting of the servicematrix work
refs #4180
2014-03-19 09:11:24 +01:00
Johannes Meyer 71f4b6960b Add servicematrix view
refs #4180
2014-03-19 09:11:24 +01:00
Thomas Gelf 7fc47ef961 Increase DB-Connection default timeout, 2 secs are sometimes too harsh 2014-03-17 16:17:55 +00:00
Alexander Klimov b410ebeed6 Remove unnecessary spaces at end of line 2014-03-06 13:08:11 +01:00
Eric Lippmann 07d04628cf Merge branch 'feature/installation-and-configuration-cleanup-5638'
Conflicts:
	config/config.ini.in
	library/Icinga/Application/ApplicationBootstrap.php
	library/Icinga/Application/Cli.php
	library/Icinga/Application/EmbeddedWeb.php
	library/Icinga/Application/Logger.php
	library/Icinga/Application/Modules/Manager.php
	library/Icinga/Application/Web.php
	library/Icinga/Authentication/Backend/DbUserBackend.php
	library/Icinga/Authentication/Manager.php
	library/Icinga/User/Preferences/IniStore.php
	test/php/library/Icinga/Application/LoggerTest.php
2014-03-03 19:03:39 +01:00
Johannes Meyer 3555e66018 Make IcingaWeb using the new log wrapper
refs #5683
2014-02-26 11:19:52 +01:00
Johannes Meyer 68357e9ca2 Fix coding style 2014-02-21 14:07:32 +01:00
Eric Lippmann 25665dec24 Vagrant: Add authentication.ini and resources.ini to /etc/icingaweb
refs #5638
2014-02-21 10:16:16 +01:00
Thomas Gelf d63fee064d Make sure DB profiler is disabled per default to avoid memory leaks 2014-02-14 13:51:28 +00:00
Thomas Gelf 32c897c0c9 Added some benchmark noise to DB queries
We need this to track down current performance issues, refs #5534
2014-01-22 12:36:44 +00:00
Thomas Gelf ad7e4451eb There is no "The" and no "Optional" Data class 2014-01-22 12:34:46 +00:00
Matthias Jentsch 2cf154310b Add controller to handle resource configuration
Add the controller, forms and views to handle the resource configuration.

refs #4786
2013-11-06 19:02:30 +01:00
Matthias Jentsch 59d4baff0b Fix remaining references to DbUserBackend and refresh the documentation.
refs #4786
2013-11-06 13:31:07 +01:00
Matthias Jentsch ad08691362 Extend resources.ini to contain all resources, including ldap
Remove the old calls to DbAdapterFactory and use ResourceFactory instead. Remove
the DbAdapterFactory and fix all unit tests that have been broken due to the changes.
Change the functionality of the ResourceFactory to also handle LdapConnections

resolves #4587
2013-11-06 10:20:15 +01:00
Eric Lippmann ca1d50ae53 Rename Icinga 2 Web to Icinga Web 2 2013-10-23 15:11:06 +02:00
Jannis Moßhammer dc5182d4bf CommandHandler now uses Status/HostView, fix sql IN-Query bug 2013-10-23 10:19:55 +02:00
Thomas Gelf 5d3fbd1cdf We need a Livestatus factory 2013-10-22 20:21:03 +00:00
Marius Hein b9f03e27b7 Fix backend configuration while installation
refs #4941
2013-10-22 17:50:21 +02:00
Jannis Moßhammer c4f3e78c02 Fix filter behaviour, fix statusdat filter
refs #4469
2013-10-21 17:04:39 +02:00
Jannis Moßhammer f350011028 Add Status.dat backend
refs #3801
2013-10-20 15:16:44 +02:00
Jannis Moßhammer 6095a71a8d CS Fixes
refs #4868
2013-10-17 21:40:02 +02:00
Jannis Moßhammer 4a95ba3468 Change url handling to detail on hashtag, add service filter
The url is now
http://%mainUrl%#%anchor%!detail=%detailUrl%
which allows us to better support IE and prevents
the detail url from appearing on the server side.

refs #4868
2013-10-17 19:55:00 +02:00
Jannis Moßhammer 44be5e85da Refactoring and Query and IDO code,
the Monitoring/View code was completly dropped in favor of
the DataView implementations, as new Backends otherwise
would require to implement two seperate query logics

refs #3801
2013-10-17 19:54:58 +02:00
Jannis Moßhammer d33cec78de Semantic search implementation
- Only implemented for hosts as an example
- URL behaviour still has to be normalized

refs #4469
2013-10-17 19:52:52 +02:00
Jannis Moßhammer dac61eda19 Implement Filter to IDO Sql parser
refs #4469
2013-10-17 19:52:25 +02:00
Eric Lippmann a42668edb8 Fix tests
refs #4663
2013-10-09 09:20:17 +02:00
Eric Lippmann b89d61add3 Monitoring: Refactor data views (WIP)
refs #4663
2013-10-09 09:20:16 +02:00
Eric Lippmann 24f64e6d30 Fix conflicts from rebase, using inet_aton with pgsql, PHP strict standards violations, CS compliance
refs #4255
2013-09-17 15:12:18 +02:00
Thomas Gelf 2ff5455018 First attempt to write a backend-independent Pivot-Table implementation 2013-09-17 10:41:02 +02:00
Thomas Gelf dc34905315 Moved Data\Array to DataArray 2013-09-17 10:36:04 +02:00
Thomas Gelf 1eb0fcdff8 AbstractQuery implements QueryInterface, added addColumn, fixed sort 2013-09-17 10:36:04 +02:00
Thomas Gelf 86945152b4 QueryInterface, initial commit 2013-09-17 10:36:04 +02:00
Thomas Gelf 1d1214b8b9 Implemented conservative count, implemented count 'cache' 2013-09-17 10:36:04 +02:00
Thomas Gelf 0f48d0e2d6 Added fetchColumn, it was missing 2013-09-16 17:02:30 +02:00
Thomas Gelf 103ed266c5 Typo 2013-09-16 17:02:30 +02:00
Thomas Gelf 3908974698 We need to set Db fetchMode as it has previously been done 2013-09-16 17:02:30 +02:00
Eric Lippmann 35fd9fd391 CS: Remove whitespaces at end of line
find application/ library/ test/ modules/ -name *.php | xargs sed -i 's/\s\+$//'
2013-09-04 18:27:16 +02:00
Jannis Moßhammer aac1d69ed2 Fix count query ignoring joins
Count queries were created before the required columns were added,
so they often returned more values than a resultset really offers

refs #4589
2013-09-02 18:42:05 +02:00
Marius Hein 3a8a3b8f2c Monitoring backend: Change database objects to DbAdapterFactory
refs #4575
2013-08-19 18:29:26 +02:00
Thomas Gelf 06fc3e395e NO_ZERO_IN_DATE is available since MySQL 5.0.2
refs #4255
2013-08-02 15:10:09 +02:00
Eric Lippmann 457f9b8f50 Db: Set MySQL server SQL modes to behave closer to ANSI SQL
refs #4413
2013-07-29 18:37:59 +02:00