From f6c0270d40f6730fe1e1820f2866b08792df1db6 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sat, 10 Dec 2016 18:22:34 +0100 Subject: rewrite data-model so that every configuration option is accessed through the conference --- lib/helper.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/helper.php b/lib/helper.php index 4fce91e..df7f329 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -18,14 +18,20 @@ function baseurl() if(startswith('//', $base)) $base = proto().':'.$base; - return forceslash(forceslash($base).@$GLOBALS['MANDATOR']); + return forceslash($base); } $base = ssl() ? 'https://' : 'http://'; $base .= $_SERVER['HTTP_HOST']; $base .= forceslash(dirname($_SERVER['SCRIPT_NAME'])); - return forceslash(forceslash($base).@$GLOBALS['MANDATOR']); + return forceslash($base); +} + +function joinpath($parts) +{ + $parts = array_map('forceslash', $parts); + return rtrim(implode('', $parts), '/'); } function forceslash($url) -- cgit v1.2.3 From 738878b8b060b3cfcdde2d88a1a28d5ce83e4aa7 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 20:01:33 +0100 Subject: better handling for legacy config errors --- lib/Exceptions.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') 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 {} -- cgit v1.2.3 From 3c3d0ac7301e818b14d01b9bbc949ca13d2cf798 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 11 Dec 2016 19:57:20 +0100 Subject: commandline helper functions --- lib/command-helper.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/command-helper.php (limited to 'lib') diff --git a/lib/command-helper.php b/lib/command-helper.php new file mode 100644 index 0000000..c406b9e --- /dev/null +++ b/lib/command-helper.php @@ -0,0 +1,15 @@ +