We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @var float |
| 74 | 74 | */ |
| 75 | - protected $_documentBoost = false; |
|
| 75 | + protected $_documentBoost = FALSE; |
|
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | 78 | * Document field values, indexed by name |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function clear() |
| 95 | 95 | { |
| 96 | - $this->_documentBoost = false; |
|
| 96 | + $this->_documentBoost = FALSE; |
|
| 97 | 97 | |
| 98 | 98 | $this->_fields = array(); |
| 99 | 99 | $this->_fieldBoosts = array(); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | else |
| 126 | 126 | { |
| 127 | - $this->_documentBoost = false; |
|
| 127 | + $this->_documentBoost = FALSE; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @param mixed $value |
| 152 | 152 | * @param mixed $boost Use false for default boost, else cast to float that should be > 0 or will be treated as false |
| 153 | 153 | */ |
| 154 | - public function addField($key, $value, $boost = false) |
|
| 154 | + public function addField($key, $value, $boost = FALSE) |
|
| 155 | 155 | { |
| 156 | 156 | if (!isset($this->_fields[$key])) |
| 157 | 157 | { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | $this->_fields[$key] = array($this->_fields[$key]); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - if ($this->getFieldBoost($key) === false) |
|
| 167 | + if ($this->getFieldBoost($key) === FALSE) |
|
| 168 | 168 | { |
| 169 | 169 | // boost not already set, set it now |
| 170 | 170 | $this->setFieldBoost($key, $boost); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | * |
| 189 | 189 | * @deprecated Use addField(...) instead |
| 190 | 190 | */ |
| 191 | - public function setMultiValue($key, $value, $boost = false) |
|
| 191 | + public function setMultiValue($key, $value, $boost = FALSE) |
|
| 192 | 192 | { |
| 193 | 193 | $this->addField($key, $value, $boost); |
| 194 | 194 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | ); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | - return false; |
|
| 213 | + return FALSE; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | * @param mixed $value |
| 223 | 223 | * @param mixed $boost Use false for default boost, else cast to float that should be > 0 or will be treated as false |
| 224 | 224 | */ |
| 225 | - public function setField($key, $value, $boost = false) |
|
| 225 | + public function setField($key, $value, $boost = FALSE) |
|
| 226 | 226 | { |
| 227 | 227 | $this->_fields[$key] = $value; |
| 228 | 228 | $this->setFieldBoost($key, $boost); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function getFieldBoost($key) |
| 238 | 238 | { |
| 239 | - return isset($this->_fieldBoosts[$key]) ? $this->_fieldBoosts[$key] : false; |
|
| 239 | + return isset($this->_fieldBoosts[$key]) ? $this->_fieldBoosts[$key] : FALSE; |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | /** |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | } |
| 256 | 256 | else |
| 257 | 257 | { |
| 258 | - $this->_fieldBoosts[$key] = false; |
|
| 258 | + $this->_fieldBoosts[$key] = FALSE; |
|
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | return $this->_fields[$key]; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - return null; |
|
| 322 | + return NULL; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
@@ -60,19 +60,19 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | const SVN_ID = '$Id: Balancer.php 54 2011-02-04 16:29:18Z donovan.jimenez $'; |
| 62 | 62 | |
| 63 | - protected $_createDocuments = true; |
|
| 63 | + protected $_createDocuments = TRUE; |
|
| 64 | 64 | |
| 65 | 65 | protected $_readableServices = array(); |
| 66 | 66 | protected $_writeableServices = array(); |
| 67 | 67 | |
| 68 | - protected $_currentReadService = null; |
|
| 69 | - protected $_currentWriteService = null; |
|
| 68 | + protected $_currentReadService = NULL; |
|
| 69 | + protected $_currentWriteService = NULL; |
|
| 70 | 70 | |
| 71 | 71 | protected $_readPingTimeout = 2; |
| 72 | 72 | protected $_writePingTimeout = 4; |
| 73 | 73 | |
| 74 | 74 | // Configuration for server selection backoff intervals |
| 75 | - protected $_useBackoff = false; // Set to true to use more resillient write server selection |
|
| 75 | + protected $_useBackoff = FALSE; // Set to true to use more resillient write server selection |
|
| 76 | 76 | protected $_backoffLimit = 600; // 10 minute default maximum |
| 77 | 77 | protected $_backoffEscalation = 2.0; // Rate at which to increase backoff period |
| 78 | 78 | protected $_defaultBackoff = 2.0; // Default backoff interval |
@@ -305,14 +305,14 @@ discard block |
||
| 305 | 305 | * |
| 306 | 306 | * @throws Apache_Solr_NoServiceAvailableException If there are no read services that meet requirements |
| 307 | 307 | */ |
| 308 | - protected function _selectReadService($forceSelect = false) |
|
| 308 | + protected function _selectReadService($forceSelect = FALSE) |
|
| 309 | 309 | { |
| 310 | 310 | if (!$this->_currentReadService || !isset($this->_readableServices[$this->_currentReadService]) || $forceSelect) |
| 311 | 311 | { |
| 312 | 312 | if ($this->_currentReadService && isset($this->_readableServices[$this->_currentReadService]) && $forceSelect) |
| 313 | 313 | { |
| 314 | 314 | // we probably had a communication error, ping the current read service, remove it if it times out |
| 315 | - if ($this->_readableServices[$this->_currentReadService]->ping($this->_readPingTimeout) === false) |
|
| 315 | + if ($this->_readableServices[$this->_currentReadService]->ping($this->_readPingTimeout) === FALSE) |
|
| 316 | 316 | { |
| 317 | 317 | $this->removeReadService($this->_currentReadService); |
| 318 | 318 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | * |
| 354 | 354 | * @throws Apache_Solr_NoServiceAvailableException If there are no write services that meet requirements |
| 355 | 355 | */ |
| 356 | - protected function _selectWriteService($forceSelect = false) |
|
| 356 | + protected function _selectWriteService($forceSelect = FALSE) |
|
| 357 | 357 | { |
| 358 | 358 | if($this->_useBackoff) |
| 359 | 359 | { |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | if ($this->_currentWriteService && isset($this->_writeableServices[$this->_currentWriteService]) && $forceSelect) |
| 366 | 366 | { |
| 367 | 367 | // we probably had a communication error, ping the current read service, remove it if it times out |
| 368 | - if ($this->_writeableServices[$this->_currentWriteService]->ping($this->_writePingTimeout) === false) |
|
| 368 | + if ($this->_writeableServices[$this->_currentWriteService]->ping($this->_writePingTimeout) === FALSE) |
|
| 369 | 369 | { |
| 370 | 370 | $this->removeWriteService($this->_currentWriteService); |
| 371 | 371 | } |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | * @throws Apache_Solr_NoServiceAvailableException If there are no write services that meet requirements |
| 410 | 410 | */ |
| 411 | 411 | |
| 412 | - protected function _selectWriteServiceSafe($forceSelect = false) |
|
| 412 | + protected function _selectWriteServiceSafe($forceSelect = FALSE) |
|
| 413 | 413 | { |
| 414 | 414 | if (!$this->_currentWriteService || !isset($this->_writeableServices[$this->_currentWriteService]) || $forceSelect) |
| 415 | 415 | { |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | throw new Apache_Solr_NoServiceAvailableException('No write services were available. All timeouts exceeded.'); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - } while($this->_writeableServices[$this->_currentWriteService]->ping($backoff) === false); |
|
| 443 | + } while($this->_writeableServices[$this->_currentWriteService]->ping($backoff) === FALSE); |
|
| 444 | 444 | } |
| 445 | 445 | else |
| 446 | 446 | { |
@@ -506,10 +506,10 @@ discard block |
||
| 506 | 506 | } |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | - $service = $this->_selectWriteService(true); |
|
| 509 | + $service = $this->_selectWriteService(TRUE); |
|
| 510 | 510 | } while ($service); |
| 511 | 511 | |
| 512 | - return false; |
|
| 512 | + return FALSE; |
|
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | /** |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | * |
| 524 | 524 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 525 | 525 | */ |
| 526 | - public function addDocument(Apache_Solr_Document $document, $allowDups = false, $overwritePending = true, $overwriteCommitted = true) |
|
| 526 | + public function addDocument(Apache_Solr_Document $document, $allowDups = FALSE, $overwritePending = TRUE, $overwriteCommitted = TRUE) |
|
| 527 | 527 | { |
| 528 | 528 | $service = $this->_selectWriteService(); |
| 529 | 529 | |
@@ -541,10 +541,10 @@ discard block |
||
| 541 | 541 | } |
| 542 | 542 | } |
| 543 | 543 | |
| 544 | - $service = $this->_selectWriteService(true); |
|
| 544 | + $service = $this->_selectWriteService(TRUE); |
|
| 545 | 545 | } while ($service); |
| 546 | 546 | |
| 547 | - return false; |
|
| 547 | + return FALSE; |
|
| 548 | 548 | } |
| 549 | 549 | |
| 550 | 550 | /** |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | * |
| 559 | 559 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 560 | 560 | */ |
| 561 | - public function addDocuments($documents, $allowDups = false, $overwritePending = true, $overwriteCommitted = true) |
|
| 561 | + public function addDocuments($documents, $allowDups = FALSE, $overwritePending = TRUE, $overwriteCommitted = TRUE) |
|
| 562 | 562 | { |
| 563 | 563 | $service = $this->_selectWriteService(); |
| 564 | 564 | |
@@ -576,10 +576,10 @@ discard block |
||
| 576 | 576 | } |
| 577 | 577 | } |
| 578 | 578 | |
| 579 | - $service = $this->_selectWriteService(true); |
|
| 579 | + $service = $this->_selectWriteService(TRUE); |
|
| 580 | 580 | } while ($service); |
| 581 | 581 | |
| 582 | - return false; |
|
| 582 | + return FALSE; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | /** |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | * |
| 593 | 593 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 594 | 594 | */ |
| 595 | - public function commit($optimize = true, $waitFlush = true, $waitSearcher = true, $timeout = 3600) |
|
| 595 | + public function commit($optimize = TRUE, $waitFlush = TRUE, $waitSearcher = TRUE, $timeout = 3600) |
|
| 596 | 596 | { |
| 597 | 597 | $service = $this->_selectWriteService(); |
| 598 | 598 | |
@@ -610,10 +610,10 @@ discard block |
||
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | |
| 613 | - $service = $this->_selectWriteService(true); |
|
| 613 | + $service = $this->_selectWriteService(TRUE); |
|
| 614 | 614 | } while ($service); |
| 615 | 615 | |
| 616 | - return false; |
|
| 616 | + return FALSE; |
|
| 617 | 617 | } |
| 618 | 618 | |
| 619 | 619 | /** |
@@ -644,10 +644,10 @@ discard block |
||
| 644 | 644 | } |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | - $service = $this->_selectWriteService(true); |
|
| 647 | + $service = $this->_selectWriteService(TRUE); |
|
| 648 | 648 | } while ($service); |
| 649 | 649 | |
| 650 | - return false; |
|
| 650 | + return FALSE; |
|
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | /** |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | * |
| 662 | 662 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 663 | 663 | */ |
| 664 | - public function deleteById($id, $fromPending = true, $fromCommitted = true, $timeout = 3600) |
|
| 664 | + public function deleteById($id, $fromPending = TRUE, $fromCommitted = TRUE, $timeout = 3600) |
|
| 665 | 665 | { |
| 666 | 666 | $service = $this->_selectWriteService(); |
| 667 | 667 | |
@@ -679,10 +679,10 @@ discard block |
||
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | |
| 682 | - $service = $this->_selectWriteService(true); |
|
| 682 | + $service = $this->_selectWriteService(TRUE); |
|
| 683 | 683 | } while ($service); |
| 684 | 684 | |
| 685 | - return false; |
|
| 685 | + return FALSE; |
|
| 686 | 686 | } |
| 687 | 687 | |
| 688 | 688 | /** |
@@ -696,7 +696,7 @@ discard block |
||
| 696 | 696 | * |
| 697 | 697 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 698 | 698 | */ |
| 699 | - public function deleteByMultipleIds($ids, $fromPending = true, $fromCommitted = true, $timeout = 3600) |
|
| 699 | + public function deleteByMultipleIds($ids, $fromPending = TRUE, $fromCommitted = TRUE, $timeout = 3600) |
|
| 700 | 700 | { |
| 701 | 701 | $service = $this->_selectWriteService(); |
| 702 | 702 | |
@@ -714,10 +714,10 @@ discard block |
||
| 714 | 714 | } |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | - $service = $this->_selectWriteService(true); |
|
| 717 | + $service = $this->_selectWriteService(TRUE); |
|
| 718 | 718 | } while ($service); |
| 719 | 719 | |
| 720 | - return false; |
|
| 720 | + return FALSE; |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | /** |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | * |
| 732 | 732 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 733 | 733 | */ |
| 734 | - public function deleteByQuery($rawQuery, $fromPending = true, $fromCommitted = true, $timeout = 3600) |
|
| 734 | + public function deleteByQuery($rawQuery, $fromPending = TRUE, $fromCommitted = TRUE, $timeout = 3600) |
|
| 735 | 735 | { |
| 736 | 736 | $service = $this->_selectWriteService(); |
| 737 | 737 | |
@@ -749,10 +749,10 @@ discard block |
||
| 749 | 749 | } |
| 750 | 750 | } |
| 751 | 751 | |
| 752 | - $service = $this->_selectWriteService(true); |
|
| 752 | + $service = $this->_selectWriteService(TRUE); |
|
| 753 | 753 | } while ($service); |
| 754 | 754 | |
| 755 | - return false; |
|
| 755 | + return FALSE; |
|
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | /** |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | * |
| 774 | 774 | * @throws Apache_Solr_InvalidArgumentException if $file, $params, or $document are invalid. |
| 775 | 775 | */ |
| 776 | - public function extract($file, $params = array(), $document = null, $mimetype = 'application/octet-stream') |
|
| 776 | + public function extract($file, $params = array(), $document = NULL, $mimetype = 'application/octet-stream') |
|
| 777 | 777 | { |
| 778 | 778 | $service = $this->_selectWriteService(); |
| 779 | 779 | |
@@ -791,10 +791,10 @@ discard block |
||
| 791 | 791 | } |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | - $service = $this->_selectWriteService(true); |
|
| 794 | + $service = $this->_selectWriteService(TRUE); |
|
| 795 | 795 | } while ($service); |
| 796 | 796 | |
| 797 | - return false; |
|
| 797 | + return FALSE; |
|
| 798 | 798 | } |
| 799 | 799 | |
| 800 | 800 | /** |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | * |
| 818 | 818 | * @todo Should be using multipart/form-data to post parameter values, but I could not get my implementation to work. Needs revisisted. |
| 819 | 819 | */ |
| 820 | - public function extractFromString($data, $params = array(), $document = null, $mimetype = 'application/octet-stream') |
|
| 820 | + public function extractFromString($data, $params = array(), $document = NULL, $mimetype = 'application/octet-stream') |
|
| 821 | 821 | { |
| 822 | 822 | $service = $this->_selectWriteService(); |
| 823 | 823 | |
@@ -835,10 +835,10 @@ discard block |
||
| 835 | 835 | } |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | - $service = $this->_selectWriteService(true); |
|
| 838 | + $service = $this->_selectWriteService(TRUE); |
|
| 839 | 839 | } while ($service); |
| 840 | 840 | |
| 841 | - return false; |
|
| 841 | + return FALSE; |
|
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | /** |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | * |
| 853 | 853 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 854 | 854 | */ |
| 855 | - public function optimize($waitFlush = true, $waitSearcher = true, $timeout = 3600) |
|
| 855 | + public function optimize($waitFlush = TRUE, $waitSearcher = TRUE, $timeout = 3600) |
|
| 856 | 856 | { |
| 857 | 857 | $service = $this->_selectWriteService(); |
| 858 | 858 | |
@@ -870,10 +870,10 @@ discard block |
||
| 870 | 870 | } |
| 871 | 871 | } |
| 872 | 872 | |
| 873 | - $service = $this->_selectWriteService(true); |
|
| 873 | + $service = $this->_selectWriteService(TRUE); |
|
| 874 | 874 | } while ($service); |
| 875 | 875 | |
| 876 | - return false; |
|
| 876 | + return FALSE; |
|
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | /** |
@@ -906,9 +906,9 @@ discard block |
||
| 906 | 906 | } |
| 907 | 907 | } |
| 908 | 908 | |
| 909 | - $service = $this->_selectReadService(true); |
|
| 909 | + $service = $this->_selectReadService(TRUE); |
|
| 910 | 910 | } while ($service); |
| 911 | 911 | |
| 912 | - return false; |
|
| 912 | + return FALSE; |
|
| 913 | 913 | } |
| 914 | 914 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @var boolean |
| 71 | 71 | */ |
| 72 | - protected $_isParsed = false; |
|
| 72 | + protected $_isParsed = FALSE; |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Parsed representation of the data |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @var boolean |
| 86 | 86 | */ |
| 87 | - protected $_createDocuments = true, |
|
| 88 | - $_collapseSingleValueArrays = true; |
|
| 87 | + protected $_createDocuments = TRUE, |
|
| 88 | + $_collapseSingleValueArrays = TRUE; |
|
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * Constructor. Takes the raw HTTP response body and the exploded HTTP headers |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @param boolean $createDocuments Whether to convert the documents json_decoded as stdClass instances to Apache_Solr_Document instances |
| 95 | 95 | * @param boolean $collapseSingleValueArrays Whether to make multivalued fields appear as single values |
| 96 | 96 | */ |
| 97 | - public function __construct(Apache_Solr_HttpTransport_Response $response, $createDocuments = true, $collapseSingleValueArrays = true) |
|
| 97 | + public function __construct(Apache_Solr_HttpTransport_Response $response, $createDocuments = TRUE, $collapseSingleValueArrays = TRUE) |
|
| 98 | 98 | { |
| 99 | 99 | $this->_response = $response; |
| 100 | 100 | $this->_createDocuments = (bool) $createDocuments; |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | if (!$this->_isParsed) |
| 163 | 163 | { |
| 164 | 164 | $this->_parseData(); |
| 165 | - $this->_isParsed = true; |
|
| 165 | + $this->_isParsed = TRUE; |
|
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (isset($this->_parsedData->$key)) |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | return $this->_parsedData->$key; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - return null; |
|
| 173 | + return NULL; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | if (!$this->_isParsed) |
| 185 | 185 | { |
| 186 | 186 | $this->_parseData(); |
| 187 | - $this->_isParsed = true; |
|
| 187 | + $this->_isParsed = TRUE; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | return isset($this->_parsedData->$key); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $data = json_decode($this->_response->getBody()); |
| 202 | 202 | |
| 203 | 203 | // check that we receive a valid JSON response - we should never receive a null |
| 204 | - if ($data === null) |
|
| 204 | + if ($data === NULL) |
|
| 205 | 205 | { |
| 206 | 206 | throw new Apache_Solr_ParserException('Solr response does not appear to be valid JSON, please examine the raw response with getRawResponse() method'); |
| 207 | 207 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | * |
| 135 | 135 | * @var boolean |
| 136 | 136 | */ |
| 137 | - protected $_createDocuments = true; |
|
| 137 | + protected $_createDocuments = TRUE; |
|
| 138 | 138 | |
| 139 | 139 | /** |
| 140 | 140 | * Whether {@link Apache_Solr_Response} objects should have multivalue fields with only a single value |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | * |
| 143 | 143 | * @var boolean |
| 144 | 144 | */ |
| 145 | - protected $_collapseSingleValueArrays = true; |
|
| 145 | + protected $_collapseSingleValueArrays = TRUE; |
|
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * How NamedLists should be formatted in the output. This specifically effects facet counts. Valid values |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * |
| 159 | 159 | * @var string |
| 160 | 160 | */ |
| 161 | - protected $_queryDelimiter = '?', $_queryStringDelimiter = '&', $_queryBracketsEscaped = true; |
|
| 161 | + protected $_queryDelimiter = '?', $_queryStringDelimiter = '&', $_queryBracketsEscaped = TRUE; |
|
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | 164 | * Constructed servlet full path URLs |
@@ -172,14 +172,14 @@ discard block |
||
| 172 | 172 | * |
| 173 | 173 | * @var boolean |
| 174 | 174 | */ |
| 175 | - protected $_urlsInited = false; |
|
| 175 | + protected $_urlsInited = FALSE; |
|
| 176 | 176 | |
| 177 | 177 | /** |
| 178 | 178 | * HTTP Transport implementation (pluggable) |
| 179 | 179 | * |
| 180 | 180 | * @var Apache_Solr_HttpTransport_Interface |
| 181 | 181 | */ |
| 182 | - protected $_httpTransport = false; |
|
| 182 | + protected $_httpTransport = FALSE; |
|
| 183 | 183 | |
| 184 | 184 | /** |
| 185 | 185 | * Escape a value for special query characters such as ':', '(', ')', '*', '?', etc. |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | * @param string $path |
| 233 | 233 | * @param Apache_Solr_HttpTransport_Interface $httpTransport |
| 234 | 234 | */ |
| 235 | - public function __construct($host = 'localhost', $port = 8180, $path = '/solr/', $httpTransport = false) |
|
| 235 | + public function __construct($host = 'localhost', $port = 8180, $path = '/solr/', $httpTransport = FALSE) |
|
| 236 | 236 | { |
| 237 | 237 | $this->setHost($host); |
| 238 | 238 | $this->setPort($port); |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $this->_threadsUrl = $this->_constructUrl(self::THREADS_SERVLET, array('wt' => self::SOLR_WRITER )); |
| 290 | 290 | $this->_updateUrl = $this->_constructUrl(self::UPDATE_SERVLET, array('wt' => self::SOLR_WRITER )); |
| 291 | 291 | |
| 292 | - $this->_urlsInited = true; |
|
| 292 | + $this->_urlsInited = TRUE; |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | protected function _generateQueryString($params) |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | // 5.1.2 the arg_separator parameter was not available, so don't use it |
| 308 | 308 | if ($this->_queryBracketsEscaped) |
| 309 | 309 | { |
| 310 | - $queryString = http_build_query($params, null, $this->_queryStringDelimiter); |
|
| 310 | + $queryString = http_build_query($params, NULL, $this->_queryStringDelimiter); |
|
| 311 | 311 | return preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $queryString); |
| 312 | 312 | } |
| 313 | 313 | else |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | public function getHttpTransport() |
| 475 | 475 | { |
| 476 | 476 | // lazy load a default if one has not be set |
| 477 | - if ($this->_httpTransport === false) |
|
| 477 | + if ($this->_httpTransport === FALSE) |
|
| 478 | 478 | { |
| 479 | 479 | require_once(dirname(__FILE__) . '/HttpTransport/FileGetContents.php'); |
| 480 | 480 | |
@@ -625,7 +625,7 @@ discard block |
||
| 625 | 625 | */ |
| 626 | 626 | public function ping($timeout = 2) |
| 627 | 627 | { |
| 628 | - $start = microtime(true); |
|
| 628 | + $start = microtime(TRUE); |
|
| 629 | 629 | |
| 630 | 630 | $httpTransport = $this->getHttpTransport(); |
| 631 | 631 | |
@@ -634,11 +634,11 @@ discard block |
||
| 634 | 634 | |
| 635 | 635 | if ($solrResponse->getHttpStatus() == 200) |
| 636 | 636 | { |
| 637 | - return microtime(true) - $start; |
|
| 637 | + return microtime(TRUE) - $start; |
|
| 638 | 638 | } |
| 639 | 639 | else |
| 640 | 640 | { |
| 641 | - return false; |
|
| 641 | + return FALSE; |
|
| 642 | 642 | } |
| 643 | 643 | } |
| 644 | 644 | |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | * |
| 682 | 682 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 683 | 683 | */ |
| 684 | - public function addDocument(Apache_Solr_Document $document, $allowDups = false, $overwritePending = true, $overwriteCommitted = true, $commitWithin = 0) |
|
| 684 | + public function addDocument(Apache_Solr_Document $document, $allowDups = FALSE, $overwritePending = TRUE, $overwriteCommitted = TRUE, $commitWithin = 0) |
|
| 685 | 685 | { |
| 686 | 686 | $dupValue = $allowDups ? 'true' : 'false'; |
| 687 | 687 | $pendingValue = $overwritePending ? 'true' : 'false'; |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | * |
| 710 | 710 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 711 | 711 | */ |
| 712 | - public function addDocuments($documents, $allowDups = false, $overwritePending = true, $overwriteCommitted = true, $commitWithin = 0) |
|
| 712 | + public function addDocuments($documents, $allowDups = FALSE, $overwritePending = TRUE, $overwriteCommitted = TRUE, $commitWithin = 0) |
|
| 713 | 713 | { |
| 714 | 714 | $dupValue = $allowDups ? 'true' : 'false'; |
| 715 | 715 | $pendingValue = $overwritePending ? 'true' : 'false'; |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | { |
| 743 | 743 | $xml = '<doc'; |
| 744 | 744 | |
| 745 | - if ($document->getBoost() !== false) |
|
| 745 | + if ($document->getBoost() !== FALSE) |
|
| 746 | 746 | { |
| 747 | 747 | $xml .= ' boost="' . $document->getBoost() . '"'; |
| 748 | 748 | } |
@@ -760,12 +760,12 @@ discard block |
||
| 760 | 760 | { |
| 761 | 761 | $xml .= '<field name="' . $key . '"'; |
| 762 | 762 | |
| 763 | - if ($fieldBoost !== false) |
|
| 763 | + if ($fieldBoost !== FALSE) |
|
| 764 | 764 | { |
| 765 | 765 | $xml .= ' boost="' . $fieldBoost . '"'; |
| 766 | 766 | |
| 767 | 767 | // only set the boost for the first field in the set |
| 768 | - $fieldBoost = false; |
|
| 768 | + $fieldBoost = FALSE; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | $multivalue = htmlspecialchars($multivalue, ENT_NOQUOTES, 'UTF-8'); |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | { |
| 778 | 778 | $xml .= '<field name="' . $key . '"'; |
| 779 | 779 | |
| 780 | - if ($fieldBoost !== false) |
|
| 780 | + if ($fieldBoost !== FALSE) |
|
| 781 | 781 | { |
| 782 | 782 | $xml .= ' boost="' . $fieldBoost . '"'; |
| 783 | 783 | } |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | * |
| 819 | 819 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 820 | 820 | */ |
| 821 | - public function commit($expungeDeletes = false, $waitFlush = true, $waitSearcher = true, $timeout = 3600) |
|
| 821 | + public function commit($expungeDeletes = FALSE, $waitFlush = TRUE, $waitSearcher = TRUE, $timeout = 3600) |
|
| 822 | 822 | { |
| 823 | 823 | $expungeValue = $expungeDeletes ? 'true' : 'false'; |
| 824 | 824 | $flushValue = $waitFlush ? 'true' : 'false'; |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | * |
| 856 | 856 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 857 | 857 | */ |
| 858 | - public function deleteById($id, $fromPending = true, $fromCommitted = true, $timeout = 3600) |
|
| 858 | + public function deleteById($id, $fromPending = TRUE, $fromCommitted = TRUE, $timeout = 3600) |
|
| 859 | 859 | { |
| 860 | 860 | $pendingValue = $fromPending ? 'true' : 'false'; |
| 861 | 861 | $committedValue = $fromCommitted ? 'true' : 'false'; |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | * |
| 880 | 880 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 881 | 881 | */ |
| 882 | - public function deleteByMultipleIds($ids, $fromPending = true, $fromCommitted = true, $timeout = 3600) |
|
| 882 | + public function deleteByMultipleIds($ids, $fromPending = TRUE, $fromCommitted = TRUE, $timeout = 3600) |
|
| 883 | 883 | { |
| 884 | 884 | $pendingValue = $fromPending ? 'true' : 'false'; |
| 885 | 885 | $committedValue = $fromCommitted ? 'true' : 'false'; |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | * |
| 911 | 911 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 912 | 912 | */ |
| 913 | - public function deleteByQuery($rawQuery, $fromPending = true, $fromCommitted = true, $timeout = 3600) |
|
| 913 | + public function deleteByQuery($rawQuery, $fromPending = TRUE, $fromCommitted = TRUE, $timeout = 3600) |
|
| 914 | 914 | { |
| 915 | 915 | $pendingValue = $fromPending ? 'true' : 'false'; |
| 916 | 916 | $committedValue = $fromCommitted ? 'true' : 'false'; |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | * |
| 942 | 942 | * @throws Apache_Solr_InvalidArgumentException if $file, $params, or $document are invalid. |
| 943 | 943 | */ |
| 944 | - public function extract($file, $params = array(), $document = null, $mimetype = 'application/octet-stream') |
|
| 944 | + public function extract($file, $params = array(), $document = NULL, $mimetype = 'application/octet-stream') |
|
| 945 | 945 | { |
| 946 | 946 | // check if $params is an array (allow null for default empty array) |
| 947 | 947 | if (!is_null($params)) |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | // read the contents of the file |
| 966 | 966 | $contents = @file_get_contents($file); |
| 967 | 967 | |
| 968 | - if ($contents !== false) |
|
| 968 | + if ($contents !== FALSE) |
|
| 969 | 969 | { |
| 970 | 970 | // add the resource.name parameter if not specified |
| 971 | 971 | if (!isset($params['resource.name'])) |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | * |
| 1003 | 1003 | * @todo Should be using multipart/form-data to post parameter values, but I could not get my implementation to work. Needs revisisted. |
| 1004 | 1004 | */ |
| 1005 | - public function extractFromString($data, $params = array(), $document = null, $mimetype = 'application/octet-stream') |
|
| 1005 | + public function extractFromString($data, $params = array(), $document = NULL, $mimetype = 'application/octet-stream') |
|
| 1006 | 1006 | { |
| 1007 | 1007 | // check if $params is an array (allow null for default empty array) |
| 1008 | 1008 | if (!is_null($params)) |
@@ -1030,7 +1030,7 @@ discard block |
||
| 1030 | 1030 | // check if we need to add a boost.* parameters |
| 1031 | 1031 | $fieldBoost = $document->getFieldBoost($field); |
| 1032 | 1032 | |
| 1033 | - if ($fieldBoost !== false) |
|
| 1033 | + if ($fieldBoost !== FALSE) |
|
| 1034 | 1034 | { |
| 1035 | 1035 | $params["boost.{$field}"] = $fieldBoost; |
| 1036 | 1036 | } |
@@ -1044,7 +1044,7 @@ discard block |
||
| 1044 | 1044 | $queryString = $this->_generateQueryString($params); |
| 1045 | 1045 | |
| 1046 | 1046 | // the file contents will be sent to SOLR as the POST BODY - we use application/octect-stream as default mimetype |
| 1047 | - return $this->_sendRawPost($this->_extractUrl . $this->_queryDelimiter . $queryString, $data, false, $mimetype); |
|
| 1047 | + return $this->_sendRawPost($this->_extractUrl . $this->_queryDelimiter . $queryString, $data, FALSE, $mimetype); |
|
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | /** |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | * |
| 1066 | 1066 | * @throws Apache_Solr_InvalidArgumentException if $url, $params, or $document are invalid. |
| 1067 | 1067 | */ |
| 1068 | - public function extractFromUrl($url, $params = array(), $document = null, $mimetype = 'application/octet-stream') |
|
| 1068 | + public function extractFromUrl($url, $params = array(), $document = NULL, $mimetype = 'application/octet-stream') |
|
| 1069 | 1069 | { |
| 1070 | 1070 | // check if $params is an array (allow null for default empty array) |
| 1071 | 1071 | if (!is_null($params)) |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | * |
| 1115 | 1115 | * @throws Apache_Solr_HttpTransportException If an error occurs during the service call |
| 1116 | 1116 | */ |
| 1117 | - public function optimize($waitFlush = true, $waitSearcher = true, $timeout = 3600) |
|
| 1117 | + public function optimize($waitFlush = TRUE, $waitSearcher = TRUE, $timeout = 3600) |
|
| 1118 | 1118 | { |
| 1119 | 1119 | $flushValue = $waitFlush ? 'true' : 'false'; |
| 1120 | 1120 | $searcherValue = $waitSearcher ? 'true' : 'false'; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @param float $timeout |
| 69 | 69 | * @return Apache_Solr_HttpTransport_Response HTTP response |
| 70 | 70 | */ |
| 71 | - public function performGetRequest($url, $timeout = false); |
|
| 71 | + public function performGetRequest($url, $timeout = FALSE); |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * Perform a HEAD HTTP operation with an optional timeout and return the response |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * @param float $timeout |
| 79 | 79 | * @return Apache_Solr_HttpTransport_Response HTTP response |
| 80 | 80 | */ |
| 81 | - public function performHeadRequest($url, $timeout = false); |
|
| 81 | + public function performHeadRequest($url, $timeout = FALSE); |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Perform a POST HTTP operation with an optional timeout and return the response |
@@ -90,5 +90,5 @@ discard block |
||
| 90 | 90 | * @param float $timeout |
| 91 | 91 | * @return Apache_Solr_HttpTransport_Response HTTP response |
| 92 | 92 | */ |
| 93 | - public function performPostRequest($url, $rawPost, $contentType, $timeout = false); |
|
| 93 | + public function performPostRequest($url, $rawPost, $contentType, $timeout = FALSE); |
|
| 94 | 94 | } |
| 95 | 95 | \ No newline at end of file |
@@ -72,13 +72,13 @@ discard block |
||
| 72 | 72 | // set common options that will not be changed during the session |
| 73 | 73 | curl_setopt_array($this->_curl, array( |
| 74 | 74 | // return the response body from curl_exec |
| 75 | - CURLOPT_RETURNTRANSFER => true, |
|
| 75 | + CURLOPT_RETURNTRANSFER => TRUE, |
|
| 76 | 76 | |
| 77 | 77 | // get the output as binary data |
| 78 | - CURLOPT_BINARYTRANSFER => true, |
|
| 78 | + CURLOPT_BINARYTRANSFER => TRUE, |
|
| 79 | 79 | |
| 80 | 80 | // we do not need the headers in the output, we get everything we need from curl_getinfo |
| 81 | - CURLOPT_HEADER => false |
|
| 81 | + CURLOPT_HEADER => FALSE |
|
| 82 | 82 | )); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | curl_close($this->_curl); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - public function performGetRequest($url, $timeout = false) |
|
| 94 | + public function performGetRequest($url, $timeout = FALSE) |
|
| 95 | 95 | { |
| 96 | 96 | // check the timeout value |
| 97 | - if ($timeout === false || $timeout <= 0.0) |
|
| 97 | + if ($timeout === FALSE || $timeout <= 0.0) |
|
| 98 | 98 | { |
| 99 | 99 | // use the default timeout |
| 100 | 100 | $timeout = $this->getDefaultTimeout(); |
@@ -103,10 +103,10 @@ discard block |
||
| 103 | 103 | // set curl GET options |
| 104 | 104 | curl_setopt_array($this->_curl, array( |
| 105 | 105 | // make sure we're returning the body |
| 106 | - CURLOPT_NOBODY => false, |
|
| 106 | + CURLOPT_NOBODY => FALSE, |
|
| 107 | 107 | |
| 108 | 108 | // make sure we're GET |
| 109 | - CURLOPT_HTTPGET => true, |
|
| 109 | + CURLOPT_HTTPGET => TRUE, |
|
| 110 | 110 | |
| 111 | 111 | // set the URL |
| 112 | 112 | CURLOPT_URL => $url, |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - public function performHeadRequest($url, $timeout = false) |
|
| 128 | + public function performHeadRequest($url, $timeout = FALSE) |
|
| 129 | 129 | { |
| 130 | 130 | // check the timeout value |
| 131 | - if ($timeout === false || $timeout <= 0.0) |
|
| 131 | + if ($timeout === FALSE || $timeout <= 0.0) |
|
| 132 | 132 | { |
| 133 | 133 | // use the default timeout |
| 134 | 134 | $timeout = $this->getDefaultTimeout(); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // set curl HEAD options |
| 138 | 138 | curl_setopt_array($this->_curl, array( |
| 139 | 139 | // this both sets the method to HEAD and says not to return a body |
| 140 | - CURLOPT_NOBODY => true, |
|
| 140 | + CURLOPT_NOBODY => TRUE, |
|
| 141 | 141 | |
| 142 | 142 | // set the URL |
| 143 | 143 | CURLOPT_URL => $url, |
@@ -156,10 +156,10 @@ discard block |
||
| 156 | 156 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - public function performPostRequest($url, $postData, $contentType, $timeout = false) |
|
| 159 | + public function performPostRequest($url, $postData, $contentType, $timeout = FALSE) |
|
| 160 | 160 | { |
| 161 | 161 | // check the timeout value |
| 162 | - if ($timeout === false || $timeout <= 0.0) |
|
| 162 | + if ($timeout === FALSE || $timeout <= 0.0) |
|
| 163 | 163 | { |
| 164 | 164 | // use the default timeout |
| 165 | 165 | $timeout = $this->getDefaultTimeout(); |
@@ -168,10 +168,10 @@ discard block |
||
| 168 | 168 | // set curl POST options |
| 169 | 169 | curl_setopt_array($this->_curl, array( |
| 170 | 170 | // make sure we're returning the body |
| 171 | - CURLOPT_NOBODY => false, |
|
| 171 | + CURLOPT_NOBODY => FALSE, |
|
| 172 | 172 | |
| 173 | 173 | // make sure we're POST |
| 174 | - CURLOPT_POST => true, |
|
| 174 | + CURLOPT_POST => TRUE, |
|
| 175 | 175 | |
| 176 | 176 | // set the URL |
| 177 | 177 | CURLOPT_URL => $url, |
@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | const SVN_ID = '$Id:$'; |
| 58 | 58 | |
| 59 | - public function performGetRequest($url, $timeout = false) |
|
| 59 | + public function performGetRequest($url, $timeout = FALSE) |
|
| 60 | 60 | { |
| 61 | 61 | // check the timeout value |
| 62 | - if ($timeout === false || $timeout <= 0.0) |
|
| 62 | + if ($timeout === FALSE || $timeout <= 0.0) |
|
| 63 | 63 | { |
| 64 | 64 | // use the default timeout |
| 65 | 65 | $timeout = $this->getDefaultTimeout(); |
@@ -70,13 +70,13 @@ discard block |
||
| 70 | 70 | // set curl GET options |
| 71 | 71 | curl_setopt_array($curl, array( |
| 72 | 72 | // return the response body from curl_exec |
| 73 | - CURLOPT_RETURNTRANSFER => true, |
|
| 73 | + CURLOPT_RETURNTRANSFER => TRUE, |
|
| 74 | 74 | |
| 75 | 75 | // get the output as binary data |
| 76 | - CURLOPT_BINARYTRANSFER => true, |
|
| 76 | + CURLOPT_BINARYTRANSFER => TRUE, |
|
| 77 | 77 | |
| 78 | 78 | // we do not need the headers in the output, we get everything we need from curl_getinfo |
| 79 | - CURLOPT_HEADER => false, |
|
| 79 | + CURLOPT_HEADER => FALSE, |
|
| 80 | 80 | |
| 81 | 81 | // set the URL |
| 82 | 82 | CURLOPT_URL => $url, |
@@ -98,10 +98,10 @@ discard block |
||
| 98 | 98 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - public function performHeadRequest($url, $timeout = false) |
|
| 101 | + public function performHeadRequest($url, $timeout = FALSE) |
|
| 102 | 102 | { |
| 103 | 103 | // check the timeout value |
| 104 | - if ($timeout === false || $timeout <= 0.0) |
|
| 104 | + if ($timeout === FALSE || $timeout <= 0.0) |
|
| 105 | 105 | { |
| 106 | 106 | // use the default timeout |
| 107 | 107 | $timeout = $this->getDefaultTimeout(); |
@@ -112,16 +112,16 @@ discard block |
||
| 112 | 112 | // set curl HEAD options |
| 113 | 113 | curl_setopt_array($curl, array( |
| 114 | 114 | // return the response body from curl_exec |
| 115 | - CURLOPT_RETURNTRANSFER => true, |
|
| 115 | + CURLOPT_RETURNTRANSFER => TRUE, |
|
| 116 | 116 | |
| 117 | 117 | // get the output as binary data |
| 118 | - CURLOPT_BINARYTRANSFER => true, |
|
| 118 | + CURLOPT_BINARYTRANSFER => TRUE, |
|
| 119 | 119 | |
| 120 | 120 | // we do not need the headers in the output, we get everything we need from curl_getinfo |
| 121 | - CURLOPT_HEADER => false, |
|
| 121 | + CURLOPT_HEADER => FALSE, |
|
| 122 | 122 | |
| 123 | 123 | // this both sets the method to HEAD and says not to return a body |
| 124 | - CURLOPT_NOBODY => true, |
|
| 124 | + CURLOPT_NOBODY => TRUE, |
|
| 125 | 125 | |
| 126 | 126 | // set the URL |
| 127 | 127 | CURLOPT_URL => $url, |
@@ -143,10 +143,10 @@ discard block |
||
| 143 | 143 | return new Apache_Solr_HttpTransport_Response($statusCode, $contentType, $responseBody); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - public function performPostRequest($url, $postData, $contentType, $timeout = false) |
|
| 146 | + public function performPostRequest($url, $postData, $contentType, $timeout = FALSE) |
|
| 147 | 147 | { |
| 148 | 148 | // check the timeout value |
| 149 | - if ($timeout === false || $timeout <= 0.0) |
|
| 149 | + if ($timeout === FALSE || $timeout <= 0.0) |
|
| 150 | 150 | { |
| 151 | 151 | // use the default timeout |
| 152 | 152 | $timeout = $this->getDefaultTimeout(); |
@@ -157,16 +157,16 @@ discard block |
||
| 157 | 157 | // set curl POST options |
| 158 | 158 | curl_setopt_array($curl, array( |
| 159 | 159 | // return the response body from curl_exec |
| 160 | - CURLOPT_RETURNTRANSFER => true, |
|
| 160 | + CURLOPT_RETURNTRANSFER => TRUE, |
|
| 161 | 161 | |
| 162 | 162 | // get the output as binary data |
| 163 | - CURLOPT_BINARYTRANSFER => true, |
|
| 163 | + CURLOPT_BINARYTRANSFER => TRUE, |
|
| 164 | 164 | |
| 165 | 165 | // we do not need the headers in the output, we get everything we need from curl_getinfo |
| 166 | - CURLOPT_HEADER => false, |
|
| 166 | + CURLOPT_HEADER => FALSE, |
|
| 167 | 167 | |
| 168 | 168 | // make sure we're POST |
| 169 | - CURLOPT_POST => true, |
|
| 169 | + CURLOPT_POST => TRUE, |
|
| 170 | 170 | |
| 171 | 171 | // set the URL |
| 172 | 172 | CURLOPT_URL => $url, |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * |
| 48 | 48 | * @var float |
| 49 | 49 | */ |
| 50 | - private $_defaultTimeout = false; |
|
| 50 | + private $_defaultTimeout = FALSE; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Get the current default timeout setting (initially the default_socket_timeout ini setting) |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function getDefaultTimeout() |
| 59 | 59 | { |
| 60 | 60 | // lazy load the default timeout from the ini settings |
| 61 | - if ($this->_defaultTimeout === false) |
|
| 61 | + if ($this->_defaultTimeout === FALSE) |
|
| 62 | 62 | { |
| 63 | 63 | $this->_defaultTimeout = (int) ini_get('default_socket_timeout'); |
| 64 | 64 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->_postContext = stream_context_create(); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - public function performGetRequest($url, $timeout = false) |
|
| 74 | + public function performGetRequest($url, $timeout = FALSE) |
|
| 75 | 75 | { |
| 76 | 76 | // set the timeout if specified |
| 77 | 77 | if ($timeout !== FALSE && $timeout > 0.0) |
@@ -91,13 +91,13 @@ discard block |
||
| 91 | 91 | // $http_response_headers will be updated by the call to file_get_contents later |
| 92 | 92 | // see http://us.php.net/manual/en/wrappers.http.php for documentation |
| 93 | 93 | // Unfortunately, it will still create a notice in analyzers if we don't set it here |
| 94 | - $http_response_header = null; |
|
| 95 | - $responseBody = @file_get_contents($url, false, $this->_getContext); |
|
| 94 | + $http_response_header = NULL; |
|
| 95 | + $responseBody = @file_get_contents($url, FALSE, $this->_getContext); |
|
| 96 | 96 | |
| 97 | 97 | return $this->_getResponseFromParts($responseBody, $http_response_header); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - public function performHeadRequest($url, $timeout = false) |
|
| 100 | + public function performHeadRequest($url, $timeout = FALSE) |
|
| 101 | 101 | { |
| 102 | 102 | stream_context_set_option($this->_headContext, array( |
| 103 | 103 | 'http' => array( |
@@ -123,13 +123,13 @@ discard block |
||
| 123 | 123 | // $http_response_headers will be updated by the call to file_get_contents later |
| 124 | 124 | // see http://us.php.net/manual/en/wrappers.http.php for documentation |
| 125 | 125 | // Unfortunately, it will still create a notice in analyzers if we don't set it here |
| 126 | - $http_response_header = null; |
|
| 127 | - $responseBody = @file_get_contents($url, false, $this->_headContext); |
|
| 126 | + $http_response_header = NULL; |
|
| 127 | + $responseBody = @file_get_contents($url, FALSE, $this->_headContext); |
|
| 128 | 128 | |
| 129 | 129 | return $this->_getResponseFromParts($responseBody, $http_response_header); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - public function performPostRequest($url, $rawPost, $contentType, $timeout = false) |
|
| 132 | + public function performPostRequest($url, $rawPost, $contentType, $timeout = FALSE) |
|
| 133 | 133 | { |
| 134 | 134 | stream_context_set_option($this->_postContext, array( |
| 135 | 135 | 'http' => array( |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | // $http_response_header will be updated by the call to file_get_contents later |
| 162 | 162 | // see http://us.php.net/manual/en/wrappers.http.php for documentation |
| 163 | 163 | // Unfortunately, it will still create a notice in analyzers if we don't set it here |
| 164 | - $http_response_header = null; |
|
| 165 | - $responseBody = @file_get_contents($url, false, $this->_postContext); |
|
| 164 | + $http_response_header = NULL; |
|
| 165 | + $responseBody = @file_get_contents($url, FALSE, $this->_postContext); |
|
| 166 | 166 | |
| 167 | 167 | // reset content of post context to reclaim memory |
| 168 | 168 | stream_context_set_option($this->_postContext, 'http', 'content', ''); |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | //Assume 0, false as defaults |
| 176 | 176 | $status = 0; |
| 177 | - $contentType = false; |
|
| 177 | + $contentType = FALSE; |
|
| 178 | 178 | |
| 179 | 179 | //iterate through headers for real status, type, and encoding |
| 180 | 180 | if (is_array($httpHeaders) && count($httpHeaders) > 0) |