Skip to content
Snippets Groups Projects
Verified Commit b77de519 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

feat: add check for optional package

parent 7d9521c6
Branches
Tags
3 merge requests!3improve into wp-hook and some additional unfinished things,!21.x,!1Draft: Basic implementation of plugin initializer
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment