Telemetry::boot()

Gentlefolk, start your engines.


Return

(void)


Top ↑

Source

File: src/Common/Telemetry/Telemetry.php

	public function boot(): void {
		/**
		 * Configure the container.
		 *
		 * The container must be compatible with stellarwp/container-contract.
		 * See here: https://github.com/stellarwp/container-contract#usage.
		 *
		 * If you do not have a container, we recommend https://github.com/lucatume/di52
		 * and the corresponding wrapper:
		 * https://github.com/stellarwp/container-contract/blob/main/examples/di52/Container.php
		 */
		$container = Container::init();

		Config::set_container( $container );

		static::clean_up();

		self::$tec_slugs    = self::get_tec_telemetry_slugs();
		self::$plugin_slug  = self::get_parent_plugin_slug();
		self::$plugin_path  = \Tribe__Main::instance()->get_parent_plugin_file_path();
		$stellar_slug = self::get_stellar_slug();

		if ( empty( $stellar_slug ) ) {
			return;
		}

		$telemetry_server   = ! defined( 'STELLARWP_TELEMETRY_SERVER' ) ? 'https://telemetry.stellarwp.com/api/v1': STELLARWP_TELEMETRY_SERVER;

		Config::set_server_url( $telemetry_server );

		// Set a unique prefix for actions & filters.
		Config::set_hook_prefix( self::$hook_prefix );

		// Set a unique plugin slug.
		Config::set_stellar_slug( $stellar_slug );

		if ( empty( self::$plugin_path ) ) {
			return;
		}

		// Initialize the library.
		Core::instance()->init( self::$plugin_path );

		/**
		 * Allow plugins to hook in and add themselves,
		 * running their own actions once Telemetry is initiated,
		 *  but before we register all our plugins.
		 *
		 * @since 5.1.0
		 *
		 * @param self $telemetry The Telemetry instance.
		 */
		do_action( 'tec_common_telemetry_preload', $this );
	}

Top ↑

Changelog

Changelog
Version Description
5.1.0 Introduced.