public static function getMainInstance()
    {
        if (null !== self::$probe) {
            return self::$probe;
        }

        if (isset($_SERVER['HTTP_X_BLACKFIRE_QUERY'])) {
            $query = $_SERVER['HTTP_X_BLACKFIRE_QUERY'];
        } elseif (isset($_SERVER['BLACKFIRE_QUERY'])) {
            $query = $_SERVER['BLACKFIRE_QUERY'];
        } else {
            $query = '';
        }

        self::$probe = new static($query);

        parse_str($query, $query);

        if (!isset($query['auto_enable']) || $query['auto_enable']) {
            if (self::$probe->isVerified()) {
                if (self::$probe->blackfireYmlAsked()) {
                    self::$probe->info('blackfire.yml asked.');

                    $config = self::$probe->getConfiguration();
                    if (null === $config) {
                        self::$probe->responseLine .= '&no-blackfire-yaml';
                    } else {
                        self::$probe->responseLine .= '&blackfire-yml-size='.strlen($config);
                    }

                    if (!headers_sent()) {
                        header('X-'.self::$probe->getResponseLine());
                    }

                    echo $config;

                    exit(0);
                }

                self::$probe->autoEnabled = self::$probe->enable();
            }
        }

        return self::$probe;
    }