/**
  * get_instance method
  *
  * Singleton entry point to get single instance across system
  *
  * @return Ai1ec_Logging_Controller Singletonian instance
  */
 public static function get_instance()
 {
     if (!self::$_instance instanceof Ai1ec_Logging_Controller) {
         self::$_instance = new Ai1ec_Logging_Controller();
     }
     return self::$_instance;
 }
if ('admin-ajax.php' === basename($_SERVER['SCRIPT_NAME']) && isset($_REQUEST['lang'])) {
    $ai1ec_localization_helper->set_language($_REQUEST['lang']);
}
// ====================================
// = Initialize and setup CONTROLLERS =
// ====================================
global $ai1ec_app_controller, $ai1ec_settings_controller, $ai1ec_events_controller, $ai1ec_calendar_controller, $ai1ec_importer_controller, $ai1ec_exporter_controller, $ai1ec_platform_controller, $ai1ec_duplicate_controller, $ai1ec_oauth_controller, $ai1ec_logging_controller;
$ai1ec_settings_controller = Ai1ec_Settings_Controller::get_instance();
$ai1ec_events_controller = Ai1ec_Events_Controller::get_instance();
$ai1ec_calendar_controller = Ai1ec_Calendar_Controller::get_instance();
$ai1ec_importer_controller = Ai1ec_Importer_Controller::get_instance();
$ai1ec_exporter_controller = Ai1ec_Exporter_Controller::get_instance();
$ai1ec_platform_controller = Ai1ec_Platform_Controller::get_instance();
$ai1ec_duplicate_controller = Ai1ec_Duplicate_Controller::get_instance();
$ai1ec_oauth_controller = Ai1ec_Oauth_Controller::get_instance();
$ai1ec_logging_controller = Ai1ec_Logging_Controller::get_instance();
// Initialize other global classes
global $ai1ec_requirejs_controller, $ai1ec_rss_feed, $ai1ec_tax_meta_class;
// Create the instance of the class that handles javascript loading
$ai1ec_requirejs_controller = new Ai1ec_Requirejs_Controller();
// Inject settings
$ai1ec_requirejs_controller->set_settings($ai1ec_settings);
// Inject calendar controller
$ai1ec_requirejs_controller->set_events_helper($ai1ec_events_helper);
// Se the themes controller
$ai1ec_requirejs_controller->set_ai1ec_themes_controller($ai1ec_themes_controller);
// ==================================
// = Add the hook to render the js  =
// ==================================
if (isset($_GET[Ai1ec_Requirejs_Controller::WEB_WIDGET_GET_PARAMETER])) {
    add_action('template_redirect', array($ai1ec_requirejs_controller, 'render_web_widget'), 20);