File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -58,15 +58,24 @@ public static function factory($driver, $params = [])
5858 if (is_array ($ driver )) {
5959 $ app = $ driver [0 ];
6060 $ driver = $ driver [1 ];
61+ } else {
62+ $ app = '' ;
6163 }
6264
6365 $ driver = Horde_String::ucfirst (basename ($ driver ));
64- if (!empty ($ app )) {
66+ $ class = (empty ($ app ) ? 'Horde_Core ' : $ app ) . '_Ui_VarRenderer_ ' . $ driver ;
67+
68+ $ ok = class_exists ($ class );
69+
70+ // TODO: Eliminate after renaming Horde_Ui_VarRenderer_* classes in other apps to {app}_Ui_VarRenderer_*
71+ if (!$ ok && !empty ($ app )) {
72+ // fallback to legacy method (manual load)
73+ $ class = __CLASS__ . '_ ' . $ driver ;
6574 include_once $ GLOBALS ['registry ' ]->get ('fileroot ' , $ app ) . '/lib/Ui/VarRenderer/ ' . $ driver . '.php ' ;
75+ $ ok = class_exists ($ class );
6676 }
6777
68- $ class = __CLASS__ . '_ ' . $ driver ;
69- if (!class_exists ($ class )) {
78+ if (!$ ok ) {
7079 throw new LogicException ('Class definition of ' . $ class . ' not found. ' );
7180 }
7281
You can’t perform that action at this time.
0 commit comments