PluginProbe
Boxzilla – WordPress Popup Builder / 3.2.21
Boxzilla – WordPress Popup Builder v3.2.21
3.4.11 3.4.10 3.4.9 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 trunk 3.0 3.0.1 3.0.2 3.0.3 3.1 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 All 72 releases
boxzilla / src / class-boxzilla-service-provider.php

class-boxzilla-service-provider.php in Boxzilla – WordPress Popup Builder 3.2.21, at src/class-boxzilla-service-provider.php

74 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Boxzilla;
4
5 use Boxzilla\Admin\Admin;
6 use Boxzilla\Admin\Menu;
7 use Boxzilla\Admin\Notices;
8 use Boxzilla\DI\Container;
9 use Boxzilla\DI\ServiceProviderInterface;
10
11 class BoxzillaServiceProvider implements ServiceProviderInterface {
12
13
14 /**
15 * Registers services on the given container.
16 *
17 * This method should only be used to configure services and parameters.
18 * It should not get services.
19 *
20 * @param Container $container An Container instance
21 */
22 public function register( Container $container ) {
23 $container['admin'] = function ( $container ) {
24 return new Admin( $container->plugin, $container );
25 };
26
27 $container['admin.menu'] = function( $container ) {
28 return new Menu();
29 };
30
31 $container['bootstrapper'] = new Bootstrapper();
32
33 $container['box_loader'] = function ( $container ) {
34 return new BoxLoader( $container->plugin, $container->options );
35 };
36
37 $container['filter.autocomplete'] = function ( $container ) {
38 return new Filter\Autocomplete();
39 };
40
41 $container['notices'] = function ( $container ) {
42 return new Notices();
43 };
44
45 $container['options'] = function ( $container ) {
46 $defaults = array(
47 'test_mode' => 0,
48 );
49
50 $options = (array) get_option( 'boxzilla_settings', $defaults );
51 $options = array_merge( $defaults, $options );
52 return $options;
53 };
54
55 $container['plugin'] = new Plugin(
56 'boxzilla',
57 'Boxzilla',
58 BOXZILLA_VERSION,
59 BOXZILLA_FILE,
60 dirname( BOXZILLA_FILE )
61 );
62
63 $container['plugins'] = function ( $container ) {
64 $raw = (array) apply_filters( 'boxzilla_extensions', array() );
65
66 $plugins = array();
67 foreach ( $raw as $p ) {
68 $plugins[ $p->id() ] = $p;
69 }
70 return $plugins;
71 };
72 }
73 }
74