Completed
Push — master ( 126d50...ddbd68 )
by Peter
03:24
created
src/functions.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
     assert(is_numeric($value));
39 39
 
40 40
     // x64
41
-    if (PHP_INT_SIZE >= 8) {
41
+    if (PHP_INT_SIZE>=8) {
42 42
         $value = (int)$value;
43 43
         return pack('NN', $value >> 32, $value & 0xFFFFFFFF);
44 44
     }
45 45
 
46 46
     // x32, int
47 47
     if (is_int($value)) {
48
-        return pack('NN', $value < 0 ? -1 : 0, $value);
48
+        return pack('NN', $value<0 ? -1 : 0, $value);
49 49
     }
50 50
 
51 51
     // x32, bcmath
52 52
     if (function_exists('bcmul')) {
53
-        if (bccomp($value, 0) == -1) {
53
+        if (bccomp($value, 0)==-1) {
54 54
             $value = bcadd('18446744073709551616', $value);
55 55
         }
56 56
         $h = bcdiv($value, '4294967296', 0);
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
     $l = $m - ($q * 4294967296.0);
69 69
     $h = $hi * 2328.0 + $q; // (10 ^ 13) / (1 << 32) = 2328
70 70
 
71
-    if ($value < 0) {
72
-        if ($l == 0) {
71
+    if ($value<0) {
72
+        if ($l==0) {
73 73
             $h = 4294967296.0 - $h;
74 74
         } else {
75 75
             $h = 4294967295.0 - $h;
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
     assert(is_numeric($value));
92 92
 
93 93
     // x64
94
-    if (PHP_INT_SIZE >= 8) {
95
-        assert($value >= 0);
94
+    if (PHP_INT_SIZE>=8) {
95
+        assert($value>=0);
96 96
 
97 97
         // x64, int
98 98
         if (is_int($value)) {
@@ -154,16 +154,16 @@  discard block
 block discarded – undo
154 154
 {
155 155
     list($hi, $lo) = array_values(unpack('N*N*', $value));
156 156
 
157
-    if (PHP_INT_SIZE >= 8) {
158
-        if ($hi < 0) { // because php 5.2.2 to 5.2.5 is totally fucked up again
157
+    if (PHP_INT_SIZE>=8) {
158
+        if ($hi<0) { // because php 5.2.2 to 5.2.5 is totally fucked up again
159 159
             $hi += 1 << 32;
160 160
         }
161
-        if ($lo < 0) {
161
+        if ($lo<0) {
162 162
             $lo += 1 << 32;
163 163
         }
164 164
 
165 165
         // x64, int
166
-        if ($hi <= 2147483647) {
166
+        if ($hi<=2147483647) {
167 167
             return ($hi << 32) + $lo;
168 168
         }
169 169
 
@@ -176,20 +176,20 @@  discard block
 block discarded – undo
176 176
         $C = 100000;
177 177
         $h = ((int)($hi / $C) << 32) + (int)($lo / $C);
178 178
         $l = (($hi % $C) << 32) + ($lo % $C);
179
-        if ($l > $C) {
179
+        if ($l>$C) {
180 180
             $h += (int)($l / $C);
181 181
             $l  = $l % $C;
182 182
         }
183 183
 
184
-        if ($h == 0) {
184
+        if ($h==0) {
185 185
             return $l;
186 186
         }
187 187
         return sprintf('%d%05d', $h, $l);
188 188
     }
189 189
 
190 190
     // x32, int
191
-    if ($hi == 0) {
192
-        if ($lo > 0) {
191
+    if ($hi==0) {
192
+        if ($lo>0) {
193 193
             return $lo;
194 194
         }
195 195
         return sprintf('%u', $lo);
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
 
217 217
     $h = sprintf('%.0f', $h);
218 218
     $l = sprintf('%07.0f', $l);
219
-    if ($h == '0') {
219
+    if ($h=='0') {
220 220
         return sprintf('%.0f', (float)$l);
221 221
     }
222
-    return $h . $l;
222
+    return $h.$l;
223 223
 }
224 224
 
225 225
 /**
@@ -234,24 +234,24 @@  discard block
 block discarded – undo
234 234
     list($hi, $lo) = array_values(unpack('N*N*', $value));
235 235
 
236 236
     // x64
237
-    if (PHP_INT_SIZE >= 8) {
238
-        if ($hi < 0) { // because php 5.2.2 to 5.2.5 is totally fucked up again
237
+    if (PHP_INT_SIZE>=8) {
238
+        if ($hi<0) { // because php 5.2.2 to 5.2.5 is totally fucked up again
239 239
             $hi += 1 << 32;
240 240
         }
241
-        if ($lo < 0) {
241
+        if ($lo<0) {
242 242
             $lo += 1 << 32;
243 243
         }
244 244
 
245 245
         return ($hi << 32) + $lo;
246 246
     }
247 247
 
248
-    if ($hi == 0) { // x32, int
249
-        if ($lo > 0) {
248
+    if ($hi==0) { // x32, int
249
+        if ($lo>0) {
250 250
             return $lo;
251 251
         }
252 252
         return sprintf('%u', $lo);
253
-    } elseif ($hi == -1) { // x32, int
254
-        if ($lo < 0) {
253
+    } elseif ($hi==-1) { // x32, int
254
+        if ($lo<0) {
255 255
             return $lo;
256 256
         }
257 257
         return sprintf('%.0f', $lo - 4294967296.0);
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
     $neg = '';
261 261
     $c = 0;
262
-    if ($hi < 0) {
262
+    if ($hi<0) {
263 263
         $hi = ~$hi;
264 264
         $lo = ~$lo;
265 265
         $c = 1;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
     // x32, bcmath
273 273
     if (function_exists('bcmul')) {
274
-        return $neg . bcadd(bcadd($lo, bcmul($hi, '4294967296')), $c);
274
+        return $neg.bcadd(bcadd($lo, bcmul($hi, '4294967296')), $c);
275 275
     }
276 276
 
277 277
     // x32, no-bcmath
@@ -284,17 +284,17 @@  discard block
 block discarded – undo
284 284
     $mq = floor($m / 10000000.0);
285 285
     $l = $m - $mq * 10000000.0 + $c;
286 286
     $h = $q * 4294967296.0 + $r * 429.0 + $mq;
287
-    if ($l == 10000000) {
287
+    if ($l==10000000) {
288 288
         $l = 0;
289 289
         $h += 1;
290 290
     }
291 291
 
292 292
     $h = sprintf('%.0f', $h);
293 293
     $l = sprintf('%07.0f', $l);
294
-    if ($h == '0') {
295
-        return $neg . sprintf('%.0f', (float)$l);
294
+    if ($h=='0') {
295
+        return $neg.sprintf('%.0f', (float)$l);
296 296
     }
297
-    return $neg . $h . $l;
297
+    return $neg.$h.$l;
298 298
 }
299 299
 
300 300
 /**
@@ -304,9 +304,9 @@  discard block
 block discarded – undo
304 304
  */
305 305
 function sphFixUint($value)
306 306
 {
307
-    if (PHP_INT_SIZE >= 8) {
307
+    if (PHP_INT_SIZE>=8) {
308 308
         // x64 route, workaround broken unpack() in 5.2.2+
309
-        if ($value < 0) {
309
+        if ($value<0) {
310 310
             $value += 1 << 32;
311 311
         }
312 312
         return $value;
Please login to merge, or discard this patch.
src/SphinxClient.php 1 patch
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
     public function __destruct()
416 416
     {
417
-        if ($this->socket !== false) {
417
+        if ($this->socket!==false) {
418 418
             fclose($this->socket);
419 419
         }
420 420
     }
@@ -454,19 +454,19 @@  discard block
 block discarded – undo
454 454
     public function setServer($host, $port = 0)
455 455
     {
456 456
         assert(is_string($host));
457
-        if ($host[0] == '/') {
458
-            $this->path = 'unix://' . $host;
457
+        if ($host[0]=='/') {
458
+            $this->path = 'unix://'.$host;
459 459
             return;
460 460
         }
461
-        if (substr($host, 0, 7) == 'unix://') {
461
+        if (substr($host, 0, 7)=='unix://') {
462 462
             $this->path = $host;
463 463
             return;
464 464
         }
465 465
 
466 466
         $this->host = $host;
467 467
         $port = intval($port);
468
-        assert(0 <= $port && $port < 65536);
469
-        $this->port = $port == 0 ? 9312 : $port;
468
+        assert(0<=$port && $port<65536);
469
+        $this->port = $port==0 ? 9312 : $port;
470 470
         $this->path = '';
471 471
     }
472 472
 
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
      */
491 491
     protected function send($handle, $data, $length)
492 492
     {
493
-        if (feof($handle) || fwrite($handle, $data, $length) !== $length) {
493
+        if (feof($handle) || fwrite($handle, $data, $length)!==$length) {
494 494
             $this->error = 'connection unexpectedly closed (timed out?)';
495 495
             $this->conn_error = true;
496 496
             return false;
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
      */
530 530
     protected function connect()
531 531
     {
532
-        if ($this->socket !== false) {
532
+        if ($this->socket!==false) {
533 533
             // we are in persistent connection mode, so we have a socket
534 534
             // however, need to check whether it's still alive
535 535
             if (!@feof($this->socket)) {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             $port = $this->port;
553 553
         }
554 554
 
555
-        if ($this->timeout <= 0) {
555
+        if ($this->timeout<=0) {
556 556
             $fp = @fsockopen($host, $port, $errno, $errstr);
557 557
         } else {
558 558
             $fp = @fsockopen($host, $port, $errno, $errstr, $this->timeout);
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         // check version
585 585
         list(, $v) = unpack('N*', fread($fp, 4));
586 586
         $v = (int)$v;
587
-        if ($v < 1) {
587
+        if ($v<1) {
588 588
             fclose($fp);
589 589
             $this->error = "expected searchd protocol version 1+, got version '$v'";
590 590
             return false;
@@ -607,10 +607,10 @@  discard block
 block discarded – undo
607 607
         $len = 0;
608 608
 
609 609
         $header = fread($fp, 8);
610
-        if (strlen($header) == 8) {
610
+        if (strlen($header)==8) {
611 611
             list($status, $ver, $len) = array_values(unpack('n2a/Nb', $header));
612 612
             $left = $len;
613
-            while ($left > 0 && !feof($fp)) {
613
+            while ($left>0 && !feof($fp)) {
614 614
                 $chunk = fread($fp, min(8192, $left));
615 615
                 if ($chunk) {
616 616
                     $response .= $chunk;
@@ -619,13 +619,13 @@  discard block
 block discarded – undo
619 619
             }
620 620
         }
621 621
 
622
-        if ($this->socket === false) {
622
+        if ($this->socket===false) {
623 623
             fclose($fp);
624 624
         }
625 625
 
626 626
         // check response
627 627
         $read = strlen($response);
628
-        if (!$response || $read != $len) {
628
+        if (!$response || $read!=$len) {
629 629
             $this->error = $len
630 630
                 ? "failed to read searchd response (status=$status, ver=$ver, len=$len, read=$read)"
631 631
                 : 'received zero-sized searchd response';
@@ -633,26 +633,26 @@  discard block
 block discarded – undo
633 633
         }
634 634
 
635 635
         // check status
636
-        if ($status == self::SEARCHD_WARNING) {
636
+        if ($status==self::SEARCHD_WARNING) {
637 637
             list(, $wlen) = unpack('N*', substr($response, 0, 4));
638 638
             $this->warning = substr($response, 4, $wlen);
639 639
             return substr($response, 4 + $wlen);
640 640
         }
641
-        if ($status == self::SEARCHD_ERROR) {
642
-            $this->error = 'searchd error: ' . substr($response, 4);
641
+        if ($status==self::SEARCHD_ERROR) {
642
+            $this->error = 'searchd error: '.substr($response, 4);
643 643
             return false;
644 644
         }
645
-        if ($status == self::SEARCHD_RETRY) {
646
-            $this->error = 'temporary searchd error: ' . substr($response, 4);
645
+        if ($status==self::SEARCHD_RETRY) {
646
+            $this->error = 'temporary searchd error: '.substr($response, 4);
647 647
             return false;
648 648
         }
649
-        if ($status != self::SEARCHD_OK) {
649
+        if ($status!=self::SEARCHD_OK) {
650 650
             $this->error = "unknown status code '$status'";
651 651
             return false;
652 652
         }
653 653
 
654 654
         // check version
655
-        if ($ver < $client_ver) {
655
+        if ($ver<$client_ver) {
656 656
             $this->warning = sprintf(
657 657
                 'searchd command v.%d.%d older than client\'s v.%d.%d, some options might not work',
658 658
                 $ver >> 8,
@@ -681,15 +681,15 @@  discard block
 block discarded – undo
681 681
     {
682 682
         assert(is_int($offset));
683 683
         assert(is_int($limit));
684
-        assert($offset >= 0);
685
-        assert($limit > 0);
686
-        assert($max >= 0);
684
+        assert($offset>=0);
685
+        assert($limit>0);
686
+        assert($max>=0);
687 687
         $this->offset = $offset;
688 688
         $this->limit = $limit;
689
-        if ($max > 0) {
689
+        if ($max>0) {
690 690
             $this->max_matches = $max;
691 691
         }
692
-        if ($cutoff > 0) {
692
+        if ($cutoff>0) {
693 693
             $this->cutoff = $cutoff;
694 694
         }
695 695
     }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
     public function setMaxQueryTime($max)
703 703
     {
704 704
         assert(is_int($max));
705
-        assert($max >= 0);
705
+        assert($max>=0);
706 706
         $this->max_query_time = $max;
707 707
     }
708 708
 
@@ -735,9 +735,9 @@  discard block
 block discarded – undo
735 735
      * @param int $ranker
736 736
      * @param string $rank_expr
737 737
      */
738
-    public function setRankingMode($ranker, $rank_expr='')
738
+    public function setRankingMode($ranker, $rank_expr = '')
739 739
     {
740
-        assert($ranker === 0 || $ranker >= 1 && $ranker < self::RANK_TOTAL);
740
+        assert($ranker===0 || $ranker>=1 && $ranker<self::RANK_TOTAL);
741 741
         assert(is_string($rank_expr));
742 742
         $this->ranker = $ranker;
743 743
         $this->rank_expr = $rank_expr;
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             self::SORT_EXPR
761 761
         )));
762 762
         assert(is_string($sort_by));
763
-        assert($mode == self::SORT_RELEVANCE || strlen($sort_by) > 0);
763
+        assert($mode==self::SORT_RELEVANCE || strlen($sort_by)>0);
764 764
 
765 765
         $this->sort = $mode;
766 766
         $this->sort_by = $sort_by;
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
     {
815 815
         assert(is_numeric($min));
816 816
         assert(is_numeric($max));
817
-        assert($min <= $max);
817
+        assert($min<=$max);
818 818
 
819 819
         $this->min_id = $min;
820 820
         $this->max_id = $max;
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
         assert(is_string($attribute));
879 879
         assert(is_numeric($min));
880 880
         assert(is_numeric($max));
881
-        assert($min <= $max);
881
+        assert($min<=$max);
882 882
 
883 883
         $this->filters[] = array(
884 884
             'type' => self::FILTER_RANGE,
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
         assert(is_string($attribute));
904 904
         assert(is_float($min));
905 905
         assert(is_float($max));
906
-        assert($min <= $max);
906
+        assert($min<=$max);
907 907
 
908 908
         $this->filters[] = array(
909 909
             'type' => self::FILTER_FLOAT_RANGE,
@@ -983,8 +983,8 @@  discard block
 block discarded – undo
983 983
      */
984 984
     public function setRetries($count, $delay = 0)
985 985
     {
986
-        assert(is_int($count) && $count >= 0);
987
-        assert(is_int($delay) && $delay >= 0);
986
+        assert(is_int($count) && $count>=0);
987
+        assert(is_int($delay) && $delay>=0);
988 988
         $this->retry_count = $count;
989 989
         $this->retry_delay = $delay;
990 990
     }
@@ -1060,12 +1060,12 @@  discard block
 block discarded – undo
1060 1060
             'global_idf',
1061 1061
             'low_priority'
1062 1062
         );
1063
-        $flags = array (
1063
+        $flags = array(
1064 1064
             'reverse_scan' => array(0, 1),
1065 1065
             'sort_method' => array('pq', 'kbuffer'),
1066 1066
             'max_predicted_time' => array(0),
1067 1067
             'boolean_simplify' => array(true, false),
1068
-            'idf' => array ('normalized', 'plain', 'tfidf_normalized', 'tfidf_unnormalized'),
1068
+            'idf' => array('normalized', 'plain', 'tfidf_normalized', 'tfidf_unnormalized'),
1069 1069
             'global_idf' => array(true, false),
1070 1070
             'low_priority' => array(true, false)
1071 1071
         );
@@ -1073,29 +1073,29 @@  discard block
 block discarded – undo
1073 1073
         assert(isset($flag_name, $known_names));
1074 1074
         assert(
1075 1075
             in_array($flag_value, $flags[$flag_name], true) ||
1076
-            ($flag_name == 'max_predicted_time' && is_int($flag_value) && $flag_value >= 0)
1076
+            ($flag_name=='max_predicted_time' && is_int($flag_value) && $flag_value>=0)
1077 1077
         );
1078 1078
 
1079 1079
         switch ($flag_name) {
1080 1080
             case 'reverse_scan':
1081
-                $this->query_flags = sphSetBit($this->query_flags, 0, $flag_value == 1);
1081
+                $this->query_flags = sphSetBit($this->query_flags, 0, $flag_value==1);
1082 1082
                 break;
1083 1083
             case 'sort_method':
1084
-                $this->query_flags = sphSetBit($this->query_flags, 1, $flag_value == 'kbuffer');
1084
+                $this->query_flags = sphSetBit($this->query_flags, 1, $flag_value=='kbuffer');
1085 1085
                 break;
1086 1086
             case 'max_predicted_time':
1087
-                $this->query_flags = sphSetBit($this->query_flags, 2, $flag_value > 0);
1087
+                $this->query_flags = sphSetBit($this->query_flags, 2, $flag_value>0);
1088 1088
                 $this->predicted_time = (int)$flag_value;
1089 1089
                 break;
1090 1090
             case 'boolean_simplify':
1091 1091
                 $this->query_flags = sphSetBit($this->query_flags, 3, $flag_value);
1092 1092
                 break;
1093 1093
             case 'idf':
1094
-                if ($flag_value == 'normalized' || $flag_value == 'plain') {
1095
-                    $this->query_flags = sphSetBit($this->query_flags, 4, $flag_value == 'plain');
1094
+                if ($flag_value=='normalized' || $flag_value=='plain') {
1095
+                    $this->query_flags = sphSetBit($this->query_flags, 4, $flag_value=='plain');
1096 1096
                 }
1097
-                if ($flag_value == 'tfidf_normalized' || $flag_value == 'tfidf_unnormalized') {
1098
-                    $this->query_flags = sphSetBit($this->query_flags, 6, $flag_value == 'tfidf_normalized');
1097
+                if ($flag_value=='tfidf_normalized' || $flag_value=='tfidf_unnormalized') {
1098
+                    $this->query_flags = sphSetBit($this->query_flags, 6, $flag_value=='tfidf_normalized');
1099 1099
                 }
1100 1100
                 break;
1101 1101
             case 'global_idf':
@@ -1119,8 +1119,8 @@  discard block
 block discarded – undo
1119 1119
         assert(is_string($order_by));
1120 1120
         assert(is_int($offset));
1121 1121
         assert(is_int($limit));
1122
-        assert($offset >= 0);
1123
-        assert($limit > 0);
1122
+        assert($offset>=0);
1123
+        assert($limit>0);
1124 1124
 
1125 1125
         $this->outer_order_by = $order_by;
1126 1126
         $this->outer_offset = $offset;
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
         $this->error = $results[0]['error'];
1200 1200
         $this->warning = $results[0]['warning'];
1201 1201
 
1202
-        if ($results[0]['status'] == self::SEARCHD_ERROR) {
1202
+        if ($results[0]['status']==self::SEARCHD_ERROR) {
1203 1203
             return false;
1204 1204
         } else {
1205 1205
             return $results[0];
@@ -1237,24 +1237,24 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
         // build request
1239 1239
         $req = pack('NNNNN', $this->query_flags, $this->offset, $this->limit, $this->mode, $this->ranker);
1240
-        if ($this->ranker == self::RANK_EXPR) {
1241
-            $req .= pack('N', strlen($this->rank_expr)) . $this->rank_expr;
1240
+        if ($this->ranker==self::RANK_EXPR) {
1241
+            $req .= pack('N', strlen($this->rank_expr)).$this->rank_expr;
1242 1242
         }
1243 1243
         $req .= pack('N', $this->sort); // (deprecated) sort mode
1244
-        $req .= pack('N', strlen($this->sort_by)) . $this->sort_by;
1245
-        $req .= pack('N', strlen($query)) . $query; // query itself
1244
+        $req .= pack('N', strlen($this->sort_by)).$this->sort_by;
1245
+        $req .= pack('N', strlen($query)).$query; // query itself
1246 1246
         $req .= pack('N', count($this->weights)); // weights
1247 1247
         foreach ($this->weights as $weight) {
1248 1248
             $req .= pack('N', (int)$weight);
1249 1249
         }
1250
-        $req .= pack('N', strlen($index)) . $index; // indexes
1250
+        $req .= pack('N', strlen($index)).$index; // indexes
1251 1251
         $req .= pack('N', 1); // id64 range marker
1252
-        $req .= sphPackU64($this->min_id) . sphPackU64($this->max_id); // id64 range
1252
+        $req .= sphPackU64($this->min_id).sphPackU64($this->max_id); // id64 range
1253 1253
 
1254 1254
         // filters
1255 1255
         $req .= pack('N', count($this->filters));
1256 1256
         foreach ($this->filters as $filter) {
1257
-            $req .= pack('N', strlen($filter['attr'])) . $filter['attr'];
1257
+            $req .= pack('N', strlen($filter['attr'])).$filter['attr'];
1258 1258
             $req .= pack('N', $filter['type']);
1259 1259
             switch ($filter['type']) {
1260 1260
                 case self::FILTER_VALUES:
@@ -1264,13 +1264,13 @@  discard block
 block discarded – undo
1264 1264
                     }
1265 1265
                     break;
1266 1266
                 case self::FILTER_RANGE:
1267
-                    $req .= sphPackI64($filter['min']) . sphPackI64($filter['max']);
1267
+                    $req .= sphPackI64($filter['min']).sphPackI64($filter['max']);
1268 1268
                     break;
1269 1269
                 case self::FILTER_FLOAT_RANGE:
1270
-                    $req .= $this->packFloat($filter['min']) . $this->packFloat($filter['max']);
1270
+                    $req .= $this->packFloat($filter['min']).$this->packFloat($filter['max']);
1271 1271
                     break;
1272 1272
                 case self::FILTER_STRING:
1273
-                    $req .= pack('N', strlen($filter['value'])) . $filter['value'];
1273
+                    $req .= pack('N', strlen($filter['value'])).$filter['value'];
1274 1274
                     break;
1275 1275
                 default:
1276 1276
                     assert(0 && 'internal error: unhandled filter type');
@@ -1279,27 +1279,27 @@  discard block
 block discarded – undo
1279 1279
         }
1280 1280
 
1281 1281
         // group-by clause, max-matches count, group-sort clause, cutoff count
1282
-        $req .= pack('NN', $this->group_func, strlen($this->group_by)) . $this->group_by;
1282
+        $req .= pack('NN', $this->group_func, strlen($this->group_by)).$this->group_by;
1283 1283
         $req .= pack('N', $this->max_matches);
1284
-        $req .= pack('N', strlen($this->group_sort)) . $this->group_sort;
1284
+        $req .= pack('N', strlen($this->group_sort)).$this->group_sort;
1285 1285
         $req .= pack('NNN', $this->cutoff, $this->retry_count, $this->retry_delay);
1286
-        $req .= pack('N', strlen($this->group_distinct)) . $this->group_distinct;
1286
+        $req .= pack('N', strlen($this->group_distinct)).$this->group_distinct;
1287 1287
 
1288 1288
         // anchor point
1289 1289
         if (empty($this->anchor)) {
1290 1290
             $req .= pack('N', 0);
1291 1291
         } else {
1292
-            $a =& $this->anchor;
1292
+            $a = & $this->anchor;
1293 1293
             $req .= pack('N', 1);
1294
-            $req .= pack('N', strlen($a['attrlat'])) . $a['attrlat'];
1295
-            $req .= pack('N', strlen($a['attrlong'])) . $a['attrlong'];
1296
-            $req .= $this->packFloat($a['lat']) . $this->packFloat($a['long']);
1294
+            $req .= pack('N', strlen($a['attrlat'])).$a['attrlat'];
1295
+            $req .= pack('N', strlen($a['attrlong'])).$a['attrlong'];
1296
+            $req .= $this->packFloat($a['lat']).$this->packFloat($a['long']);
1297 1297
         }
1298 1298
 
1299 1299
         // per-index weights
1300 1300
         $req .= pack('N', count($this->index_weights));
1301 1301
         foreach ($this->index_weights as $idx => $weight) {
1302
-            $req .= pack('N', strlen($idx)) . $idx . pack('N', $weight);
1302
+            $req .= pack('N', strlen($idx)).$idx.pack('N', $weight);
1303 1303
         }
1304 1304
 
1305 1305
         // max query time
@@ -1308,16 +1308,16 @@  discard block
 block discarded – undo
1308 1308
         // per-field weights
1309 1309
         $req .= pack('N', count($this->field_weights));
1310 1310
         foreach ($this->field_weights as $field => $weight) {
1311
-            $req .= pack('N', strlen($field)) . $field . pack('N', $weight);
1311
+            $req .= pack('N', strlen($field)).$field.pack('N', $weight);
1312 1312
         }
1313 1313
 
1314 1314
         // comment
1315
-        $req .= pack('N', strlen($comment)) . $comment;
1315
+        $req .= pack('N', strlen($comment)).$comment;
1316 1316
 
1317 1317
         // attribute overrides
1318 1318
         $req .= pack('N', count($this->overrides));
1319 1319
         foreach ($this->overrides as $key => $entry) {
1320
-            $req .= pack('N', strlen($entry['attr'])) . $entry['attr'];
1320
+            $req .= pack('N', strlen($entry['attr'])).$entry['attr'];
1321 1321
             $req .= pack('NN', $entry['type'], count($entry['values']));
1322 1322
             foreach ($entry['values'] as $id => $val) {
1323 1323
                 assert(is_numeric($id));
@@ -1339,14 +1339,14 @@  discard block
 block discarded – undo
1339 1339
         }
1340 1340
 
1341 1341
         // select-list
1342
-        $req .= pack('N', strlen($this->select)) . $this->select;
1342
+        $req .= pack('N', strlen($this->select)).$this->select;
1343 1343
 
1344 1344
         // max_predicted_time
1345
-        if ($this->predicted_time > 0) {
1345
+        if ($this->predicted_time>0) {
1346 1346
             $req .= pack('N', (int)$this->predicted_time);
1347 1347
         }
1348 1348
 
1349
-        $req .= pack('N', strlen($this->outer_order_by)) . $this->outer_order_by;
1349
+        $req .= pack('N', strlen($this->outer_order_by)).$this->outer_order_by;
1350 1350
         $req .= pack('NN', $this->outer_offset, $this->outer_limit);
1351 1351
         if ($this->has_outer) {
1352 1352
             $req .= pack('N', 1);
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
         $nreqs = count($this->reqs);
1387 1387
         $req = join('', $this->reqs);
1388 1388
         $len = 8 + strlen($req);
1389
-        $req = pack('nnNNN', self::SEARCHD_COMMAND_SEARCH, self::VER_COMMAND_SEARCH, $len, 0, $nreqs) . $req; // add header
1389
+        $req = pack('nnNNN', self::SEARCHD_COMMAND_SEARCH, self::VER_COMMAND_SEARCH, $len, 0, $nreqs).$req; // add header
1390 1390
 
1391 1391
         if (!$this->send($fp, $req, $len + 8) || !($response = $this->getResponse($fp, self::VER_COMMAND_SEARCH))) {
1392 1392
             $this->mbPop();
@@ -1414,9 +1414,9 @@  discard block
 block discarded – undo
1414 1414
         $max = strlen($response); // max position for checks, to protect against broken responses
1415 1415
 
1416 1416
         $results = array();
1417
-        for ($ires = 0; $ires < $nreqs && $p < $max; $ires++) {
1417
+        for ($ires = 0; $ires<$nreqs && $p<$max; $ires++) {
1418 1418
             $results[] = array();
1419
-            $result =& $results[$ires];
1419
+            $result = & $results[$ires];
1420 1420
 
1421 1421
             $result['error'] = '';
1422 1422
             $result['warning'] = '';
@@ -1425,13 +1425,13 @@  discard block
 block discarded – undo
1425 1425
             list(, $status) = unpack('N*', substr($response, $p, 4));
1426 1426
             $p += 4;
1427 1427
             $result['status'] = $status;
1428
-            if ($status != self::SEARCHD_OK) {
1428
+            if ($status!=self::SEARCHD_OK) {
1429 1429
                 list(, $len) = unpack('N*', substr($response, $p, 4));
1430 1430
                 $p += 4;
1431 1431
                 $message = substr($response, $p, $len);
1432 1432
                 $p += $len;
1433 1433
 
1434
-                if ($status == self::SEARCHD_WARNING) {
1434
+                if ($status==self::SEARCHD_WARNING) {
1435 1435
                     $result['warning'] = $message;
1436 1436
                 } else {
1437 1437
                     $result['error'] = $message;
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
 
1446 1446
             list(, $nfields) = unpack('N*', substr($response, $p, 4));
1447 1447
             $p += 4;
1448
-            while ($nfields --> 0 && $p < $max) {
1448
+            while ($nfields-->0 && $p<$max) {
1449 1449
                 list(, $len) = unpack('N*', substr($response, $p, 4));
1450 1450
                 $p += 4;
1451 1451
                 $fields[] = substr($response, $p, $len);
@@ -1455,7 +1455,7 @@  discard block
 block discarded – undo
1455 1455
 
1456 1456
             list(, $nattrs) = unpack('N*', substr($response, $p, 4));
1457 1457
             $p += 4;
1458
-            while ($nattrs --> 0 && $p < $max) {
1458
+            while ($nattrs-->0 && $p<$max) {
1459 1459
                 list(, $len) = unpack('N*', substr($response, $p, 4));
1460 1460
                 $p += 4;
1461 1461
                 $attr = substr($response, $p, $len);
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 
1475 1475
             // read matches
1476 1476
             $idx = -1;
1477
-            while ($count --> 0 && $p < $max) {
1477
+            while ($count-->0 && $p<$max) {
1478 1478
                 // index into result array
1479 1479
                 $idx++;
1480 1480
 
@@ -1502,14 +1502,14 @@  discard block
 block discarded – undo
1502 1502
                 $attrvals = array();
1503 1503
                 foreach ($attrs as $attr => $type) {
1504 1504
                     // handle 64bit ints
1505
-                    if ($type == self::ATTR_BIGINT) {
1505
+                    if ($type==self::ATTR_BIGINT) {
1506 1506
                         $attrvals[$attr] = sphUnpackI64(substr($response, $p, 8));
1507 1507
                         $p += 8;
1508 1508
                         continue;
1509 1509
                     }
1510 1510
 
1511 1511
                     // handle floats
1512
-                    if ($type == self::ATTR_FLOAT) {
1512
+                    if ($type==self::ATTR_FLOAT) {
1513 1513
                         list(, $uval) = unpack('N*', substr($response, $p, 4));
1514 1514
                         $p += 4;
1515 1515
                         list(, $fval) = unpack('f*', pack('L', $uval));
@@ -1520,28 +1520,28 @@  discard block
 block discarded – undo
1520 1520
                     // handle everything else as unsigned ints
1521 1521
                     list(, $val) = unpack('N*', substr($response, $p, 4));
1522 1522
                     $p += 4;
1523
-                    if ($type == self::ATTR_MULTI) {
1523
+                    if ($type==self::ATTR_MULTI) {
1524 1524
                         $attrvals[$attr] = array();
1525 1525
                         $nvalues = $val;
1526
-                        while ($nvalues --> 0 && $p < $max) {
1526
+                        while ($nvalues-->0 && $p<$max) {
1527 1527
                             list(, $val) = unpack('N*', substr($response, $p, 4));
1528 1528
                             $p += 4;
1529 1529
                             $attrvals[$attr][] = sphFixUint($val);
1530 1530
                         }
1531
-                    } elseif ($type == self::ATTR_MULTI64) {
1531
+                    } elseif ($type==self::ATTR_MULTI64) {
1532 1532
                         $attrvals[$attr] = array();
1533 1533
                         $nvalues = $val;
1534
-                        while ($nvalues > 0 && $p < $max) {
1534
+                        while ($nvalues>0 && $p<$max) {
1535 1535
                             $attrvals[$attr][] = sphUnpackI64(substr($response, $p, 8));
1536 1536
                             $p += 8;
1537 1537
                             $nvalues -= 2;
1538 1538
                         }
1539
-                    } elseif ($type == self::ATTR_STRING) {
1539
+                    } elseif ($type==self::ATTR_STRING) {
1540 1540
                         $attrvals[$attr] = substr($response, $p, $val);
1541 1541
                         $p += $val;
1542
-                    } elseif ($type == self::ATTR_FACTORS) {
1542
+                    } elseif ($type==self::ATTR_FACTORS) {
1543 1543
                         $attrvals[$attr] = substr($response, $p, $val - 4);
1544
-                        $p += $val-4;
1544
+                        $p += $val - 4;
1545 1545
                     } else {
1546 1546
                         $attrvals[$attr] = sphFixUint($val);
1547 1547
                     }
@@ -1560,14 +1560,14 @@  discard block
 block discarded – undo
1560 1560
             $result['time'] = sprintf('%.3f', $msecs / 1000);
1561 1561
             $p += 16;
1562 1562
 
1563
-            while ($words --> 0 && $p < $max) {
1563
+            while ($words-->0 && $p<$max) {
1564 1564
                 list(, $len) = unpack('N*', substr($response, $p, 4));
1565 1565
                 $p += 4;
1566 1566
                 $word = substr($response, $p, $len);
1567 1567
                 $p += $len;
1568 1568
                 list($docs, $hits) = array_values(unpack('N*N*', substr($response, $p, 8)));
1569 1569
                 $p += 8;
1570
-                $result['words'][$word] = array (
1570
+                $result['words'][$word] = array(
1571 1571
                     'docs' => sprintf('%u', $docs),
1572 1572
                     'hits' => sprintf('%u', $hits)
1573 1573
                 );
@@ -1669,23 +1669,23 @@  discard block
 block discarded – undo
1669 1669
             $flags |= 1024;
1670 1670
         }
1671 1671
         $req = pack('NN', 0, $flags); // mode=0, flags=$flags
1672
-        $req .= pack('N', strlen($index)) . $index; // req index
1673
-        $req .= pack('N', strlen($words)) . $words; // req words
1672
+        $req .= pack('N', strlen($index)).$index; // req index
1673
+        $req .= pack('N', strlen($words)).$words; // req words
1674 1674
 
1675 1675
         // options
1676
-        $req .= pack('N', strlen($opts['before_match'])) . $opts['before_match'];
1677
-        $req .= pack('N', strlen($opts['after_match'])) . $opts['after_match'];
1678
-        $req .= pack('N', strlen($opts['chunk_separator'])) . $opts['chunk_separator'];
1676
+        $req .= pack('N', strlen($opts['before_match'])).$opts['before_match'];
1677
+        $req .= pack('N', strlen($opts['after_match'])).$opts['after_match'];
1678
+        $req .= pack('N', strlen($opts['chunk_separator'])).$opts['chunk_separator'];
1679 1679
         $req .= pack('NN', (int)$opts['limit'], (int)$opts['around']);
1680 1680
         $req .= pack('NNN', (int)$opts['limit_passages'], (int)$opts['limit_words'], (int)$opts['start_passage_id']); // v.1.2
1681
-        $req .= pack('N', strlen($opts['html_strip_mode'])) . $opts['html_strip_mode'];
1682
-        $req .= pack('N', strlen($opts['passage_boundary'])) . $opts['passage_boundary'];
1681
+        $req .= pack('N', strlen($opts['html_strip_mode'])).$opts['html_strip_mode'];
1682
+        $req .= pack('N', strlen($opts['passage_boundary'])).$opts['passage_boundary'];
1683 1683
 
1684 1684
         // documents
1685 1685
         $req .= pack('N', count($docs));
1686 1686
         foreach ($docs as $doc) {
1687 1687
             assert(is_string($doc));
1688
-            $req .= pack('N', strlen($doc)) . $doc;
1688
+            $req .= pack('N', strlen($doc)).$doc;
1689 1689
         }
1690 1690
 
1691 1691
         ////////////////////////////
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
         ////////////////////////////
1694 1694
 
1695 1695
         $len = strlen($req);
1696
-        $req = pack('nnN', self::SEARCHD_COMMAND_EXCERPT, self::VER_COMMAND_EXCERPT, $len) . $req; // add header
1696
+        $req = pack('nnN', self::SEARCHD_COMMAND_EXCERPT, self::VER_COMMAND_EXCERPT, $len).$req; // add header
1697 1697
         if (!$this->send($fp, $req, $len + 8) || !($response = $this->getResponse($fp, self::VER_COMMAND_EXCERPT))) {
1698 1698
             $this->mbPop();
1699 1699
             return false;
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
             list(, $len) = unpack('N*', substr($response, $pos, 4));
1712 1712
             $pos += 4;
1713 1713
 
1714
-            if ($pos + $len > $rlen) {
1714
+            if ($pos + $len>$rlen) {
1715 1715
                 $this->error = 'incomplete reply';
1716 1716
                 $this->mbPop();
1717 1717
                 return false;
@@ -1757,8 +1757,8 @@  discard block
 block discarded – undo
1757 1757
         /////////////////
1758 1758
 
1759 1759
         // v.1.0 req
1760
-        $req  = pack('N', strlen($query)) . $query; // req query
1761
-        $req .= pack('N', strlen($index)) . $index; // req index
1760
+        $req  = pack('N', strlen($query)).$query; // req query
1761
+        $req .= pack('N', strlen($index)).$index; // req index
1762 1762
         $req .= pack('N', (int)$hits);
1763 1763
 
1764 1764
         ////////////////////////////
@@ -1766,7 +1766,7 @@  discard block
 block discarded – undo
1766 1766
         ////////////////////////////
1767 1767
 
1768 1768
         $len = strlen($req);
1769
-        $req = pack('nnN', self::SEARCHD_COMMAND_KEYWORDS, self::VER_COMMAND_KEYWORDS, $len) . $req; // add header
1769
+        $req = pack('nnN', self::SEARCHD_COMMAND_KEYWORDS, self::VER_COMMAND_KEYWORDS, $len).$req; // add header
1770 1770
         if (!$this->send($fp, $req, $len + 8) || !($response = $this->getResponse($fp, self::VER_COMMAND_KEYWORDS))) {
1771 1771
             $this->mbPop();
1772 1772
             return false;
@@ -1781,7 +1781,7 @@  discard block
 block discarded – undo
1781 1781
         $rlen = strlen($response);
1782 1782
         list(, $nwords) = unpack('N*', substr($response, $pos, 4));
1783 1783
         $pos += 4;
1784
-        for ($i = 0; $i < $nwords; $i++) {
1784
+        for ($i = 0; $i<$nwords; $i++) {
1785 1785
             list(, $len) = unpack('N*', substr($response, $pos, 4));
1786 1786
             $pos += 4;
1787 1787
             $tokenized = $len ? substr($response, $pos, $len) : '';
@@ -1804,7 +1804,7 @@  discard block
 block discarded – undo
1804 1804
                 $res[$i]['hits'] = $nhits;
1805 1805
             }
1806 1806
 
1807
-            if ($pos > $rlen) {
1807
+            if ($pos>$rlen) {
1808 1808
                 $this->error = 'incomplete reply';
1809 1809
                 $this->mbPop();
1810 1810
                 return false;
@@ -1822,8 +1822,8 @@  discard block
 block discarded – undo
1822 1822
      */
1823 1823
     public function escapeString($string)
1824 1824
     {
1825
-        $from = array('\\', '(',')','|','-','!','@','~','"','&', '/', '^', '$', '=', '<');
1826
-        $to   = array('\\\\', '\(','\)','\|','\-','\!','\@','\~','\"', '\&', '\/', '\^', '\$', '\=', '\<');
1825
+        $from = array('\\', '(', ')', '|', '-', '!', '@', '~', '"', '&', '/', '^', '$', '=', '<');
1826
+        $to   = array('\\\\', '\(', '\)', '\|', '\-', '\!', '\@', '\~', '\"', '\&', '\/', '\^', '\$', '\=', '\<');
1827 1827
 
1828 1828
         return str_replace($from, $to, $string);
1829 1829
     }
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
         foreach ($values as $id => $entry) {
1859 1859
             assert(is_numeric($id));
1860 1860
             assert(is_array($entry));
1861
-            assert(count($entry) == count($attrs));
1861
+            assert(count($entry)==count($attrs));
1862 1862
             foreach ($entry as $v) {
1863 1863
                 if ($mva) {
1864 1864
                     assert(is_array($v));
@@ -1873,12 +1873,12 @@  discard block
 block discarded – undo
1873 1873
 
1874 1874
         // build request
1875 1875
         $this->mbPush();
1876
-        $req = pack('N', strlen($index)) . $index;
1876
+        $req = pack('N', strlen($index)).$index;
1877 1877
 
1878 1878
         $req .= pack('N', count($attrs));
1879 1879
         $req .= pack('N', $ignore_non_existent ? 1 : 0);
1880 1880
         foreach ($attrs as $attr) {
1881
-            $req .= pack('N', strlen($attr)) . $attr;
1881
+            $req .= pack('N', strlen($attr)).$attr;
1882 1882
             $req .= pack('N', $mva ? 1 : 0);
1883 1883
         }
1884 1884
 
@@ -1902,7 +1902,7 @@  discard block
 block discarded – undo
1902 1902
         }
1903 1903
 
1904 1904
         $len = strlen($req);
1905
-        $req = pack('nnN', self::SEARCHD_COMMAND_UPDATE, self::VER_COMMAND_UPDATE, $len) . $req; // add header
1905
+        $req = pack('nnN', self::SEARCHD_COMMAND_UPDATE, self::VER_COMMAND_UPDATE, $len).$req; // add header
1906 1906
         if (!$this->send($fp, $req, $len + 8)) {
1907 1907
             $this->mbPop();
1908 1908
             return -1;
@@ -1928,7 +1928,7 @@  discard block
 block discarded – undo
1928 1928
      */
1929 1929
     public function open()
1930 1930
     {
1931
-        if ($this->socket !== false) {
1931
+        if ($this->socket!==false) {
1932 1932
             $this->error = 'already connected';
1933 1933
             return false;
1934 1934
         }
@@ -1950,7 +1950,7 @@  discard block
 block discarded – undo
1950 1950
      */
1951 1951
     public function close()
1952 1952
     {
1953
-        if ($this->socket === false) {
1953
+        if ($this->socket===false) {
1954 1954
             $this->error = 'not connected';
1955 1955
             return false;
1956 1956
         }
@@ -1992,8 +1992,8 @@  discard block
 block discarded – undo
1992 1992
         $p += 8;
1993 1993
 
1994 1994
         $res = array();
1995
-        for ($i = 0; $i < $rows; $i++) {
1996
-            for ($j = 0; $j < $cols; $j++) {
1995
+        for ($i = 0; $i<$rows; $i++) {
1996
+            for ($j = 0; $j<$cols; $j++) {
1997 1997
                 list(, $len) = unpack('N*', substr($response, $p, 4));
1998 1998
                 $p += 4;
1999 1999
                 $res[$i][] = substr($response, $p, $len);
@@ -2027,7 +2027,7 @@  discard block
 block discarded – undo
2027 2027
         }
2028 2028
 
2029 2029
         $tag = -1;
2030
-        if (strlen($response) == 4) {
2030
+        if (strlen($response)==4) {
2031 2031
             list(, $tag) = unpack('N*', $response);
2032 2032
         } else {
2033 2033
             $this->error = 'unexpected response length';
Please login to merge, or discard this patch.
src/const.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -2,59 +2,59 @@  discard block
 block discarded – undo
2 2
 
3 3
 // known searchd commands
4 4
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_SEARCH */
5
-define('SEARCHD_COMMAND_SEARCH',     0);
5
+define('SEARCHD_COMMAND_SEARCH', 0);
6 6
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_EXCERPT */
7
-define('SEARCHD_COMMAND_EXCERPT',    1);
7
+define('SEARCHD_COMMAND_EXCERPT', 1);
8 8
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_UPDATE */
9
-define('SEARCHD_COMMAND_UPDATE',     2);
9
+define('SEARCHD_COMMAND_UPDATE', 2);
10 10
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_KEYWORDS */
11
-define('SEARCHD_COMMAND_KEYWORDS',   3);
11
+define('SEARCHD_COMMAND_KEYWORDS', 3);
12 12
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_PERSIST */
13
-define('SEARCHD_COMMAND_PERSIST',    4);
13
+define('SEARCHD_COMMAND_PERSIST', 4);
14 14
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_STATUS */
15
-define('SEARCHD_COMMAND_STATUS',     5);
15
+define('SEARCHD_COMMAND_STATUS', 5);
16 16
 /* @deprecated use SphinxClient::SEARCHD_COMMAND_FLUSHATTRS */
17 17
 define('SEARCHD_COMMAND_FLUSHATTRS', 7);
18 18
 
19 19
 // current client-side command implementation versions
20 20
 /* @deprecated use SphinxClient::VER_COMMAND_SEARCH */
21
-define('VER_COMMAND_SEARCH',     0x11E);
21
+define('VER_COMMAND_SEARCH', 0x11E);
22 22
 /* @deprecated use SphinxClient::VER_COMMAND_EXCERPT */
23
-define('VER_COMMAND_EXCERPT',    0x104);
23
+define('VER_COMMAND_EXCERPT', 0x104);
24 24
 /* @deprecated use SphinxClient::VER_COMMAND_UPDATE */
25
-define('VER_COMMAND_UPDATE',     0x103);
25
+define('VER_COMMAND_UPDATE', 0x103);
26 26
 /* @deprecated use SphinxClient::VER_COMMAND_KEYWORDS */
27
-define('VER_COMMAND_KEYWORDS',   0x100);
27
+define('VER_COMMAND_KEYWORDS', 0x100);
28 28
 /* @deprecated use SphinxClient::VER_COMMAND_STATUS */
29
-define('VER_COMMAND_STATUS',     0x101);
29
+define('VER_COMMAND_STATUS', 0x101);
30 30
 /* @deprecated use SphinxClient::VER_COMMAND_QUERY */
31
-define('VER_COMMAND_QUERY',      0x100);
31
+define('VER_COMMAND_QUERY', 0x100);
32 32
 /* @deprecated use SphinxClient::VER_COMMAND_FLUSH_ATTRS */
33 33
 define('VER_COMMAND_FLUSHATTRS', 0x100);
34 34
 
35 35
 // known searchd status codes
36 36
 /* @deprecated use SphinxClient::SEARCHD_OK */
37
-define('SEARCHD_OK',      0);
37
+define('SEARCHD_OK', 0);
38 38
 /* @deprecated use SphinxClient::SEARCHD_ERROR */
39
-define('SEARCHD_ERROR',   1);
39
+define('SEARCHD_ERROR', 1);
40 40
 /* @deprecated use SphinxClient::SEARCHD_RETRY */
41
-define('SEARCHD_RETRY',   2);
41
+define('SEARCHD_RETRY', 2);
42 42
 /* @deprecated use SphinxClient::SEARCHD_WARNING */
43 43
 define('SEARCHD_WARNING', 3);
44 44
 
45 45
 // known match modes
46 46
 /* @deprecated use SphinxClient::MATCH_ALL */
47
-define('SPH_MATCH_ALL',       0);
47
+define('SPH_MATCH_ALL', 0);
48 48
 /* @deprecated use SphinxClient::MATCH_ANY */
49
-define('SPH_MATCH_ANY',       1);
49
+define('SPH_MATCH_ANY', 1);
50 50
 /* @deprecated use SphinxClient::MATCH_PHRASE */
51
-define('SPH_MATCH_PHRASE',    2);
51
+define('SPH_MATCH_PHRASE', 2);
52 52
 /* @deprecated use SphinxClient::MATCH_BOOLEAN */
53
-define('SPH_MATCH_BOOLEAN',   3);
53
+define('SPH_MATCH_BOOLEAN', 3);
54 54
 /* @deprecated use SphinxClient::MATCH_EXTENDED */
55
-define('SPH_MATCH_EXTENDED',  4);
55
+define('SPH_MATCH_EXTENDED', 4);
56 56
 /* @deprecated use SphinxClient::MATCH_FULL_SCAN */
57
-define('SPH_MATCH_FULLSCAN',  5);
57
+define('SPH_MATCH_FULLSCAN', 5);
58 58
 /* @deprecated use SphinxClient::MATCH_EXTENDED2 */
59 59
 define('SPH_MATCH_EXTENDED2', 6); // extended engine V2 (TEMPORARY, WILL BE REMOVED)
60 60
 
@@ -62,80 +62,80 @@  discard block
 block discarded – undo
62 62
 /* @deprecated use SphinxClient::RANK_PROXIMITY_BM25 */
63 63
 define('SPH_RANK_PROXIMITY_BM25', 0); // default mode, phrase proximity major factor and BM25 minor one
64 64
 /* @deprecated use SphinxClient::RANK_BM25 */
65
-define('SPH_RANK_BM25',           1); // statistical mode, BM25 ranking only (faster but worse quality)
65
+define('SPH_RANK_BM25', 1); // statistical mode, BM25 ranking only (faster but worse quality)
66 66
 /* @deprecated use SphinxClient::RANK_NONE */
67
-define('SPH_RANK_NONE',           2); // no ranking, all matches get a weight of 1
67
+define('SPH_RANK_NONE', 2); // no ranking, all matches get a weight of 1
68 68
 /* @deprecated use SphinxClient::RANK_WORD_COUNT */
69
-define('SPH_RANK_WORDCOUNT',      3); // simple word-count weighting, rank is a weighted sum of per-field keyword occurence counts
69
+define('SPH_RANK_WORDCOUNT', 3); // simple word-count weighting, rank is a weighted sum of per-field keyword occurence counts
70 70
 /* @deprecated use SphinxClient::RANK_PROXIMITY */
71
-define('SPH_RANK_PROXIMITY',      4);
71
+define('SPH_RANK_PROXIMITY', 4);
72 72
 /* @deprecated use SphinxClient::RANK_MATCH_ANY */
73
-define('SPH_RANK_MATCHANY',       5);
73
+define('SPH_RANK_MATCHANY', 5);
74 74
 /* @deprecated use SphinxClient::RANK_FIELD_MASK */
75
-define('SPH_RANK_FIELDMASK',      6);
75
+define('SPH_RANK_FIELDMASK', 6);
76 76
 /* @deprecated use SphinxClient::RANK_SPH04 */
77
-define('SPH_RANK_SPH04',          7);
77
+define('SPH_RANK_SPH04', 7);
78 78
 /* @deprecated use SphinxClient::RANK_EXPR */
79
-define('SPH_RANK_EXPR',           8);
79
+define('SPH_RANK_EXPR', 8);
80 80
 /* @deprecated use SphinxClient::RANK_TOTAL */
81
-define('SPH_RANK_TOTAL',          9);
81
+define('SPH_RANK_TOTAL', 9);
82 82
 
83 83
 // known sort modes
84 84
 /* @deprecated use SphinxClient::SORT_RELEVANCE */
85
-define('SPH_SORT_RELEVANCE',     0);
85
+define('SPH_SORT_RELEVANCE', 0);
86 86
 /* @deprecated use SphinxClient::SORT_ATTR_DESC */
87
-define('SPH_SORT_ATTR_DESC',     1);
87
+define('SPH_SORT_ATTR_DESC', 1);
88 88
 /* @deprecated use SphinxClient::SORT_ATTR_ASC */
89
-define('SPH_SORT_ATTR_ASC',      2);
89
+define('SPH_SORT_ATTR_ASC', 2);
90 90
 /* @deprecated use SphinxClient::SORT_TIME_SEGMENTS */
91 91
 define('SPH_SORT_TIME_SEGMENTS', 3);
92 92
 /* @deprecated use SphinxClient::SORT_EXTENDED */
93
-define('SPH_SORT_EXTENDED',      4);
93
+define('SPH_SORT_EXTENDED', 4);
94 94
 /* @deprecated use SphinxClient::SORT_EXPR */
95
-define('SPH_SORT_EXPR',          5);
95
+define('SPH_SORT_EXPR', 5);
96 96
 
97 97
 // known filter types
98 98
 /* @deprecated use SphinxClient::FILTER_VALUES */
99
-define('SPH_FILTER_VALUES',     0);
99
+define('SPH_FILTER_VALUES', 0);
100 100
 /* @deprecated use SphinxClient::FILTER_RANGE */
101
-define('SPH_FILTER_RANGE',      1);
101
+define('SPH_FILTER_RANGE', 1);
102 102
 /* @deprecated use SphinxClient::FILTER_FLOAT_RANGE */
103 103
 define('SPH_FILTER_FLOATRANGE', 2);
104 104
 /* @deprecated use SphinxClient::FILTER_STRING */
105
-define('SPH_FILTER_STRING',     3);
105
+define('SPH_FILTER_STRING', 3);
106 106
 
107 107
 // known attribute types
108 108
 /* @deprecated use SphinxClient::ATTR_INTEGER */
109
-define('SPH_ATTR_INTEGER',   1);
109
+define('SPH_ATTR_INTEGER', 1);
110 110
 /* @deprecated use SphinxClient::ATTR_TIMESTAMP */
111 111
 define('SPH_ATTR_TIMESTAMP', 2);
112 112
 /* @deprecated use SphinxClient::ATTR_ORDINAL */
113
-define('SPH_ATTR_ORDINAL',   3);
113
+define('SPH_ATTR_ORDINAL', 3);
114 114
 /* @deprecated use SphinxClient::ATTR_BOOL */
115
-define('SPH_ATTR_BOOL',      4);
115
+define('SPH_ATTR_BOOL', 4);
116 116
 /* @deprecated use SphinxClient::ATTR_FLOAT */
117
-define('SPH_ATTR_FLOAT',     5);
117
+define('SPH_ATTR_FLOAT', 5);
118 118
 /* @deprecated use SphinxClient::ATTR_BIGINT */
119
-define('SPH_ATTR_BIGINT',    6);
119
+define('SPH_ATTR_BIGINT', 6);
120 120
 /* @deprecated use SphinxClient::ATTR_STRING */
121
-define('SPH_ATTR_STRING',    7);
121
+define('SPH_ATTR_STRING', 7);
122 122
 /* @deprecated use SphinxClient::ATTR_FACTORS */
123
-define('SPH_ATTR_FACTORS',   1001);
123
+define('SPH_ATTR_FACTORS', 1001);
124 124
 /* @deprecated use SphinxClient::ATTR_MULTI */
125
-define('SPH_ATTR_MULTI',     0x40000001);
125
+define('SPH_ATTR_MULTI', 0x40000001);
126 126
 /* @deprecated use SphinxClient::ATTR_MULTI64 */
127
-define('SPH_ATTR_MULTI64',   0x40000002);
127
+define('SPH_ATTR_MULTI64', 0x40000002);
128 128
 
129 129
 // known grouping functions
130 130
 /* @deprecated use SphinxClient::GROUP_BY_DAY */
131
-define('SPH_GROUPBY_DAY',      0);
131
+define('SPH_GROUPBY_DAY', 0);
132 132
 /* @deprecated use SphinxClient::GROUP_BY_WEEK */
133
-define('SPH_GROUPBY_WEEK',     1);
133
+define('SPH_GROUPBY_WEEK', 1);
134 134
 /* @deprecated use SphinxClient::GROUP_BY_MONTH */
135
-define('SPH_GROUPBY_MONTH',    2);
135
+define('SPH_GROUPBY_MONTH', 2);
136 136
 /* @deprecated use SphinxClient::GROUP_BY_YEAR */
137
-define('SPH_GROUPBY_YEAR',     3);
137
+define('SPH_GROUPBY_YEAR', 3);
138 138
 /* @deprecated use SphinxClient::GROUP_BY_ATTR */
139
-define('SPH_GROUPBY_ATTR',     4);
139
+define('SPH_GROUPBY_ATTR', 4);
140 140
 /* @deprecated use SphinxClient::GROUP_BY_ATTR_PAIR */
141 141
 define('SPH_GROUPBY_ATTRPAIR', 5);
Please login to merge, or discard this patch.