本文整理汇总了PHP中ApacheSolrForTypo3\Solr\Site::getLabel方法的典型用法代码示例。如果您正苦于以下问题:PHP Site::getLabel方法的具体用法?PHP Site::getLabel怎么用?PHP Site::getLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApacheSolrForTypo3\Solr\Site
的用法示例。
在下文中一共展示了Site::getLabel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAdditionalInformation
/**
* Returns some additional information about indexing progress, shown in
* the scheduler's task overview list.
*
* @return string Information to display
*/
public function getAdditionalInformation()
{
$message = 'Site: ' . $this->site->getLabel();
$failedItemsCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'tx_solr_indexqueue_item', 'root = ' . $this->site->getRootPageId() . ' AND errors != \'\'');
if ($failedItemsCount) {
$message .= ' Failures: ' . $failedItemsCount;
}
return $message;
}
示例2: getAdditionalInformation
/**
* This method is designed to return some additional information about the task,
* that may help to set it apart from other tasks from the same class
* This additional information is used - for example - in the Scheduler's BE module
* This method should be implemented in most task classes
*
* @return string Information to display
*/
public function getAdditionalInformation()
{
$information = '';
if ($this->site) {
$information = 'Site: ' . $this->site->getLabel();
}
if (!empty($this->indexingConfigurationsToReIndex)) {
$information .= ', Indexing Configurations: ' . implode(', ', $this->indexingConfigurationsToReIndex);
}
return $information;
}
示例3: logInitialization
protected function logInitialization($initializationQuery)
{
$solrConfiguration = $this->site->getSolrConfiguration();
$logSeverity = -1;
$logData = array('site' => $this->site->getLabel(), 'indexing configuration name' => $this->indexingConfigurationName, 'type' => $this->type, 'query' => $initializationQuery, 'rows' => $GLOBALS['TYPO3_DB']->sql_affected_rows());
if ($GLOBALS['TYPO3_DB']->sql_errno()) {
$logSeverity = 3;
$logData['error'] = $GLOBALS['TYPO3_DB']->sql_errno() . ': ' . $GLOBALS['TYPO3_DB']->sql_error();
}
if ($solrConfiguration['logging.']['indexing.']['indexQueueInitialization']) {
GeneralUtility::devLog('Index Queue initialized for indexing configuration ' . $this->indexingConfigurationName, 'solr', $logSeverity, $logData);
}
}
示例4: deleteItemsBySite
/**
* Removes all items of a certain site from the Index Queue. Accepts an
* optional parameter to limit the deleted items by indexing configuration.
*
* @param Site $site The site to remove items for.
* @param string $indexingConfigurationName Name of a specific indexing
* configuration
*/
public function deleteItemsBySite(Site $site, $indexingConfigurationName = '')
{
$rootPageConstraint = 'tx_solr_indexqueue_item.root = ' . $site->getRootPageId();
$indexingConfigurationConstraint = '';
if (!empty($indexingConfigurationName)) {
$indexingConfigurationConstraint = ' AND tx_solr_indexqueue_item.indexing_configuration = \'' . $indexingConfigurationName . '\'';
}
DatabaseUtility::transactionStart();
try {
// reset Index Queue
$result = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_solr_indexqueue_item', $rootPageConstraint . $indexingConfigurationConstraint);
if (!$result) {
throw new \RuntimeException('Failed to reset Index Queue for site ' . $site->getLabel(), 1412986560);
}
// reset Index Queue Properties
$indexQueuePropertyResetQuery = '
DELETE tx_solr_indexqueue_indexing_property.*
FROM tx_solr_indexqueue_indexing_property
INNER JOIN tx_solr_indexqueue_item
ON tx_solr_indexqueue_item.uid = tx_solr_indexqueue_indexing_property.item_id
AND ' . $rootPageConstraint . $indexingConfigurationConstraint;
$result = $GLOBALS['TYPO3_DB']->sql_query($indexQueuePropertyResetQuery);
if (!$result) {
throw new \RuntimeException('Failed to reset Index Queue properties for site ' . $site->getLabel(), 1412986604);
}
DatabaseUtility::transactionCommit();
} catch (\RuntimeException $e) {
DatabaseUtility::transactionRollback();
}
}