Skip to content
Permalink
Browse files

Add a lazy config check

  • Loading branch information...
telephone committed Jan 25, 2015
1 parent 69cb0f1 commit ec591ca791654731418488ab2a7c42f230bd5f9e
Showing with 12 additions and 2 deletions.
  1. +5 −0 ajax.php
  2. +7 −2 index.php
@@ -49,6 +49,11 @@
require 'LookingGlass/' . $val;
}
// lazy check
if (!isset($rateLimit)) {
$rateLimit = 0;
}
// instantiate LookingGlass & RateLimit
$lg = new Telephone\LookingGlass();
$limit = new Telephone\LookingGlass\RateLimit($rateLimit);
@@ -1,8 +1,13 @@
<?php
if (!file_exists('LookingGlass/Config.php')) {
// lazy config check/load
if (file_exists('LookingGlass/Config.php')) {
require 'LookingGlass/Config.php';
if (!isset($ipv4, $ipv6, $siteName, $siteUrl, $serverLocation, $testFiles, $theme)) {
exit('Configuration variable/s missing. Please run configure.sh');
}
} else {
exit('Config.php does not exist. Please run configure.sh');
}
require 'LookingGlass/Config.php';
?>
<!DOCTYPE html>
<html lang="en">

0 comments on commit ec591ca

Please sign in to comment.
You can’t perform that action at this time.