Skip to content
Snippets Groups Projects
Select Git revision
  • e9c365231e1cdef95a8d4d0b09f072abdb2c72b0
  • master default protected
  • devel
  • feature/add-escaping-to-templates
  • feature/add-priority-sorting
  • 3.3.0
  • 3.2.1
  • 3.2.0
  • 3.1.0
  • 3.0.0
  • 2.4.12
  • 2.4.11
  • 2.4.10
  • 2.4.9
  • 2.4.8
  • 2.4.7
  • 2.4.6
  • 2.4.5
  • 2.4.4
  • 2.4.2
  • 2.4.1
  • 2.4.0
  • 2.3.2
  • 2.3.1
  • 2.3
25 results

input-image.php

Blame
  • LegacyDriver.php 906 B
    <?php
    declare( strict_types=1 );
    
    namespace WPDesk\Init\HookDriver;
    
    use Psr\Container\ContainerInterface;
    use WPDesk\Init\HookDriver\Legacy\HooksRegistry;
    
    final class LegacyDriver 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 );
    	}
    }