Done !
| Server IP : 46.105.57.169 / Your IP : 216.73.216.67 Web Server : Apache System : Linux webm002.cluster120.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 : verseaumee ( 152031) PHP Version : 8.5.7 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/verseaumee/maze/wp-content/plugins/reddit-for-woocommerce/includes/API/ |
Upload File : |
<?php
/**
* Initializes all settings-related REST controllers for the Ad Partner plugin.
*
* This class acts as the central router for registering plugin-specific REST endpoints,
* primarily under the `wc/rfw/<ad_partner>` namespace.
*
* Controllers are instantiated with their required dependencies here and hooked into the REST API lifecycle.
*
* @package RedditForWooCommerce\API\Site\Controllers
*/
namespace RedditForWooCommerce\API;
use Action_Scheduler\Migration\Controller;
use Automattic\Jetpack\Connection\Manager;
use RedditForWooCommerce\ServiceContainer;
use RedditForWooCommerce\ServiceKey;
use RedditForWooCommerce\Config;
use RedditForWooCommerce\API\Site\Controllers;
use RedditForWooCommerce\API\AdPartner\AdPartnerApi;
/**
* Bootstrap class for registering REST API routes related to plugin settings.
*
* Instantiates individual controllers and registers their routes.
*
* @since 0.1.0
*/
class SetupService {
/**
* Registers all REST API routes used in the plugin settings.
*
* This method is typically called during the `rest_api_init` hook.
*
* Example:
* ```php
* add_action( 'rest_api_init', array( new Setup(), 'register_routes' ) );
* ```
*
* @since 0.1.0
*
* @return void
*/
public function register_routes(): void {
$wcs_client = ServiceContainer::get( ServiceKey::WCS_CLIENT );
$manager = new Manager( Config::PLUGIN_SLUG );
$ad_partner_api = AdPartnerApi::get_instance( $wcs_client );
( new Controllers\JetpackAccountController( $wcs_client, $manager ) )->register_routes();
( new Controllers\OnboardingController() )->register_routes();
( new Controllers\RedditConnectionController( $wcs_client, $ad_partner_api ) )->register_routes();
( new Controllers\SettingsController() )->register_routes();
( new Controllers\CampaignController( $wcs_client, $ad_partner_api ) )->register_routes();
}
}