@@ 405-411 (lines=7) @@ | ||
402 | . pack('VV', $p['offset'], -1) |
|
403 | . bson_encode($o) |
|
404 | . (isset($p['fields']) ? bson_encode($p['fields']) : '') |
|
405 | , true, null, function($conn, $reqId = null) use ($p, $cb) { |
|
406 | if (!$conn) { |
|
407 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
408 | return; |
|
409 | } |
|
410 | $conn->requests[$reqId] = [$p['col'], $cb, true]; |
|
411 | }); |
|
412 | } catch (\MongoException $e) { |
|
413 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
414 | if ($cb !== null) { |
|
@@ 482-488 (lines=7) @@ | ||
479 | . $e[0] . '.$cmd' . "\x00" |
|
480 | . pack('VV', $p['offset'], $p['limit']) |
|
481 | . bson_encode($query) |
|
482 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
483 | if (!$conn) { |
|
484 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
485 | return; |
|
486 | } |
|
487 | $conn->requests[$reqId] = [$p['col'], $cb, true]; |
|
488 | }); |
|
489 | } catch (\MongoException $e) { |
|
490 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
491 | if ($cb !== null) { |
|
@@ 523-529 (lines=7) @@ | ||
520 | . $p['dbname'] . '.$cmd' . "\x00" |
|
521 | . pack('VV', 0, -1) |
|
522 | . bson_encode($query) |
|
523 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
524 | if (!$conn) { |
|
525 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
526 | return; |
|
527 | } |
|
528 | $conn->requests[$reqId] = [$p['dbname'], $cb, true]; |
|
529 | }); |
|
530 | } catch (\MongoException $e) { |
|
531 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
532 | if ($cb !== null) { |
|
@@ 559-565 (lines=7) @@ | ||
556 | . $p['dbname'] . '.$cmd' . "\x00" |
|
557 | . pack('VV', 0, -1) |
|
558 | . bson_encode($query) |
|
559 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
560 | if (!$conn) { |
|
561 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
562 | return; |
|
563 | } |
|
564 | $conn->requests[$reqId] = [$p['dbname'], $cb, true]; |
|
565 | }); |
|
566 | } catch (\MongoException $e) { |
|
567 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
568 | if ($cb !== null) { |
|
@@ 642-648 (lines=7) @@ | ||
639 | . $e[0] . '.$cmd' . "\x00" |
|
640 | . pack('VV', 0, -1) |
|
641 | . bson_encode($params) |
|
642 | , true, $conn, function ($conn, $reqId = null) use ($db, $cb) { |
|
643 | if (!$conn) { |
|
644 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
645 | return; |
|
646 | } |
|
647 | $conn->requests[$reqId] = [$db, $cb, true]; |
|
648 | }); |
|
649 | } catch (\MongoException $e) { |
|
650 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
651 | if ($cb !== null) { |
|
@@ 726-732 (lines=7) @@ | ||
723 | . $e[0] . '.$cmd' . "\x00" |
|
724 | . pack('VV', $p['offset'], $p['limit']) |
|
725 | . bson_encode($query) |
|
726 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
727 | if (!$conn) { |
|
728 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
729 | return; |
|
730 | } |
|
731 | $conn->requests[$reqId] = [$p['col'], $cb, true]; |
|
732 | }); |
|
733 | } catch (\MongoException $e) { |
|
734 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
735 | if ($cb !== null) { |
|
@@ 773-779 (lines=7) @@ | ||
770 | . $p['db'] . '.$cmd' . "\x00" |
|
771 | . pack('VV', $p['offset'], $p['limit']) |
|
772 | . bson_encode(['$eval' => new \MongoCode($code)]) |
|
773 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
774 | if (!$conn) { |
|
775 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
776 | return; |
|
777 | } |
|
778 | $conn->requests[$reqId] = [$p['db'], $cb, true]; |
|
779 | }); |
|
780 | } catch (\MongoException $e) { |
|
781 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
782 | if ($cb !== null) { |
|
@@ 820-826 (lines=7) @@ | ||
817 | . $e[0] . '.$cmd' . "\x00" |
|
818 | . pack('VV', $p['offset'], $p['limit']) |
|
819 | . bson_encode($query) |
|
820 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
821 | if (!$conn) { |
|
822 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
823 | return; |
|
824 | } |
|
825 | $conn->requests[$reqId] = [$p['col'], $cb, true]; |
|
826 | }); |
|
827 | } |
|
828 | ||
829 | /** |
|
@@ 950-956 (lines=7) @@ | ||
947 | . $e[0] . '.$cmd' . "\x00" |
|
948 | . pack('VV', $p['offset'], $p['limit']) |
|
949 | . bson_encode($query) |
|
950 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
951 | if (!$conn) { |
|
952 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
953 | return; |
|
954 | } |
|
955 | $conn->requests[$reqId] = [$p['col'], $cb, true]; |
|
956 | }); |
|
957 | } catch (\MongoException $e) { |
|
958 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
959 | if ($cb !== null) { |
|
@@ 1017-1023 (lines=7) @@ | ||
1014 | . $e[0] . '.$cmd' . "\x00" |
|
1015 | . pack('VV', $p['offset'], $p['limit']) |
|
1016 | . bson_encode($query) |
|
1017 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
1018 | if (!$conn) { |
|
1019 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
1020 | return; |
|
1021 | } |
|
1022 | $conn->requests[$reqId] = [$p['col'], $cb, false]; |
|
1023 | }); |
|
1024 | } catch (\MongoException $e) { |
|
1025 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
1026 | if ($cb !== null) { |
|
@@ 1062-1068 (lines=7) @@ | ||
1059 | . $e[0] . '.$cmd' . "\x00" |
|
1060 | . pack('VV', $p['offset'], $p['limit']) |
|
1061 | . bson_encode($query) |
|
1062 | . (isset($p['fields']) ? bson_encode($p['fields']) : ''), true, null, function ($conn, $reqId = null) use ($p, $cb) { |
|
1063 | if (!$conn) { |
|
1064 | !$cb || call_user_func($cb, ['$err' => 'Connection error.']); |
|
1065 | return; |
|
1066 | } |
|
1067 | $conn->requests[$reqId] = [$p['col'], $cb, false]; |
|
1068 | }); |
|
1069 | } catch (\MongoException $e) { |
|
1070 | Daemon::log('MongoClient exception: '.$e->getMessage().': '.$e->getTraceAsString()); |
|
1071 | if ($cb !== null) { |