Esempio n. 1
0
 /**
  * Load gpx file into SimpleXMLElement and create Activity object.
  */
 public function algorithm($file_name)
 {
     $xml = simplexml_load_file($file_name);
     //$Sport = (isset($xml->trk->type) ? (string) $xml->trk->type : "running");
     //$class = "\activity_" . \strtolower( $Sport );
     $aktywnosc = new \activity();
     $aktywnosc->setValues($xml, "GPX");
     return $aktywnosc;
 }
Esempio n. 2
0
 /**
  * Load tcx file into SimpleXMLElement and create Activity object.
  */
 public function algorithm($file_name)
 {
     $xml = simplexml_load_file($file_name);
     //	foreach($xml->Activities->Activity[0]->attributes() as $attr => $value)
     //		if(\strtolower($attr) === "sport") $this->Sport = (string) $value;
     //	$class = "\activity_" . \strtolower( $this->Sport );
     $aktywnosc = new \activity();
     $aktywnosc->setValues($xml->Activities->Activity[0], "TCX");
     return $aktywnosc;
 }