getContainer()->get( 'options' ); // Sucuri Addon. $this->getContainer()->share( 'sucuri_subscriber', SucuriSubscriber::class ) ->addArgument( $options ) ->addTag( 'common_subscriber' ); // Cloudflare Addon. $this->addon_cloudflare( $options ); } /** * Adds Cloudflare Addon into the Container when the addon is enabled. * * @since 3.5 * * @param Options_Data $options Instance of options. */ protected function addon_cloudflare( Options_Data $options ) { // If the option is not enabled, bail out. Don't load the addon. if ( ! (bool) $options->get( 'do_cloudflare', false ) ) { return; } $this->provides[] = 'cloudflare_subscriber'; $this->getContainer()->add( 'cloudflare_api', APIClient::class ) ->addArgument( rocket_get_constant( 'WP_ROCKET_VERSION' ) ); $this->getContainer()->add( 'cloudflare', Cloudflare::class ) ->addArgument( $options ) ->addArgument( $this->getContainer()->get( 'cloudflare_api' ) ); $this->getContainer()->share( 'cloudflare_subscriber', CloudflareSubscriber::class ) ->addArgument( $this->getContainer()->get( 'cloudflare' ) ) ->addArgument( $options ) ->addArgument( $this->getContainer()->get( 'options_api' ) ) ->addTag( 'cloudflare_subscriber' ); } }