commit 960440503a113be45b0e98cfe4c8abc6a2fd9884 parent c27901affaee49931b75c47d1bad7aea7e0eec98 Author: Jan Dankert <devnull@localhost> Date: Sun, 8 Jul 2018 21:56:42 +0200 Wenn eine Action nicht gefunden wird, soll der Aufrufer eine Warnmeldung erhalten. require_once erzeugt leider einen fatal_error und bricht alles ab. Diffstat:
modules/cms-core/Dispatcher.class.php | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/cms-core/Dispatcher.class.php b/modules/cms-core/Dispatcher.class.php @@ -280,7 +280,10 @@ class Dispatcher if (!class_exists($actionClassNameWithNamespace)) { // Laden der Action-Klasse. - require_once(__DIR__. '/action/' . $actionClassName . '.class.php'); + $success = include_once(__DIR__. '/action/' . $actionClassName . '.class.php'); + + if ( !$success) + throw new LogicException("Action '$this->action' is not available"); } // Erzeugen der Action-Klasse