@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | * LICENSE.txt file that was distributed with this source code. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | -if (!defined ('TYPO3_MODE')) die ('Access denied.'); |
|
| 12 | +if (!defined('TYPO3_MODE')) die ('Access denied.'); |
|
| 13 | 13 | |
| 14 | 14 | // Register plugins. |
| 15 | 15 | \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPItoST43($_EXTKEY, 'plugins/audioplayer/class.tx_dlf_audioplayer.php', '_audioplayer', 'list_type', TRUE); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/common/class.tx_dlf_document.php']['hookClass'][] = 'EXT:'.$_EXTKEY.'/hooks/class.tx_dlf_hacks.php:tx_dlf_hacks'; |
| 66 | 66 | |
| 67 | 67 | // Register command line scripts. |
| 68 | -$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$_EXTKEY] = array ('EXT:'.$_EXTKEY.'/cli/class.tx_dlf_cli.php', '_CLI_dlf'); |
|
| 68 | +$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$_EXTKEY] = array('EXT:'.$_EXTKEY.'/cli/class.tx_dlf_cli.php', '_CLI_dlf'); |
|
| 69 | 69 | |
| 70 | 70 | // Register AJAX eID handlers. |
| 71 | 71 | $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['tx_dlf_search_suggest'] = 'EXT:'.$_EXTKEY.'/plugins/search/class.tx_dlf_search_suggest.php'; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | $extensionPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('dlf'); |
| 13 | 13 | |
| 14 | -return array ( |
|
| 14 | +return array( |
|
| 15 | 15 | 'tx_dlf_cli' => $extensionPath.'cli/class.tx_dlf_cli.php', |
| 16 | 16 | 'tx_dlf_alto' => $extensionPath.'common/class.tx_dlf_alto.php', |
| 17 | 17 | 'tx_dlf_document' => $extensionPath.'common/class.tx_dlf_document.php', |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | 39 | // require Apache_Solr_HttpTransport_Response |
| 40 | -require_once(dirname(__FILE__) . '/Response.php'); |
|
| 40 | +require_once(dirname(__FILE__).'/Response.php'); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Interface that all Transport (HTTP Requester) implementations must implement. These |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | 39 | // Require Apache_Solr_HttpTransport_Abstract |
| 40 | -require_once(dirname(__FILE__) . '/Abstract.php'); |
|
| 40 | +require_once(dirname(__FILE__).'/Abstract.php'); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * HTTP Transport implemenation that uses the builtin http URL wrappers and file_get_contents |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | 39 | // Require Apache_Solr_HttpTransport_Abstract |
| 40 | -require_once(dirname(__FILE__) . '/Abstract.php'); |
|
| 40 | +require_once(dirname(__FILE__).'/Abstract.php'); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * A Curl based HTTP transport. Uses a single curl session for all requests. |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | 39 | // Require Apache_Solr_HttpTransport_Abstract |
| 40 | -require_once(dirname(__FILE__) . '/Abstract.php'); |
|
| 40 | +require_once(dirname(__FILE__).'/Abstract.php'); |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * An alternative Curl HTTP transport that opens and closes a curl session for |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | * @author Donovan Jimenez <[email protected]> |
| 37 | 37 | */ |
| 38 | 38 | |
| 39 | -require_once(dirname(__FILE__) . '/ParserException.php'); |
|
| 39 | +require_once(dirname(__FILE__).'/ParserException.php'); |
|
| 40 | 40 | |
| 41 | 41 | /** |
| 42 | 42 | * Represents a Solr response. Parses the raw response into a set of stdClass objects |
@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | // See Issue #1 (http://code.google.com/p/solr-php-client/issues/detail?id=1) |
| 40 | 40 | // Doesn't follow typical include path conventions, but is more convenient for users |
| 41 | -require_once(dirname(dirname(__FILE__)) . '/Service.php'); |
|
| 41 | +require_once(dirname(dirname(__FILE__)).'/Service.php'); |
|
| 42 | 42 | |
| 43 | -require_once(dirname(dirname(__FILE__)) . '/NoServiceAvailableException.php'); |
|
| 43 | +require_once(dirname(dirname(__FILE__)).'/NoServiceAvailableException.php'); |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Reference Implementation for using multiple Solr services in a distribution. Functionality |
@@ -72,10 +72,10 @@ discard block |
||
| 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 |
|
| 76 | - protected $_backoffLimit = 600; // 10 minute default maximum |
|
| 77 | - protected $_backoffEscalation = 2.0; // Rate at which to increase backoff period |
|
| 78 | - protected $_defaultBackoff = 2.0; // Default backoff interval |
|
| 75 | + protected $_useBackoff = false; // Set to true to use more resillient write server selection |
|
| 76 | + protected $_backoffLimit = 600; // 10 minute default maximum |
|
| 77 | + protected $_backoffEscalation = 2.0; // Rate at which to increase backoff period |
|
| 78 | + protected $_defaultBackoff = 2.0; // Default backoff interval |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * Escape a value for special query characters such as ':', '(', ')', '*', '?', etc. |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | */ |
| 159 | 159 | protected function _getServiceId($host, $port, $path) |
| 160 | 160 | { |
| 161 | - return $host . ':' . $port . $path; |
|
| 161 | + return $host.':'.$port.$path; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | { |
| 182 | 182 | if (isset($service['host']) && isset($service['port']) && isset($service['path'])) |
| 183 | 183 | { |
| 184 | - $id = $this->_getServiceId((string)$service['host'], (int)$service['port'], (string)$service['path']); |
|
| 184 | + $id = $this->_getServiceId((string) $service['host'], (int) $service['port'], (string) $service['path']); |
|
| 185 | 185 | |
| 186 | 186 | $this->_readableServices[$id] = $service; |
| 187 | 187 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | { |
| 212 | 212 | if (isset($service['host']) && isset($service['port']) && isset($service['path'])) |
| 213 | 213 | { |
| 214 | - $id = $this->_getServiceId((string)$service['host'], (int)$service['port'], (string)$service['path']); |
|
| 214 | + $id = $this->_getServiceId((string) $service['host'], (int) $service['port'], (string) $service['path']); |
|
| 215 | 215 | } |
| 216 | 216 | else |
| 217 | 217 | { |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | { |
| 250 | 250 | if (isset($service['host']) && isset($service['port']) && isset($service['path'])) |
| 251 | 251 | { |
| 252 | - $id = $this->_getServiceId((string)$service['host'], (int)$service['port'], (string)$service['path']); |
|
| 252 | + $id = $this->_getServiceId((string) $service['host'], (int) $service['port'], (string) $service['path']); |
|
| 253 | 253 | |
| 254 | 254 | $this->_writeableServices[$id] = $service; |
| 255 | 255 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | { |
| 280 | 280 | if (isset($service['host']) && isset($service['port']) && isset($service['path'])) |
| 281 | 281 | { |
| 282 | - $id = $this->_getServiceId((string)$service['host'], (int)$service['port'], (string)$service['path']); |
|
| 282 | + $id = $this->_getServiceId((string) $service['host'], (int) $service['port'], (string) $service['path']); |
|
| 283 | 283 | } |
| 284 | 284 | else |
| 285 | 285 | { |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | */ |
| 356 | 356 | protected function _selectWriteService($forceSelect = false) |
| 357 | 357 | { |
| 358 | - if($this->_useBackoff) |
|
| 358 | + if ($this->_useBackoff) |
|
| 359 | 359 | { |
| 360 | 360 | return $this->_selectWriteServiceSafe($forceSelect); |
| 361 | 361 | } |
@@ -435,12 +435,12 @@ discard block |
||
| 435 | 435 | |
| 436 | 436 | $backoff *= $this->_backoffEscalation; |
| 437 | 437 | |
| 438 | - if($backoff > $this->_backoffLimit) |
|
| 438 | + if ($backoff > $this->_backoffLimit) |
|
| 439 | 439 | { |
| 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 | { |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | // See Issue #1 (http://code.google.com/p/solr-php-client/issues/detail?id=1) |
| 40 | 40 | // Doesn't follow typical include path conventions, but is more convenient for users |
| 41 | -require_once(dirname(__FILE__) . '/Exception.php'); |
|
| 42 | -require_once(dirname(__FILE__) . '/HttpTransportException.php'); |
|
| 43 | -require_once(dirname(__FILE__) . '/InvalidArgumentException.php'); |
|
| 41 | +require_once(dirname(__FILE__).'/Exception.php'); |
|
| 42 | +require_once(dirname(__FILE__).'/HttpTransportException.php'); |
|
| 43 | +require_once(dirname(__FILE__).'/InvalidArgumentException.php'); |
|
| 44 | 44 | |
| 45 | -require_once(dirname(__FILE__) . '/Document.php'); |
|
| 46 | -require_once(dirname(__FILE__) . '/Response.php'); |
|
| 45 | +require_once(dirname(__FILE__).'/Document.php'); |
|
| 46 | +require_once(dirname(__FILE__).'/Response.php'); |
|
| 47 | 47 | |
| 48 | -require_once(dirname(__FILE__) . '/HttpTransport/Interface.php'); |
|
| 48 | +require_once(dirname(__FILE__).'/HttpTransport/Interface.php'); |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * Starting point for the Solr API. Represents a Solr server resource and has |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | */ |
| 221 | 221 | static public function phrase($value) |
| 222 | 222 | { |
| 223 | - return '"' . self::escapePhrase($value) . '"'; |
|
| 223 | + return '"'.self::escapePhrase($value).'"'; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /** |
@@ -264,17 +264,17 @@ discard block |
||
| 264 | 264 | |
| 265 | 265 | foreach ($params as $key => $value) |
| 266 | 266 | { |
| 267 | - $escapedParams[] = urlencode($key) . '=' . urlencode($value); |
|
| 267 | + $escapedParams[] = urlencode($key).'='.urlencode($value); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | - $queryString = $this->_queryDelimiter . implode($this->_queryStringDelimiter, $escapedParams); |
|
| 270 | + $queryString = $this->_queryDelimiter.implode($this->_queryStringDelimiter, $escapedParams); |
|
| 271 | 271 | } |
| 272 | 272 | else |
| 273 | 273 | { |
| 274 | 274 | $queryString = ''; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | - return 'http://' . $this->_host . ':' . $this->_port . $this->_path . $servlet . $queryString; |
|
| 277 | + return 'http://'.$this->_host.':'.$this->_port.$this->_path.$servlet.$queryString; |
|
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | /** |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | $this->_extractUrl = $this->_constructUrl(self::EXTRACT_SERVLET); |
| 287 | 287 | $this->_pingUrl = $this->_constructUrl(self::PING_SERVLET); |
| 288 | 288 | $this->_searchUrl = $this->_constructUrl(self::SEARCH_SERVLET); |
| 289 | - $this->_threadsUrl = $this->_constructUrl(self::THREADS_SERVLET, array('wt' => self::SOLR_WRITER )); |
|
| 290 | - $this->_updateUrl = $this->_constructUrl(self::UPDATE_SERVLET, array('wt' => self::SOLR_WRITER )); |
|
| 289 | + $this->_threadsUrl = $this->_constructUrl(self::THREADS_SERVLET, array('wt' => self::SOLR_WRITER)); |
|
| 290 | + $this->_updateUrl = $this->_constructUrl(self::UPDATE_SERVLET, array('wt' => self::SOLR_WRITER)); |
|
| 291 | 291 | |
| 292 | 292 | $this->_urlsInited = true; |
| 293 | 293 | } |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | { |
| 459 | 459 | $path = trim($path, '/'); |
| 460 | 460 | |
| 461 | - $this->_path = '/' . $path . '/'; |
|
| 461 | + $this->_path = '/'.$path.'/'; |
|
| 462 | 462 | |
| 463 | 463 | if ($this->_urlsInited) |
| 464 | 464 | { |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | // lazy load a default if one has not be set |
| 477 | 477 | if ($this->_httpTransport === false) |
| 478 | 478 | { |
| 479 | - require_once(dirname(__FILE__) . '/HttpTransport/FileGetContents.php'); |
|
| 479 | + require_once(dirname(__FILE__).'/HttpTransport/FileGetContents.php'); |
|
| 480 | 480 | |
| 481 | 481 | $this->_httpTransport = new Apache_Solr_HttpTransport_FileGetContents(); |
| 482 | 482 | } |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | |
| 745 | 745 | if ($document->getBoost() !== false) |
| 746 | 746 | { |
| 747 | - $xml .= ' boost="' . $document->getBoost() . '"'; |
|
| 747 | + $xml .= ' boost="'.$document->getBoost().'"'; |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | $xml .= '>'; |
@@ -758,11 +758,11 @@ discard block |
||
| 758 | 758 | { |
| 759 | 759 | foreach ($value as $multivalue) |
| 760 | 760 | { |
| 761 | - $xml .= '<field name="' . $key . '"'; |
|
| 761 | + $xml .= '<field name="'.$key.'"'; |
|
| 762 | 762 | |
| 763 | 763 | if ($fieldBoost !== false) |
| 764 | 764 | { |
| 765 | - $xml .= ' boost="' . $fieldBoost . '"'; |
|
| 765 | + $xml .= ' boost="'.$fieldBoost.'"'; |
|
| 766 | 766 | |
| 767 | 767 | // only set the boost for the first field in the set |
| 768 | 768 | $fieldBoost = false; |
@@ -770,21 +770,21 @@ discard block |
||
| 770 | 770 | |
| 771 | 771 | $multivalue = htmlspecialchars($multivalue, ENT_NOQUOTES, 'UTF-8'); |
| 772 | 772 | |
| 773 | - $xml .= '>' . $multivalue . '</field>'; |
|
| 773 | + $xml .= '>'.$multivalue.'</field>'; |
|
| 774 | 774 | } |
| 775 | 775 | } |
| 776 | 776 | else |
| 777 | 777 | { |
| 778 | - $xml .= '<field name="' . $key . '"'; |
|
| 778 | + $xml .= '<field name="'.$key.'"'; |
|
| 779 | 779 | |
| 780 | 780 | if ($fieldBoost !== false) |
| 781 | 781 | { |
| 782 | - $xml .= ' boost="' . $fieldBoost . '"'; |
|
| 782 | + $xml .= ' boost="'.$fieldBoost.'"'; |
|
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | $value = htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8'); |
| 786 | 786 | |
| 787 | - $xml .= '>' . $value . '</field>'; |
|
| 787 | + $xml .= '>'.$value.'</field>'; |
|
| 788 | 788 | } |
| 789 | 789 | } |
| 790 | 790 | |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | $flushValue = $waitFlush ? 'true' : 'false'; |
| 825 | 825 | $searcherValue = $waitSearcher ? 'true' : 'false'; |
| 826 | 826 | |
| 827 | - $rawPost = '<commit expungeDeletes="' . $expungeValue . '" waitFlush="' . $flushValue . '" waitSearcher="' . $searcherValue . '" />'; |
|
| 827 | + $rawPost = '<commit expungeDeletes="'.$expungeValue.'" waitFlush="'.$flushValue.'" waitSearcher="'.$searcherValue.'" />'; |
|
| 828 | 828 | |
| 829 | 829 | return $this->_sendRawPost($this->_updateUrl, $rawPost, $timeout); |
| 830 | 830 | } |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | //escape special xml characters |
| 864 | 864 | $id = htmlspecialchars($id, ENT_NOQUOTES, 'UTF-8'); |
| 865 | 865 | |
| 866 | - $rawPost = '<delete fromPending="' . $pendingValue . '" fromCommitted="' . $committedValue . '"><id>' . $id . '</id></delete>'; |
|
| 866 | + $rawPost = '<delete fromPending="'.$pendingValue.'" fromCommitted="'.$committedValue.'"><id>'.$id.'</id></delete>'; |
|
| 867 | 867 | |
| 868 | 868 | return $this->delete($rawPost, $timeout); |
| 869 | 869 | } |
@@ -884,14 +884,14 @@ discard block |
||
| 884 | 884 | $pendingValue = $fromPending ? 'true' : 'false'; |
| 885 | 885 | $committedValue = $fromCommitted ? 'true' : 'false'; |
| 886 | 886 | |
| 887 | - $rawPost = '<delete fromPending="' . $pendingValue . '" fromCommitted="' . $committedValue . '">'; |
|
| 887 | + $rawPost = '<delete fromPending="'.$pendingValue.'" fromCommitted="'.$committedValue.'">'; |
|
| 888 | 888 | |
| 889 | 889 | foreach ($ids as $id) |
| 890 | 890 | { |
| 891 | 891 | //escape special xml characters |
| 892 | 892 | $id = htmlspecialchars($id, ENT_NOQUOTES, 'UTF-8'); |
| 893 | 893 | |
| 894 | - $rawPost .= '<id>' . $id . '</id>'; |
|
| 894 | + $rawPost .= '<id>'.$id.'</id>'; |
|
| 895 | 895 | } |
| 896 | 896 | |
| 897 | 897 | $rawPost .= '</delete>'; |
@@ -918,7 +918,7 @@ discard block |
||
| 918 | 918 | // escape special xml characters |
| 919 | 919 | $rawQuery = htmlspecialchars($rawQuery, ENT_NOQUOTES, 'UTF-8'); |
| 920 | 920 | |
| 921 | - $rawPost = '<delete fromPending="' . $pendingValue . '" fromCommitted="' . $committedValue . '"><query>' . $rawQuery . '</query></delete>'; |
|
| 921 | + $rawPost = '<delete fromPending="'.$pendingValue.'" fromCommitted="'.$committedValue.'"><query>'.$rawQuery.'</query></delete>'; |
|
| 922 | 922 | |
| 923 | 923 | return $this->delete($rawPost, $timeout); |
| 924 | 924 | } |
@@ -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 | /** |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | $flushValue = $waitFlush ? 'true' : 'false'; |
| 1120 | 1120 | $searcherValue = $waitSearcher ? 'true' : 'false'; |
| 1121 | 1121 | |
| 1122 | - $rawPost = '<optimize waitFlush="' . $flushValue . '" waitSearcher="' . $searcherValue . '" />'; |
|
| 1122 | + $rawPost = '<optimize waitFlush="'.$flushValue.'" waitSearcher="'.$searcherValue.'" />'; |
|
| 1123 | 1123 | |
| 1124 | 1124 | return $this->_sendRawPost($this->_updateUrl, $rawPost, $timeout); |
| 1125 | 1125 | } |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | |
| 1168 | 1168 | if ($method == self::METHOD_GET) |
| 1169 | 1169 | { |
| 1170 | - return $this->_sendRawGet($this->_searchUrl . $this->_queryDelimiter . $queryString); |
|
| 1170 | + return $this->_sendRawGet($this->_searchUrl.$this->_queryDelimiter.$queryString); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | else if ($method == self::METHOD_POST) |
| 1173 | 1173 | { |