aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--index.php30
-rw-r--r--lib/Exceptions.php1
-rw-r--r--model/Conferences.php10
3 files changed, 23 insertions, 18 deletions
diff --git a/index.php b/index.php
index 414dede..ef3944c 100644
--- a/index.php
+++ b/index.php
@@ -153,25 +153,23 @@ catch(Exception $e)
}
-
// PER-CONFERENCE CODE
-$conference = Conferences::getConference($mandator);
-
-// update template information
-$tpl->set(array(
- 'baseurl' => forceslash(baseurl()),
- 'route' => $route,
- 'canonicalurl' => joinpath([baseurl(), $mandator, $route]),
- 'conference_assets' => forceslash($mandator),
-
- 'conference' => $conference,
- 'feedback' => $conference->getFeedback(),
- 'schedule' => $conference->getSchedule(),
- 'subtitles' => $conference->getSubtitles(),
-));
-
ob_start();
try {
+ $conference = Conferences::getConference($mandator);
+
+ // update template information
+ $tpl->set(array(
+ 'baseurl' => forceslash(baseurl()),
+ 'route' => $route,
+ 'canonicalurl' => joinpath([baseurl(), $mandator, $route]),
+ 'conference_assets' => forceslash($mandator),
+
+ 'conference' => $conference,
+ 'feedback' => $conference->getFeedback(),
+ 'schedule' => $conference->getSchedule(),
+ 'subtitles' => $conference->getSubtitles(),
+ ));
// ALWAYS AVAILABLE ROUTES
if($route == 'feedback/read')
diff --git a/lib/Exceptions.php b/lib/Exceptions.php
index 2e9109b..83bd380 100644
--- a/lib/Exceptions.php
+++ b/lib/Exceptions.php
@@ -10,3 +10,4 @@ set_error_handler("exception_error_handler");
class NotFoundException extends Exception {}
class ScheduleException extends Exception {}
+class ConfigException extends Exception {}
diff --git a/model/Conferences.php b/model/Conferences.php
index 77069ad..2dc9f35 100644
--- a/model/Conferences.php
+++ b/model/Conferences.php
@@ -73,8 +73,14 @@ class Conferences
}
public static function loadConferenceConfig($mandator) {
- $config = forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php';
- return include($config);
+ $configfile = forceslash(Conferences::MANDATOR_DIR).forceslash($mandator).'config.php';
+ $config = include($configfile);
+
+ if(!is_array($config)) {
+ throw new ConfigException("Loading $configfile did not return an array. Maybe it's missing a return-statement?");
+ }
+
+ return $config;
}
public static function getConference($mandator) {