PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 2.8.23.4
Pods – Custom Content Types and Fields v2.8.23.4
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / src / Pods / CLI / Service_Provider.php
pods / src / Pods / CLI Last commit date
Commands 2 weeks ago Service_Provider.php 2 weeks ago
Service_Provider.php
55 lines
1 <?php
2
3 namespace Pods\CLI;
4
5 use Pods\CLI\Commands\Field;
6 use Pods\CLI\Commands\Group;
7 use Pods\CLI\Commands\Playbook;
8 use Pods\CLI\Commands\Pod;
9 use WP_CLI;
10
11 /**
12 * Class Service_Provider
13 *
14 * Add CLI commands and objects.
15 *
16 * @since 2.8.0
17 */
18 class Service_Provider extends \tad_DI52_ServiceProvider {
19
20 /**
21 * Binds and sets up implementations.
22 */
23 public $namespace;
24
25 /**
26 * Registers the classes and functionality needed for CLI.
27 *
28 * @since 2.8.0
29 */
30 public function register() {
31 $this->container->singleton( 'pods.cli.commands.pods.pod', Pod::class, [ 'hook' ] );
32 $this->container->singleton( 'pods.cli.commands.pods.group', Group::class, [ 'hook' ] );
33 $this->container->singleton( 'pods.cli.commands.pods.field', Field::class, [ 'hook' ] );
34
35 $this->hooks();
36 }
37
38 /**
39 * Hooks all the methods and actions the class needs.
40 *
41 * @since 2.8.0
42 */
43 protected function hooks() {
44 // Add dynamic commands.
45 pods_container( 'pods.cli.commands.pods.pod' );
46 pods_container( 'pods.cli.commands.pods.group' );
47 pods_container( 'pods.cli.commands.pods.field' );
48
49 // Add static commands.
50 if ( defined( 'WP_CLI' ) ) {
51 WP_CLI::add_command( 'pods playbook', Playbook::class );
52 }
53 }
54 }
55