当前位置: 首页>>代码示例>>PHP>>正文


PHP Tx_Solr_Util::getSiteHashForDomain方法代码示例

本文整理汇总了PHP中Tx_Solr_Util::getSiteHashForDomain方法的典型用法代码示例。如果您正苦于以下问题:PHP Tx_Solr_Util::getSiteHashForDomain方法的具体用法?PHP Tx_Solr_Util::getSiteHashForDomain怎么用?PHP Tx_Solr_Util::getSiteHashForDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tx_Solr_Util的用法示例。


在下文中一共展示了Tx_Solr_Util::getSiteHashForDomain方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSiteHash

 /**
  * Generates the site's unique Site Hash.
  *
  * The Site Hash is build from the site's main domain, the system encryption
  * key, and the extension "tx_solr". These components are concatenated and
  * sha1-hashed.
  *
  * @return	string	Site Hash.
  */
 public function getSiteHash()
 {
     return Tx_Solr_Util::getSiteHashForDomain($this->getDomain());
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:13,代码来源:Site.php

示例2: setSiteHashFilter

 /**
  * Limits the query to certain sites
  *
  * @param string $allowedSites Comma-separated list of domains
  */
 public function setSiteHashFilter($allowedSites)
 {
     $allowedSites = t3lib_div::trimExplode(',', $allowedSites);
     $filters = array();
     foreach ($allowedSites as $site) {
         $siteHash = Tx_Solr_Util::getSiteHashForDomain($site);
         $filters[] = 'siteHash:"' . $siteHash . '"';
     }
     $this->addFilter(implode(' OR ', $filters));
 }
开发者ID:sfsmfc,项目名称:solr,代码行数:15,代码来源:Query.php

示例3: header

*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/*
	Provides the sitehash for a given domain, valid for the current TYPO3
	installation.
	Example: http://www.my-typo3-solr-installation.com/index.php?eID=tx_solr_api&api=siteHash&apiKey=<API key>&domain=www.domain-to-index.com
*/
use TYPO3\CMS\Core\Utility\HttpUtility;
$domain = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('domain');
$returnData = '';
if (!empty($domain)) {
    $siteHash = Tx_Solr_Util::getSiteHashForDomain($domain);
    $returnData = json_encode(array('sitehash' => $siteHash));
} else {
    header(HttpUtility::HTTP_STATUS_400);
    $errorMessage = 'You have to provide an existing domain, e.g. www.example.com.';
    $returnData = json_encode(array('errorMessage' => $errorMessage));
}
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Content-Type: application/json; charset=utf-8');
header('Content-Transfer-Encoding: 8bit');
header('Content-Length: ' . strlen($returnData));
echo $returnData;
开发者ID:romaincanon,项目名称:ext-solr,代码行数:31,代码来源:SiteHash.php

示例4: setSiteHashFilter

 /**
  * Limits the query to certain sites
  *
  * @param string $allowedSites Comma-separated list of domains
  */
 public function setSiteHashFilter($allowedSites)
 {
     $allowedSites = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $allowedSites);
     $filters = array();
     foreach ($allowedSites as $site) {
         $siteHash = Tx_Solr_Util::getSiteHashForDomain($site);
         $filters[] = 'siteHash:"' . $siteHash . '"';
     }
     $this->addFilter(implode(' OR ', $filters));
 }
开发者ID:punktDe,项目名称:solr,代码行数:15,代码来源:Query.php


注:本文中的Tx_Solr_Util::getSiteHashForDomain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。