Skip to content
Snippets Groups Projects
Select Git revision
  • 0d216d165308cdec7667593d483a5eac60e0732b
  • master default protected
  • bugfix/wordpress-review
  • bugfix/prevent-error-notice
  • remove-arrow
  • feature/update-message
  • feature/minimum-plugin-version-check-demo1
  • feature/plugin-name
  • 3.7.1
  • 3.7.0
  • 3.6.3
  • 3.6.2
  • 3.6.1
  • 3.6.0
  • 3.6.0-beta3
  • 3.6.0-beta2
  • 3.6.0-beta1
  • 3.5.2
  • 3.5.1
  • 3.5.0
  • 3.4.0
  • 3.3.0
  • 3.2.8
  • 3.2.7
  • 3.2.6
  • 3.2.5
  • 3.2.4
  • 3.2.3
28 results

bootstrap.php

Blame
  • LegacyHookableDriver.php 908 B
    <?php
    declare( strict_types=1 );
    
    namespace WPDesk\Init\HookDriver;
    
    use Psr\Container\ContainerInterface;
    use WPDesk\Init\HookDriver\Legacy\HooksRegistry;
    
    class LegacyHookableDriver implements HookDriver {
    
    	/** @var ContainerInterface */
    	private $container;
    
    	public function __construct( ContainerInterface $container ) {
    		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".' );
    		}
    		$this->container = $container;
    	}
    
    	public function register_hooks(): void {
    		HooksRegistry::instance()->inject_container( $this->container );
    
    		$info       = $this->container->get( \WPDesk_Plugin_Info::class );
    		$class_name = $info->get_class_name();
    		$p          = new $class_name( $info );
    		add_action( 'plugins_loaded', [ $p, 'init' ], -45 );
    	}
    }