PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / trunk
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution vtrunk
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / Lock / Provider.php

Provider.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution trunk, at src/Performance/Lock/Provider.php

38 lines 915 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The Service Provider for atomic locking.
4 *
5 * @package SolidWP\Performance
6 */
7
8 declare( strict_types=1 );
9
10 namespace SolidWP\Performance\Lock;
11
12 use SolidWP\Performance\Contracts\Service_Provider;
13 use SolidWP\Performance\Lock\Contracts\Blockable_Lock;
14 use SolidWP\Performance\Lock\Drivers\Database_Driver;
15 use SolidWP\Performance\Lock\Tables\Cache_Lock;
16
17 /**
18 * The Service Provider for atomic locking.
19 *
20 * @package SolidWP\Performance
21 */
22 final class Provider extends Service_Provider {
23
24 /**
25 * @inheritDoc
26 */
27 public function register(): void {
28 $this->container->when( Database_Driver::class )
29 ->needs( '$table' )
30 ->give( fn(): string => Cache_Lock::table_name( false ) );
31
32 // Set up the Lock Driver.
33 $this->container->bind( Contracts\Lock::class, Database_Driver::class );
34 // Set up the Lock Decorator.
35 $this->container->bind( Blockable_Lock::class, Lock::class );
36 }
37 }
38