Download the PHP package towerhouse/healthmeasures without Composer
On this page you can find all versions of the php package towerhouse/healthmeasures. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download towerhouse/healthmeasures
More information about towerhouse/healthmeasures
Files in towerhouse/healthmeasures
Package healthmeasures
Short Description This library gives you the ability to generate health measures given a name and a unit, for instance: weight / pound or kilo. You can configure where to store them and them gather to collect their values by date given a username or other token. The library gives you the ability to generate graphs or other stats information. It's totally configurable, methods are well documented and comes with unit testing.
License MIT
Informations about the package healthmeasures
Health Measures
- This library gives you the ability to generate health measures given a name and a unit, for instance: weight / pound or kilo.
- You can configure where to store them and them gather to collect their values by date given a username or other identifier.
- The library gives you the ability to generate graphs or other stats information. It's totally configurable, methods are well documented and comes with unit testing.
Tech
Health Measures uses a number of open source projects to work properly:
- [PHP] - <= 5.3
- [illuminate/config] - 5 . This is the config handler that environments like laravel 4.2 used to have.
- [amenadiel/jpgraph"] - ^3.6 . This guy ported all the jpgraph library to packagist, thank you.
Installation
- composer require towerhouse/healthmeasures
- Include the autoloader.
- A file on the test's folder test-creation.php will give you a quick review of what the library does.
- Merge the values from .env.example you want to use in your env or just rename the example to .env.
- This package should work standalone.
Example of use
Select your storage method on the .env file
Enter your measures one by one or using the bulk method
Example of content in Measure.csv
Now enter your values, it's the same as measures so, for simplicity we will use the bulk method
Example of content in Value.csv
Notice that the owner_id comes from an external system, while measure_id belongs to Healthmeasures. In this case measure_id "2577a46ca60e3ff293ccb0113e6a59c0" it's the id for the measure "waist".
Finally we retrieve all the values that the person with identifier 1 had for his waist starting from "2016-01-01" and ending in the most recent date (that would be today, otherwise you specify it on another last parameter)
Let's create a Stats object and pass the values to generate a linear graph. You can specify a path and the picture will be saved there, otherwise it will be rendered to the client through the browser.
Finally, you can render a nice and simple html report to your browser with all the details
This is a pdf I took from the html page. https://github.com/towerhouse/Healthmeasures/tree/master/test/report.pdf
...and this is the image of the graph
Unit testing
There is an article about unit testing I wrote for this library documented here: https://www.linkedin.com/pulse/unit-testing-activity-annoys-programmers-lucia-figueroa-tasca
All versions of healthmeasures with dependencies
illuminate/config Version ~5.0
symfony/finder Version ~2.6
vlucas/phpdotenv Version ~2.2
amenadiel/jpgraph Version ^3.6