Skip to content

Commit

Permalink
Fix update 3D models
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Sep 18, 2016
1 parent 5d5e41b commit ac909e2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions install/class.update_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ public static function update_models() {
}
}
if (file_exists('../models/models.md5sum')) {
if (($handle = fopen('../models/models.md5sum','r')) !== FALSE) {
if (($handle = fopen(dirname(__FILE__).'/../models/models.md5sum','r')) !== FALSE) {
while (($row = fgetcsv($handle,1000," ")) !== FALSE) {
$model = trim($row[2]);
$modelsdb[$model] = trim($row[0]);
Expand All @@ -1426,10 +1426,10 @@ public static function update_models() {
$diff = array_diff($newmodelsdb,$modelsdb);
foreach ($diff as $key => $value) {
if ($globalDebug) echo 'Downloading model '.$key.' ...'."\n";
update_db::download('http://data.flightairmap.fr/data/models/'.$key,'../models/'.$key);
update_db::download('http://data.flightairmap.fr/data/models/'.$key,dirname(__FILE__).'/../models/'.$key);

}
update_db::download('http://data.flightairmap.fr/data/models/models.md5sum','../models/models.md5sum');
update_db::download('http://data.flightairmap.fr/data/models/models.md5sum',dirname(__FILE__).'/../models/models.md5sum');
} else $error = "File ".$tmp_dir.'models.md5sum'." doesn't exist. Download failed.";
if ($error != '') {
return $error;
Expand Down

0 comments on commit ac909e2

Please sign in to comment.