PHP wrapper for osquery.
use League\Squery\BuilderProxy;
use League\Squery\RunnerProxy;
$builder = BuilderProxy::select("*")
->from("processes")
->limit(5);
RunnerProxy::run($builder, function(array $rows) {
$headings = array_shift($rows);
foreach ($rows as $row) {
foreach ($row as $i => $column) {
print $headings[$i] . ": " . $column . "\n";
}
}
}, function($error) {
print "error: " . $error . "\n";
});
More at squery.thephpleague.com.
❯ composer require "league/squery:~2.4.0"
❯ composer create-project --prefer-source "league/squery:~2.4.0" .
❯ vendor/bin/phpunit