Change log folder

This commit is contained in:
2023-08-06 13:54:59 +02:00
parent 402d8f271e
commit 04f5ce8a9c
11 changed files with 61 additions and 55 deletions

7
.gitignore vendored
View File

@@ -1,11 +1,5 @@
/build.xml
/settings.php /settings.php
/.externalToolBuilders/
/.sass-cache/
/.buildpath
/.project
/style/.sass-cache/ /style/.sass-cache/
/.settings/
/files/**/*.jpg /files/**/*.jpg
/files/**/*.JPG /files/**/*.JPG
/files/**/*.jpeg /files/**/*.jpeg
@@ -17,3 +11,4 @@
/geo/*.geojson /geo/*.geojson
/spot_cron.sh /spot_cron.sh
/vendor/* /vendor/*
/log.html

30
composer.lock generated
View File

@@ -12,7 +12,7 @@
"dist": { "dist": {
"type": "path", "type": "path",
"url": "../objects", "url": "../objects",
"reference": "25c0f66cff31e30c730a6891e5e15b1cc209af67" "reference": "e1cf78b992a6f52742d6834f7508c0ef373ac860"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -27,16 +27,16 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.6.4", "version": "v6.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" "reference": "df16b615e371d81fb79e506277faea67a1be18f1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1",
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", "reference": "df16b615e371d81fb79e506277faea67a1be18f1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -46,22 +46,24 @@
"php": ">=5.5.0" "php": ">=5.5.0"
}, },
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2",
"doctrine/annotations": "^1.2", "doctrine/annotations": "^1.2.6 || ^1.13.3",
"php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-console-highlighter": "^1.0.0",
"php-parallel-lint/php-parallel-lint": "^1.3.2", "php-parallel-lint/php-parallel-lint": "^1.3.2",
"phpcompatibility/php-compatibility": "^9.3.5", "phpcompatibility/php-compatibility": "^9.3.5",
"roave/security-advisories": "dev-latest", "roave/security-advisories": "dev-latest",
"squizlabs/php_codesniffer": "^3.6.2", "squizlabs/php_codesniffer": "^3.7.1",
"yoast/phpunit-polyfills": "^1.0.0" "yoast/phpunit-polyfills": "^1.0.4"
}, },
"suggest": { "suggest": {
"ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses",
"ext-openssl": "Needed for secure SMTP sending and DKIM signing",
"greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication",
"hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication",
"league/oauth2-google": "Needed for Google XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication",
"psr/log": "For optional PSR-3 debug logging", "psr/log": "For optional PSR-3 debug logging",
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -93,7 +95,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": { "support": {
"issues": "https://github.com/PHPMailer/PHPMailer/issues", "issues": "https://github.com/PHPMailer/PHPMailer/issues",
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0"
}, },
"funding": [ "funding": [
{ {
@@ -101,7 +103,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2022-08-22T09:22:00+00:00" "time": "2023-03-06T14:43:22+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],
@@ -114,5 +116,5 @@
"prefer-lowest": false, "prefer-lowest": false,
"platform": [], "platform": [],
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.2.0" "plugin-api-version": "2.3.0"
} }

View File

@@ -19,7 +19,7 @@ use \Settings;
class Converter extends PhpObject { class Converter extends PhpObject {
public function __construct() { public function __construct() {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__);
} }
public static function convertToGeoJson($sCodeName) { public static function convertToGeoJson($sCodeName) {
@@ -36,8 +36,11 @@ class Converter extends PhpObject {
public static function isGeoJsonValid($sCodeName) { public static function isGeoJsonValid($sCodeName) {
$bResult = false; $bResult = false;
$sGpxFilePath = Geo::getFilePath($sCodeName, Gpx::EXT);
$sGeoJsonFilePath = Geo::getFilePath($sCodeName, GeoJson::EXT); $sGeoJsonFilePath = Geo::getFilePath($sCodeName, GeoJson::EXT);
if(file_exists($sGeoJsonFilePath) && filemtime($sGeoJsonFilePath) > filemtime(Geo::getFilePath($sCodeName, Gpx::EXT))) $bResult = true;
//No need to generate if gpx is missing
if(!file_exists($sGpxFilePath) || file_exists($sGeoJsonFilePath) && filemtime($sGeoJsonFilePath) > filemtime(Geo::getFilePath($sCodeName, Gpx::EXT))) $bResult = true;
return $bResult; return $bResult;
} }
} }
@@ -80,6 +83,8 @@ class Gpx extends Geo {
private function parseFile() { private function parseFile() {
$this->addNotice('Parsing: '.$this->sFilePath); $this->addNotice('Parsing: '.$this->sFilePath);
if(!file_exists($this->sFilePath)) $this->addError($this->sFilePath.' file missing');
else {
$oXml = simplexml_load_file($this->sFilePath); $oXml = simplexml_load_file($this->sFilePath);
//Tracks //Tracks
@@ -108,6 +113,7 @@ class Gpx extends Geo {
//Waypoints //Waypoints
$this->addNotice('Ignoring '.count($oXml->wpt).' waypoints'); $this->addNotice('Ignoring '.count($oXml->wpt).' waypoints');
} }
}
} }
class GeoJson extends Geo { class GeoJson extends Geo {

View File

@@ -22,6 +22,7 @@ class Email extends PhpObject {
private $asDests; private $asDests;
public function __construct($sServName, $sTemplateName='') { public function __construct($sServName, $sTemplateName='') {
parent::__construct(__CLASS__);
$this->sServName = $sServName; $this->sServName = $sServName;
$this->setTemplate($sTemplateName); $this->setTemplate($sTemplateName);
$this->asDests = array(); $this->asDests = array();

View File

@@ -54,7 +54,7 @@ class Feed extends PhpObject {
private $iLastUpdate; private $iLastUpdate;
public function __construct(Db &$oDb, $iFeedId=0) { public function __construct(Db &$oDb, $iFeedId=0) {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__);
$this->oDb = &$oDb; $this->oDb = &$oDb;
if($iFeedId > 0) $this->setFeedId($iFeedId); if($iFeedId > 0) $this->setFeedId($iFeedId);
} }

View File

@@ -15,7 +15,7 @@ class Map extends PhpObject {
private $asMaps; private $asMaps;
public function __construct(Db &$oDb) { public function __construct(Db &$oDb) {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__);
$this->oDb = &$oDb; $this->oDb = &$oDb;
$this->setMaps(); $this->setMaps();
} }

View File

@@ -35,7 +35,7 @@ class Media extends PhpObject {
private $iMediaId; private $iMediaId;
public function __construct(Db &$oDb, &$oProject, $iMediaId=0) { public function __construct(Db &$oDb, &$oProject, $iMediaId=0) {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__);
$this->oDb = &$oDb; $this->oDb = &$oDb;
$this->oProject = &$oProject; $this->oProject = &$oProject;
$this->asMedia = array(); $this->asMedia = array();

View File

@@ -22,14 +22,16 @@ class Project extends PhpObject {
*/ */
private $oDb; private $oDb;
private $iProjectId; private $iProjectId;
private $sMode;
private $sName; private $sName;
private $sCodeName; private $sCodeName;
private $sMode;
private $asActive; private $asActive;
private $asGeo;
public function __construct(Db &$oDb, $iProjectId=0) { public function __construct(Db &$oDb, $iProjectId=0) {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__);
$this->oDb = &$oDb; $this->oDb = &$oDb;
if($iProjectId > 0) $this->setProjectId($iProjectId); if($iProjectId > 0) $this->setProjectId($iProjectId);
} }
@@ -179,10 +181,10 @@ class Project extends PhpObject {
if($this->getProjectId() > 0) { if($this->getProjectId() > 0) {
$asProject = $this->getProject(); $asProject = $this->getProject();
$this->sName = $asProject['name'];
$this->sCodeName = $asProject['codename'];
$this->sMode = $asProject['mode']; $this->sMode = $asProject['mode'];
$this->asActive = array('from'=>$asProject['active_from'], 'to'=>$asProject['active_to']); $this->asActive = array('from'=>$asProject['active_from'], 'to'=>$asProject['active_to']);
$this->sCodeName = $asProject['codename'];
$this->sName = $asProject['name'];
$this->asGeo = array('geofile'=>$asProject['geofilepath'], 'gpxfile'=>$asProject['gpxfilepath']); $this->asGeo = array('geofile'=>$asProject['geofilepath'], 'gpxfile'=>$asProject['gpxfilepath']);
} }
else $this->addError('Error while setting project: no project ID'); else $this->addError('Error while setting project: no project ID');

View File

@@ -47,7 +47,7 @@ class Spot extends Main
public function __construct($sProcessPage, $sTimezone) public function __construct($sProcessPage, $sTimezone)
{ {
parent::__construct($sProcessPage, true, __FILE__, $sTimezone); parent::__construct($sProcessPage, true, $sTimezone);
$this->oUser = new User($this->oDb); $this->oUser = new User($this->oDb);
@@ -248,8 +248,7 @@ class Spot extends Main
} }
$bSuccess = $oEmail->send(); $bSuccess = $oEmail->send();
if(!$bSuccess) $sDesc = $oEmail->ErrorInfo; $sDesc = $bSuccess?'mail_sent':'mail_failure';
else $sDesc = 'mail_sent';
} }
else $sDesc = 'no_new_msg'; else $sDesc = 'no_new_msg';

View File

@@ -31,7 +31,7 @@ class User extends PhpObject {
private $asUserInfo; private $asUserInfo;
public function __construct(Db &$oDb) { public function __construct(Db &$oDb) {
parent::__construct(__CLASS__, Settings::DEBUG); parent::__construct(__CLASS__);
$this->oDb = &$oDb; $this->oDb = &$oDb;
$this->iUserId = 0; $this->iUserId = 0;
$this->asUserInfo = array( $this->asUserInfo = array(

View File

@@ -16,4 +16,5 @@ class Settings
const WEATHER_TOKEN = ''; //visualcrossing.com const WEATHER_TOKEN = ''; //visualcrossing.com
const TIMEZONE_USER = ''; //geonames.org const TIMEZONE_USER = ''; //geonames.org
const DEBUG = true; const DEBUG = true;
const LOG_FOLDER = __DIR__;
} }