diff --git a/app/config.ini b/app/config.ini index 16b6f468..59222d7b 100644 --- a/app/config.ini +++ b/app/config.ini @@ -1,7 +1,7 @@ ; Global Framework Config [SERVER] -SERVER_NAME = PATHFINDER +SERVER_NAME = PATHFINDER [globals] ; Default Verbosity level of the stack trace. @@ -23,7 +23,6 @@ CACHE = folder=tmp/cache/ ; Callback functions ============================================================================== ONERROR = Controller\Controller->showError - UNLOAD = Controller\Controller->unload ; Path configurations ============================================================================= @@ -50,11 +49,15 @@ EXPORT = export/ ; Default language (overwrites HTTP Accept-Language request header) used for "setlocale()" affects number formatting. (default: en-US) LANGUAGE = en-US +; custom *.ini file folder, can be used to overwrite default *.ini files +CONF.CUSTOM = conf/ +CONF.DEFAULT = app/ + ; load additional config files ; DO NOT load environment.ini, it is loaded automatically [configs] -app/routes.ini = true -app/pathfinder.ini = true -conf/pathfinder.ini = true -app/requirements.ini = true -app/cron.ini = true \ No newline at end of file +{{@CONF.DEFAULT}}routes.ini = true +{{@CONF.DEFAULT}}pathfinder.ini = true +{{@CONF.CUSTOM}}pathfinder.ini = true +{{@CONF.DEFAULT}}requirements.ini = true +{{@CONF.DEFAULT}}cron.ini = true \ No newline at end of file diff --git a/app/environment.ini b/app/environment.ini index 020cb3d3..2eca34fd 100644 --- a/app/environment.ini +++ b/app/environment.ini @@ -11,7 +11,7 @@ SERVER = DEVELOP ; -> e.g. set /pathfinder if your URL looks like https://www.[YOUR_DOMAIN]/pathfinder (subfolder) BASE = ; deployment URL (e.g. http://localhost) -URL = http://local.pathfinder +URL = {{@SCHEME}}://local.pathfinder ; level of debug/error stack trace DEBUG = 3 ; main db @@ -57,7 +57,7 @@ SMTP_ERROR = pathfinder@localhost.com ; -> e.g. set /pathfinder if your URL looks like https://www.[YOUR_DOMAIN]/pathfinder (subfolder) BASE = ; deployment URL (e.g. https://www.pathfinder-w.space) -URL = https://www.pathfinder-w.space +URL = {{@SCHEME}}://www.pathfinder-w.space ; level of debug/error stack trace DEBUG = 0 ; main db diff --git a/app/main/controller/setup.php b/app/main/controller/setup.php index 1170dfb2..479a19ec 100644 --- a/app/main/controller/setup.php +++ b/app/main/controller/setup.php @@ -22,7 +22,7 @@ class Setup extends Controller { * @var array */ protected $environmentVars = [ - 'TYPE', + 'ENVIRONMENT_CONFIG', 'BASE', 'URL', 'DEBUG', diff --git a/app/main/lib/config.php b/app/main/lib/config.php index 7d037e68..c2f8c0cf 100644 --- a/app/main/lib/config.php +++ b/app/main/lib/config.php @@ -96,17 +96,24 @@ class Config extends \Prefab { $item = (in_array($key, self::ARRAY_KEYS)) ? explode(',', $item) : $item; }); - $environmentData['TYPE'] = 'PHP: environment variables'; + $environmentData['ENVIRONMENT_CONFIG'] = 'PHP: environment variables'; }else{ // get environment data from *.ini file config - $f3->config('app/environment.ini'); + $customConfDir = $f3->get('CONF'); - if( - $f3->exists(self::HIVE_KEY_ENVIRONMENT) && - ($environment = $f3->get(self::HIVE_KEY_ENVIRONMENT . '.SERVER')) && - ($environmentData = $f3->get(self::HIVE_KEY_ENVIRONMENT . '.' . $environment)) - ){ - $environmentData['TYPE'] = 'Config: environment.ini'; + // check "custom" ini dir, of not found check default ini dir + foreach($customConfDir as $type => $path){ + $envConfFile = $path . 'environment.ini'; + $f3->config($envConfFile, true); + + if( + $f3->exists(self::HIVE_KEY_ENVIRONMENT) && + ($environment = $f3->get(self::HIVE_KEY_ENVIRONMENT . '.SERVER')) && + ($environmentData = $f3->get(self::HIVE_KEY_ENVIRONMENT . '.' . $environment)) + ){ + $environmentData['ENVIRONMENT_CONFIG'] = 'Config: ' . $envConfFile; + break; + } } } diff --git a/gulpfile.js b/gulpfile.js index cc82f6ee..b57823fd 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -90,7 +90,7 @@ let trackTable = { // https://www.npmjs.com/package/uglify-es let uglifyJsOptions = { warnings: true, - toplevel: true + toplevel: false }; // Sourcemaps options @@ -795,7 +795,7 @@ gulp.task('task:buildCss', gulp.series( gulp.task( 'task:watchJsSrc', gulp.series( - // 'task:hintJS', + 'task:hintJS', 'task:diffJS', 'task:updateJsDest' ) diff --git a/index.php b/index.php index 2db8f88e..d6c505ed 100644 --- a/index.php +++ b/index.php @@ -9,7 +9,7 @@ if(file_exists($composerAutoloader)){ $f3 = require_once('app/lib/base.php'); // load main config -$f3->config('app/config.ini'); +$f3->config('app/config.ini', true); // load environment dependent config lib\Config::instance(); diff --git a/js/app/mappage.js b/js/app/mappage.js index 30d31716..a856c0a6 100644 --- a/js/app/mappage.js +++ b/js/app/mappage.js @@ -377,6 +377,14 @@ define([ // initial start of the map update function triggerMapUpdatePing(true); + // Send map update request on tab close/reload, in order to save map changes that + // haven´t been saved through default update trigger + window.addEventListener('beforeunload', function(e) { + triggerMapUpdatePing(); + // IMPORTANT, return false in order to not "abort" ajax request in background! + return false; + }); + }; }); diff --git a/public/js/v1.2.4/app/mappage.js b/public/js/v1.2.4/app/mappage.js index 30d31716..a856c0a6 100644 --- a/public/js/v1.2.4/app/mappage.js +++ b/public/js/v1.2.4/app/mappage.js @@ -377,6 +377,14 @@ define([ // initial start of the map update function triggerMapUpdatePing(true); + // Send map update request on tab close/reload, in order to save map changes that + // haven´t been saved through default update trigger + window.addEventListener('beforeunload', function(e) { + triggerMapUpdatePing(); + // IMPORTANT, return false in order to not "abort" ajax request in background! + return false; + }); + }; });