['all'], // 'units' => ['metric'] ]; $pFFA = new adriangibbons\phpFITFileAnalysis(__DIR__ . $file, $options); // Google Time Zone API $date = new DateTime('now', new DateTimeZone('UTC')); $date_s = $pFFA->data_mesgs['session']['start_time']; $url_tz = "https://maps.googleapis.com/maps/api/timezone/json?location=".reset($pFFA->data_mesgs['record']['position_lat']).','.reset($pFFA->data_mesgs['record']['position_long'])."×tamp=".$date_s."&key=AIzaSyDlPWKTvmHsZ-X6PGsBPAvo0nm1-WdwuYE"; $result = file_get_contents("$url_tz"); $json_tz = json_decode($result); if ($json_tz->status == "OK") { $date_s = $date_s + $json_tz->rawOffset + $json_tz->dstOffset; } $date->setTimestamp($date_s); $ftp = 329; $hr_metrics = $pFFA->hrMetrics(52, 185, 172, 'male'); $power_metrics = $pFFA->powerMetrics($ftp); $criticalPower = $pFFA->criticalPower([2,3,5,10,30,60,120,300,600,1200,3600,7200,10800,18000]); $power_histogram = $pFFA->powerHistogram(); $power_table = $pFFA->powerPartioned($ftp); $power_pie_chart = $pFFA->partitionData('power', $pFFA->powerZones($ftp), true, false); $quad_plot = $pFFA->quadrantAnalysis(0.175, $ftp); } catch (Exception $e) { echo 'caught exception: '.$e->getMessage(); die(); } ?>
This is a demonstration of the phpFITFileAnalysis class available on GitHub
Zone | Zone range | % in zone | $value) { echo '
---|---|---|
'.$i++.' | '.$key.' w | '.$value.' % | '; echo '