Verified Commit 667696f2 authored by noplanman's avatar noplanman
Browse files

Better config and application boot script.

parent 94899783
......@@ -9,15 +9,7 @@ declare(strict_types=1);
use Poduptime\PodStatus;
use RedBeanPHP\R;
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config.php';
define('PODUPTIME', microtime(true));
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
require_once __DIR__ . '/boot.php';
// CloudFlare country code pull.
$country_code = $_SERVER['HTTP_CF_IPCOUNTRY'] ?? '';
......@@ -84,7 +76,7 @@ EOF;
?>
]
};
var tiles = L.tileLayer('https://{s}.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.jpg70?access_token=<?php echo $mapboxkey; ?>', {
var tiles = L.tileLayer('https://{s}.tiles.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.jpg70?access_token=<?php echo c('mapboxkey'); ?>', {
maxZoom: 18,
attribution: '<a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox &copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a>'
});
......
......@@ -9,15 +9,7 @@ declare(strict_types=1);
use Poduptime\PodStatus;
use RedBeanPHP\R;
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config.php';
define('PODUPTIME', microtime(true));
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
require_once __DIR__ . '/boot.php';
try {
$totals = R::getAll('
......
......@@ -10,15 +10,7 @@ use Carbon\Carbon;
use Poduptime\PodStatus;
use RedBeanPHP\R;
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config.php';
define('PODUPTIME', microtime(true));
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
require_once __DIR__ . '/boot.php';
try {
$pods = R::getAll('
......
......@@ -9,15 +9,7 @@ declare(strict_types=1);
use Poduptime\PodStatus;
use RedBeanPHP\R;
define('PODUPTIME', microtime(true));
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config.php';
// Set up global DB connection.
R::setup("pgsql:host={$pghost};dbname={$pgdb}", $pguser, $pgpass, true);
R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
require_once __DIR__ . '/boot.php';
$page = (int) ($_GET['page'] ?? 1);
$softwarename = $_GET['softwarename'] ?? null;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment