aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mekanisti.fi>2009-11-05 21:32:42 +0200
committerFilipp Lepalaan <filipp@mekanisti.fi>2009-11-05 21:32:42 +0200
commitd07ac0a8be78fa69b9c874576dcff547a02a6523 (patch)
treef44df613ae091cc03400f1ae360223254f78833c
parentefbacb9717eb28209c0362c84b293653915fb453 (diff)
downloadmain-d07ac0a8be78fa69b9c874576dcff547a02a6523.tar.gz
main-d07ac0a8be78fa69b9c874576dcff547a02a6523.tar.bz2
main-d07ac0a8be78fa69b9c874576dcff547a02a6523.zip
Error on invalid config key
-rw-r--r--App.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/App.php b/App.php
index f62a9ef..6eb9a24 100644
--- a/App.php
+++ b/App.php
@@ -25,7 +25,8 @@ class App
}
if (!$controller) {
- $controller = "user";
+ $dc = self::conf("defaults.route");
+ $controller = $dc;
}
ob_start();
@@ -76,6 +77,9 @@ class App
$cpath = realpath("../system/config.ini");
$config = parse_ini_file($cpath, true);
$config = $config['development'];
+ if ($key && ! $config[$key]) {
+ return self::error("No such config key: $key");
+ }
return ($key) ? $config[$key] : $config;
}