jrgp / linfo

Linfo PHP Server Health Status
MIT License
361 stars 73 forks source link

PHP library usage #41

Closed mitsus closed 8 years ago

mitsus commented 8 years ago

Hi, i followed your guide, so on my debian machine into a subdirectory i've download linfo project. I tested it and all work fine. Now i created a new directory (outside linfo dir) i launched:

`
composer require linfo/linfo Do not run Composer as root/super user! See https://getcomposer.org/root for details Using version ^3.0 for linfo/linfo ./composer.json has been created Loading composer repositories with package information Updating dependencies (including require-dev)

      linfo/linfo suggests installing ext-com (On Windows)
      Writing lock file
      Generating autoload files`

i created a new file api_linfo.php with this values: <?php $linfo = new \Linfo\Linfo; $parser = $linfo->getParser();

var_dump($parser->getCPU()); ?>

But when i exec i've this error: PHP Fatal error: Class 'Linfo\Linfo' not found in

Where are my errors?

Regards

Gummibeer commented 8 years ago

Have you included the composer autoloader in your file!? https://getcomposer.org/doc/01-basic-usage.md#autoloading

mitsus commented 8 years ago

Wow @Gummibeer, thanks a lot now it work fine.

Just last question...where i can find more infos about library? So others command as $parser->getCPU()...for example for take cpu load, memory, ecc?

Thanks a lot

Gummibeer commented 8 years ago

Just in the code yet.

jrgp commented 8 years ago

Yeah linfo needs docs as well as an interface binding all of the os classes to implement the same methods. Thanks gummibear

mitsus commented 8 years ago

Ok sure, but i don't find for example how to get cpu load % value.

jrgp commented 8 years ago

For Linux Call determineCPUPercentage and then getCPUUsage

mitsus commented 8 years ago

I try to call $parser->getCPUUsage()...but it return empty value

jrgp commented 8 years ago

Closing this as it's old and I haven't reproduced. Reopen if necessary.