parseLocationFile($nodeLocation->read()); // Let's try to read the node status file $nodeStatus = new FileHandler($config['node_status_file'], 'r'); $kmlFile->parseStatusFile($nodeStatus->read()); // Write the file to the server $file = new FileHandler($config['root'] . '/kml/nodemap-' . $time . '.kml', 'w'); $file->write($kmlFile->toString()); } /* Instead of exposing the kml file, one could also argue to hide it at the back * so you can can so some dirty hacking and more easy ACL * $kmlFile = fopen($config['root'] . '/kml/nodemap-' . $time . '.kml'); * print $fread($kmlFile); * fclose($kmlFile); */ echo 'kml/nodemap-' . $time . '.kml'; ?>