PHPackages                             adriangibbons/php-fit-file-analysis - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. adriangibbons/php-fit-file-analysis

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

adriangibbons/php-fit-file-analysis
===================================

A PHP class for analysing FIT files created by Garmin GPS devices

v3.2.4(6y ago)12869.8k—1.5%51[22 issues](https://github.com/adriangibbons/php-fit-file-analysis/issues)PHP

Since Aug 16Pushed 1y ago23 watchersCompare

[ Source](https://github.com/adriangibbons/php-fit-file-analysis)[ Packagist](https://packagist.org/packages/adriangibbons/php-fit-file-analysis)[ Docs](https://github.com/adriangibbons/php-fit-file-analysis)[ RSS](/packages/adriangibbons-php-fit-file-analysis/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (22)Used By (0)

[![Build Status](https://camo.githubusercontent.com/ffc76bcde97446aba67cedfbc26cf716c4d93910cfb129f8926ea8ce3ca6c1dc/68747470733a2f2f7472617669732d63692e6f72672f61647269616e676962626f6e732f7068702d6669742d66696c652d616e616c797369732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/adriangibbons/php-fit-file-analysis) [![Packagist](https://camo.githubusercontent.com/a8119dda261dbc89e93128e4b3a889dae9373f5d612dd07523287da6c68d5e6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61647269616e676962626f6e732f7068702d6669742d66696c652d616e616c797369732e737667)](https://packagist.org/packages/adriangibbons/php-fit-file-analysis) [![Packagist](https://camo.githubusercontent.com/53f811722cac141646ec01532048115b74e5a27e27af7499eb1c4305d5350f92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61647269616e676962626f6e732f7068702d6669742d66696c652d616e616c797369732e737667)](https://packagist.org/packages/adriangibbons/php-fit-file-analysis) [![Coverage Status](https://camo.githubusercontent.com/169b32854d21310e7a515216c7eaf8eb64cee41d03729b782a8329fcce1e40e9/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f61647269616e676962626f6e732f7068702d6669742d66696c652d616e616c797369732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/adriangibbons/php-fit-file-analysis?branch=master)

phpFITFileAnalysis
==================

[](#phpfitfileanalysis)

A PHP (&gt;= v5.4) class for analysing FIT files created by Garmin GPS devices.

Changes from main branch in this repository
-------------------------------------------

[](#changes-from-main-branch-in-this-repository)

Added some enumeration support up to FIT SDK Version: 21.101 including addition of dynamic fields. However there are several newer FIT features that have not been addressed yet. It does fix some of the reported issues on the main branch. Added a timeInZones heart rate calculations and some meta data to the hrMetrics method Added using CDN for bootstrap so the showDebugInfo() routine displays with proper formatting with no extra work. Still a work in progress as I add dynamic messages but should be backwards compatible and handle more FIT files.

Note, one behavorial change is if there are no records or recorded data found in the fit file, it will report no records found instead of failing silently.

New Utilities
-------------

[](#new-utilities)

Created a utility (readProfileCSV.php) to parse the FIT Profile.xlsx sheets directly into usable arrays for the class. The spread sheet found in the garmin SDK  should be saved as 2 files "Profile-mesg.csv" for the message tab and "Profile-types.csv" for the type tab. Then in the same directory run `php readProfileCSV.php` to extract type-enum.php and type-message.php. These can then be copied into the main phpFitFileAnalsis.php class. Don't forget to declare them private when imported to the class.

Demo Screenshots
----------------

[](#demo-screenshots)

[Live demonstration](http://adriangibbons.com/php-fit-file-analysis/demo/) (Right-click and Open in new tab)

[![Mountain Biking](demo/img/mountain-biking.jpg)](demo/img/mountain-biking.jpg)[![Power Analysis](demo/img/power-analysis.jpg)](demo/img/power-analysis.jpg)[![Quadrant Analysis](demo/img/quadrant-analysis.jpg)](demo/img/quadrant-analysis.jpg)[![Swim](demo/img/swim.jpg)](demo/img/swim.jpg)

Please read this page in its entirety and the [FAQ](https://github.com/adriangibbons/php-fit-file-analysis/wiki/Frequently-Asked-Questions-(FAQ)) first if you have any questions or need support.

What is a FIT file?
-------------------

[](#what-is-a-fit-file)

FIT or Flexible and Interoperable Data Transfer is a file format used for GPS tracks and routes. It is used by newer Garmin fitness GPS devices, including the Edge and Forerunner series, which are popular with cyclists and runners.

Visit the FAQ page within the Wiki for more information.

How do I use phpFITFileAnalysis with my PHP-driven website?
-----------------------------------------------------------

[](#how-do-i-use-phpfitfileanalysis-with-my-php-driven-website)

A couple of choices here:

**The more modern way:** Add the package *adriangibbons/php-fit-file-analysis* in a composer.json file:

```
{
    "require": {
        "adriangibbons/php-fit-file-analysis": "^3.2.0"
    }
}
```

Run `composer update` from the command line.

The composer.json file should autoload the `phpFITFileAnalysis` class, so as long as you include the autoload file in your PHP file, you should be able to instantiate the class with:

```
