diff --git a/src/HookDriver/LegacyHookableDriver.php b/src/HookDriver/LegacyHookableDriver.php index 20df1d01ab8e7c19b74085e19568a4d38ec4d03c..d9481c95dd70895b5d73d3f99a52ddd607b11b58 100644 --- a/src/HookDriver/LegacyHookableDriver.php +++ b/src/HookDriver/LegacyHookableDriver.php @@ -10,6 +10,12 @@ use WPDesk\Init\Plugin; class LegacyHookableDriver implements HookDriver { + public function __construct() { + if (!class_exists(\WPDesk_Plugin_Info::class)) { + throw new \LogicException('Legacy driver cannot be used as the plugin builder component is unavailable. Try running "composer require wpdesk/wp-builder".'); + } + } + public function register_hooks( ReadableConfig $config, array $bundles, ContainerInterface $container ): void { $info = $this->as_plugin_info($container->get(Plugin::class), $config);