File: /home/yvigantdvn/petermkufya.com/wp-content/plugins/sb-analytics/bootstrap.php
<?php
/**
* Main file which initializes the plugin.
*
* @package sb-analytics
*/
// Plugin Folder URL.
define( 'SB_ANALYTICS_PLUGIN_URL', plugin_dir_url( SB_ANALYTICS_PLUGIN_FILE ) );
define( 'SB_ANALYTICS_PLUGIN_DIR', plugin_dir_path( SB_ANALYTICS_PLUGIN_FILE ) );
require_once __DIR__ . '/constants.php';
if ( file_exists( __DIR__ . '/vendor/scoper-autoload.php' ) ) {
require_once __DIR__ . '/vendor/scoper-autoload.php';
} else {
require_once __DIR__ . '/vendor/autoload.php';
}
require_once __DIR__ . '/inc/Common/Helpers/ServerUtil.php';
require_once __DIR__ . '/inc/Common/Helpers/TemplateUtil.php';
require_once __DIR__ . '/inc/Common/Helpers/MiscUtil.php';
/**
* Plugin class.
*/
class Plugin {
/**
* Plugin constructor.
*
* @throws \DI\DependencyException Throw if dependency is not supported.
* @throws \DI\NotFoundException Not found exception.
*/
public function __construct()
{
$service = $this->get_service_container();
if(null !== $service) {
$service->register();
}
if (class_exists( 'SmashBalloon\Analytics\QA\QAManager' )) {
new SmashBalloon\Analytics\QA\QAManager();
}
}
/**
* Get service container. Load Pro service container if PRO version.
*
* @return \SmashBalloon\Analytics\Common\ServiceContainer|\SmashBalloon\Analytics\Pro\ServiceContainer|void
*/
public function get_service_container()
{
// Load Pro Service container if Pro version.
if (
defined( 'SB_ANALYTICS_NAMESPACE' )
&& SB_ANALYTICS_NAMESPACE === 'Pro'
&& class_exists( 'SmashBalloon\Analytics\Pro\ServiceContainer' )
) {
return new SmashBalloon\Analytics\Pro\ServiceContainer();
}
// Load Common Service container if Free version.
if (
defined( 'SB_ANALYTICS_NAMESPACE' )
&& SB_ANALYTICS_NAMESPACE === 'Common'
&& class_exists( 'SmashBalloon\Analytics\Common\ServiceContainer' )
) {
return new SmashBalloon\Analytics\Common\ServiceContainer();
}
}
}
new Plugin();