Browse Source

Option to reload categories on every page visit

master
parent
commit
5aaf1d4570
  1. 3
      conf.php-dist
  2. 5
      index.php

3
conf.php-dist

@ -2,6 +2,9 @@
// Directory from which to read the categories.
$config['categoriesDir'] = 'node_modules/openstreetbrowser-categories-main';
// Set to true to reload categories on every page visit.
$config['categoriesAlwaysReload'] = true;
// URL of the Overpass API
$config['overpassUrl'] = '//overpass-api.de/api/interpreter';

5
index.php

@ -3,7 +3,10 @@
<?php include "modulekit/loader.php"; /* loads all php-includes */ ?>
<?php call_hooks("init"); /* initialize submodules */ ?>
<?php
if (isset($config['categoriesDir'])) {
if (isset($config['categoriesAlwaysReload']) && $config['categoriesAlwaysReload']) {
$config['categoriesRev'] = uniqid();
}
elseif (isset($config['categoriesDir'])) {
if (file_exists("{$config['categoriesDir']}/.git")) {
exec("chdir " . escapeShellArg($config['categoriesDir']) . "; git rev-parse --short HEAD", $x);
$config['categoriesRev'] = $x[0];

Loading…
Cancel
Save