linfo icon indicating copy to clipboard operation
linfo copied to clipboard

More usage examples

Open SubrataM3 opened this issue 6 years ago • 1 comments

Hi,

Is there any page where i can see more usage example?

for example:

  1. var_dump($parser->getTemps()); gives nothing with the following notice/error

Undefined index: temps

  1. var_dump($parser->determineCPUPercentage()); gives null

  2. 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

SubrataM3 avatar Sep 22 '19 21:09 SubrataM3

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.

jrgp avatar Sep 23 '19 06:09 jrgp