public static function register(QueryPanel $queryPanel, NDB\Connection $connection)
 {
     /**
      * @param NDB\ResultSet|NDB\DriverException $result
      */
     $connection->onQuery[] = function ($_, $result) use($queryPanel) {
         if ($result instanceof NDB\ResultSet) {
             $queryPanel->addQuery(new static($result));
         }
     };
 }
 public static function register(Elasticsearch $es, QueryPanel $panel)
 {
     $request = NULL;
     $es->onEvent[] = function ($message, $content) use($panel, &$request) {
         if ($message === 'Request Body') {
             $request = $content[0];
             return;
         }
         if ($request && $message === 'Response') {
             $panel->addQuery(new static($request, $content[0]));
             $request = NULL;
         }
     };
 }
 public static function register(QueryPanel $queryPanel, $query, $bindings, $time, $name)
 {
     $queryPanel->addQuery(new static($query, $bindings, $time, $name));
 }
Пример #4
0
 public static function register(DibiConnection $dibi, QueryPanel $panel)
 {
     $dibi->onEvent[] = function (DibiEvent $event) use($panel) {
         $panel->addQuery(new static($event));
     };
 }