<?php

namespace IGD_PRO;

defined( 'ABSPATH' ) || exit;

final class Main {

	private static $instance = null;

	public function __construct() {
		$this->includes();
	}

	private function includes() {
		include_once IGD_PRO_INCLUDES . '/functions.php';
		include_once IGD_PRO_INCLUDES . '/Ajax.php';
		include_once IGD_PRO_INCLUDES . '/Hooks.php';
		include_once IGD_PRO_INCLUDES . '/Shortcode.php';
		include_once IGD_PRO_INCLUDES . '/Enqueue.php';
		include_once IGD_PRO_INCLUDES . '/Notifications.php';
		include_once IGD_PRO_INCLUDES . '/Restrictions.php';
		include_once IGD_PRO_INCLUDES . '/Proofing.php';
		include_once IGD_PRO_INCLUDES . '/Integrations.php';
		include_once IGD_PRO_INCLUDES . '/PrivateFolders.php';
		include_once IGD_PRO_INCLUDES . '/Importer.php';

		if ( igd_get_settings( 'enableStatistics' ) ) {
			include_once IGD_PRO_INCLUDES . '/Statistics.php';
		}

	}

	public static function instance() {
		if ( null === self::$instance ) {
			self::$instance = new self();
		}

		return self::$instance;
	}

}

// kickoff igd_pro
if ( ! function_exists( 'igd_pro' ) ) {
	function igd_pro() {
		return Main::instance();
	}
}

igd_pro();
