linfo
linfo copied to clipboard
More usage examples
Hi,
Is there any page where i can see more usage example?
for example:
var_dump($parser->getTemps());gives nothing with the following notice/error
Undefined index: temps
-
var_dump($parser->determineCPUPercentage());gives null -
var_dump($parser->getMounts());gives notice
Undefined index: show
I think i need to pass some more info to these method calls. Can you help.?
Thanks
Hey,
Sorry for the lack of proper usage docs.
Those methods expect configuration items (the same ones in sample.config.inc.php) to be passed as an associative array when you instantiate the Linfo object.
Eg:
<?php
$linfo = new \Linfo\Linfo(['temps'=> ['hwmon' => true]]);
$parser = $linfo->getParser();
var_dump($parser->getTemps());
For the mount example, the code is looking for the ['show']['duplicate_mounts'] setting.