HEX
Server: Apache
System: Linux webd003.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: slyfwmm (169339)
PHP: 8.1.34
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/slyfwmm/laretediclo/wp-content/plugins/pods/src/Pods/CLI/Service_Provider.php
<?php

namespace Pods\CLI;

use Pods\CLI\Commands\Field;
use Pods\CLI\Commands\Group;
use Pods\CLI\Commands\Playbook;
use Pods\CLI\Commands\Pod;
use Pods\CLI\Commands\Tools;
use WP_CLI;

/**
 * Class Service_Provider
 *
 * Add CLI commands and objects.
 *
 * @since 2.8.0
 */
class Service_Provider extends \Pods\Service_Provider_Base {

	/**
	 * Binds and sets up implementations.
	 */
	public $namespace;

	/**
	 * Registers the classes and functionality needed for CLI.
	 *
	 * @since 2.8.0
	 */
	public function register() {
		$this->container->singleton( 'pods.cli.commands.pods.pod', Pod::class, [ 'hook' ] );
		$this->container->singleton( 'pods.cli.commands.pods.group', Group::class, [ 'hook' ] );
		$this->container->singleton( 'pods.cli.commands.pods.field', Field::class, [ 'hook' ] );

		$this->hooks();
	}

	/**
	 * Hooks all the methods and actions the class needs.
	 *
	 * @since 2.8.0
	 */
	protected function hooks() {
		// Add dynamic commands.
		pods_container( 'pods.cli.commands.pods.pod' );
		pods_container( 'pods.cli.commands.pods.group' );
		pods_container( 'pods.cli.commands.pods.field' );

		// Add static commands.
		if ( defined( 'WP_CLI' ) ) {
			WP_CLI::add_command( 'pods playbook', Playbook::class );
			WP_CLI::add_command( 'pods tools', Tools::class );
		}
	}
}