PluginProbe
Depicter — Popup & Slider Builder / 1.5.2
Depicter — Popup & Slider Builder v1.5.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Services / ServiceProvider.php

ServiceProvider.php in Depicter — Popup & Slider Builder 1.5.2, at app/src/Services/ServiceProvider.php

91 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Depicter\Services;
3
4 use Averta\WordPress\Cache\DatabaseCache;
5 use Averta\WordPress\Cache\WPCache;
6 use WPEmerge\ServiceProviders\ServiceProviderInterface;
7
8 /**
9 * initialize common services
10 */
11 class ServiceProvider implements ServiceProviderInterface
12 {
13
14 /**
15 * {@inheritDoc}
16 */
17 public function register( $container ) {
18 $app = $container[ WPEMERGE_APPLICATION_KEY ];
19
20 // register Cache modules
21 $container[ 'depicter.services.cache.base' ] = function () {
22 return new WPCache('depicter__');
23 };
24
25 $container[ 'depicter.services.cache.api' ] = function () {
26 return new WPCache('depicter_api_');
27 };
28
29 $container[ 'depicter.services.cache.document' ] = function () {
30 return new DatabaseCache('depicter_doc_id_');
31 };
32
33 // register cache alias for retrieving a cache module
34 $app->alias( 'cache', function () use ( $app ) {
35 $module = !empty( func_get_args()['0'] ) ? strtolower( func_get_args()['0'] ) : 'api';
36 return $app->resolve( 'depicter.services.cache.' . $module );
37 });
38
39 $container[ 'depicter.media.library' ] = function () {
40 return new MediaLibraryService();
41 };
42 $app->alias( 'mediaLibrary', 'depicter.media.library' );
43
44 $container[ 'depicter.media.bridge' ] = function () {
45 return new MediaBridge();
46 };
47 $app->alias( 'media', 'depicter.media.bridge' );
48
49 $container[ 'depicter.services.document.fonts' ] = function () {
50 return new DocumentFontsV1Service();
51 };
52 $app->alias( 'documentFonts', 'depicter.services.document.fonts' );
53
54 $container[ 'depicter.services.remote.api' ] = function () {
55 return new RemoteAPIService();
56 };
57 $app->alias( 'remote', 'depicter.services.remote.api' );
58
59 $container[ 'depicter.services.storage.disk' ] = function () {
60 return new StorageService();
61 };
62 $app->alias( 'storage', 'depicter.services.storage.disk' );
63
64 $container[ 'depicter.export.service' ] = function () {
65 return new ExportService();
66 };
67 $app->alias( 'exportService', 'depicter.export.service' );
68
69 $container[ 'depicter.import.service' ] = function () {
70 return new ImportService();
71 };
72 $app->alias( 'importService', 'depicter.import.service' );
73
74 $container[ 'depicter.security.authorization' ] = function () {
75 return new AuthorizationService();
76 };
77 $app->alias( 'authorization', 'depicter.security.authorization' );
78
79 }
80
81 /**
82 * {@inheritDoc}
83 */
84 public function bootstrap( $container ) {
85 if ( is_admin() ) {
86 \Depicter::resolve('depicter.services.deactivation.feedback');
87 }
88 }
89
90 }
91