Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More usage examples #101

Open
SubrataM3 opened this issue Sep 22, 2019 · 1 comment
Open

More usage examples #101

SubrataM3 opened this issue Sep 22, 2019 · 1 comment

Comments

@SubrataM3
Copy link

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

@jrgp
Copy link
Owner

jrgp commented Sep 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants