Most were fine as they hardcoded the in into the query.
Change them all to use PDO properly.
Did not fix IRCBot, they are are all hardcoded.
DO NOT DELETE THIS TEXT
#### Please note
> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.
- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)
#### Testers
If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
Use Log facility when Laravel is booted.
Update init.php so we can easily boot Laravel for CLI scripts. (and just Eloquent, but that may go away)
Move all debug setup into set_debug() function and use that across all scripts.
Log Laravel database queries.
Send debug output to librenms log file when enabling debug in the webui.
Allow for colorized Log CLI output. (currently will leave % tags in log file output)
** Needs testing and perhaps tweaking still.
DO NOT DELETE THIS TEXT
#### Please note
> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.
- [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)
#### Testers
If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
* Support device group definitions from v2
Disable editing v2 groups.
V2 Device groups are defined as follows:
pattern = WHERE query with ? placeholders for values
params = json encoded array of values
* Can't array_unshift something that isn't an array...
Previously this function would output invalid SQL as a logical
operator would be included after every condition. This change
removes the final logical operator so the SQL is valid.
For example, previously the single rule:
`bgpPeers.bgpPeerRemoteAs = "6939" &&"`
Would generate:
```
SELECT DISTINCT(bgpPeers.device_id) FROM bgpPeers WHERE device_id=? && (bgpPeers.bgpPeerRemoteAs = "6939" &&) LIMIT 1
```
This changes means it will generate:
```
SELECT DISTINCT(bgpPeers.device_id) FROM bgpPeers WHERE device_id=? && (bgpPeers.bgpPeerRemoteAs = "6939") LIMIT 1
```
Currently the function for retrieving device_groups returns rows in the order
in which they were created. This causes the WebUI to display is a semi-random
order. This patch causes the devices to be sorted by name which makes the
group lists easier to navigate.