backup v5

This commit is contained in:
2019-03-07 20:51:13 +01:00
parent eb0cf07bb6
commit 7abce20d9f
3 changed files with 226 additions and 9 deletions

220
files/db/backup_v5.sql Normal file

File diff suppressed because one or more lines are too long

View File

@@ -12,11 +12,8 @@ class Converter extends PhpObject {
} }
public function convertToGeoJson($sFileName) { public function convertToGeoJson($sFileName) {
$sGpxFileName = $sFileName.Gpx::EXT; $oGpx = new Gpx($sFileName);
$sGeoJsonFileName = $sFileName.GeoJson::EXT; $oGeoJson = new GeoJson($sFileName);
$oGpx = new Gpx($sGpxFileName);
$oGeoJson = new GeoJson($sGeoJsonFileName);
$oGeoJson->setTracks($oGpx->getTracks()); $oGeoJson->setTracks($oGpx->getTracks());
$oGeoJson->saveFile(); $oGeoJson->saveFile();
@@ -24,7 +21,7 @@ class Converter extends PhpObject {
public static function isGeoJsonValid($sFileName) { public static function isGeoJsonValid($sFileName) {
$bResult = false; $bResult = false;
$sGeoJsonFilePath = Geo::getFilePath($sFileName); $sGeoJsonFilePath = Geo::getFilePath($sFileName, GeoJson::EXT);
if(file_exists($sGeoJsonFilePath)) { if(file_exists($sGeoJsonFilePath)) {
if(filemtime($sGeoJsonFilePath) > filemtime(Geo::getFilePath($sFileName, Gpx::EXT))) $bResult = true; if(filemtime($sGeoJsonFilePath) > filemtime(Geo::getFilePath($sFileName, Gpx::EXT))) $bResult = true;
} }
@@ -41,11 +38,11 @@ class Geo extends PhpObject {
public function __construct($sFileName) { public function __construct($sFileName) {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__, Settings::DEBUG);
$this->sFilePath = self::GEO_FOLDER.$sFileName; $this->sFilePath = self::getFilePath($sFileName, static::EXT);
$this->asTracks = array(); $this->asTracks = array();
} }
public static function getFilePath($sFileName, $sExt=GeoJson::EXT) { public static function getFilePath($sFileName, $sExt) {
return self::GEO_FOLDER.$sFileName.$sExt; return self::GEO_FOLDER.$sFileName.$sExt;
} }
} }

View File

@@ -102,7 +102,7 @@ class Project extends PhpObject {
(new Converter())->convertToGeoJson($asProject['geofile']); (new Converter())->convertToGeoJson($asProject['geofile']);
} }
$asProject['geofile'] = Spot::addTimestampToFilePath(Geo::getFilePath($asProject['geofile'])); $asProject['geofile'] = Spot::addTimestampToFilePath(Geo::getFilePath($asProject['geofile'], GeoJson::EXT));
$asProject['codename'] = $sCodeName; $asProject['codename'] = $sCodeName;
$asProject['timezone_desc'] = Spot::getTimeZoneDesc($asProject['timezone']); $asProject['timezone_desc'] = Spot::getTimeZoneDesc($asProject['timezone']);
} }