File tree Expand file tree Collapse file tree 3 files changed +262
-129
lines changed Expand file tree Collapse file tree 3 files changed +262
-129
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ public function __construct()
2828 {
2929 $ this ->loadConfig ();
3030 $ this ->populateMasterList ();
31+ $ this ->initAutoloaders ();
3132 }
3233
3334 /**
@@ -394,4 +395,21 @@ protected function negate($input)
394395 {
395396 return !(bool )$ input ;
396397 }
398+
399+ /**
400+ * Initialize vendor autoloaders for all plugins that have them
401+ */
402+ protected function initAutoloaders ()
403+ {
404+ $ plugins = $ this ->getList ();
405+ foreach ($ plugins as $ plugin ) {
406+ if (file_exists (DOKU_PLUGIN . $ plugin . '/vendor/autoload.php ' )) {
407+ try {
408+ require_once (DOKU_PLUGIN . $ plugin . '/vendor/autoload.php ' );
409+ } catch (\Throwable $ e ) {
410+ ErrorHandler::showExceptionMsg ($ e , sprintf ('Failed to init plugin %s autoloader ' , $ plugin ));
411+ }
412+ }
413+ }
414+ }
397415}
Original file line number Diff line number Diff line change @@ -202,8 +202,7 @@ function_exists('ob_gzhandler') &&
202202global $ plugin_controller_class , $ plugin_controller ;
203203if (empty ($ plugin_controller_class )) $ plugin_controller_class = PluginController::class;
204204
205- // load libraries
206- require_once (DOKU_INC . 'vendor/autoload.php ' );
205+ // autoloader
207206require_once (DOKU_INC . 'inc/load.php ' );
208207
209208// from now on everything is an exception
You can’t perform that action at this time.
0 commit comments