Change log folder
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@@ -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
30
composer.lock
generated
@@ -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"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,33 +83,36 @@ class Gpx extends Geo {
|
|||||||
|
|
||||||
private function parseFile() {
|
private function parseFile() {
|
||||||
$this->addNotice('Parsing: '.$this->sFilePath);
|
$this->addNotice('Parsing: '.$this->sFilePath);
|
||||||
$oXml = simplexml_load_file($this->sFilePath);
|
if(!file_exists($this->sFilePath)) $this->addError($this->sFilePath.' file missing');
|
||||||
|
else {
|
||||||
|
$oXml = simplexml_load_file($this->sFilePath);
|
||||||
|
|
||||||
//Tracks
|
//Tracks
|
||||||
$this->addNotice('Converting '.count($oXml->trk).' tracks');
|
$this->addNotice('Converting '.count($oXml->trk).' tracks');
|
||||||
foreach($oXml->trk as $aoTrack) {
|
foreach($oXml->trk as $aoTrack) {
|
||||||
$asTrack = array(
|
$asTrack = array(
|
||||||
'name' => (string) $aoTrack->name,
|
'name' => (string) $aoTrack->name,
|
||||||
'desc' => str_replace("\n", '', ToolBox::fixEOL((strip_tags($aoTrack->desc)))),
|
'desc' => str_replace("\n", '', ToolBox::fixEOL((strip_tags($aoTrack->desc)))),
|
||||||
'cmt' => ToolBox::fixEOL((strip_tags($aoTrack->cmt))),
|
'cmt' => ToolBox::fixEOL((strip_tags($aoTrack->cmt))),
|
||||||
'color' => (string) $aoTrack->extensions->children('gpxx', true)->TrackExtension->DisplayColor,
|
'color' => (string) $aoTrack->extensions->children('gpxx', true)->TrackExtension->DisplayColor,
|
||||||
'points'=> array()
|
'points'=> array()
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach($aoTrack->trkseg as $asSegment) {
|
foreach($aoTrack->trkseg as $asSegment) {
|
||||||
foreach($asSegment as $asPoint) {
|
foreach($asSegment as $asPoint) {
|
||||||
$asTrack['points'][] = array(
|
$asTrack['points'][] = array(
|
||||||
'lon' => (float) $asPoint['lon'],
|
'lon' => (float) $asPoint['lon'],
|
||||||
'lat' => (float) $asPoint['lat'],
|
'lat' => (float) $asPoint['lat'],
|
||||||
'ele' => (int) $asPoint->ele
|
'ele' => (int) $asPoint->ele
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
$this->asTracks[] = $asTrack;
|
||||||
}
|
}
|
||||||
$this->asTracks[] = $asTrack;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Waypoints
|
//Waypoints
|
||||||
$this->addNotice('Ignoring '.count($oXml->wpt).' waypoints');
|
$this->addNotice('Ignoring '.count($oXml->wpt).' waypoints');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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');
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -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__;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user