本文整理汇总了PHP中Tx_Solr_Util::initializeTsfe方法的典型用法代码示例。如果您正苦于以下问题:PHP Tx_Solr_Util::initializeTsfe方法的具体用法?PHP Tx_Solr_Util::initializeTsfe怎么用?PHP Tx_Solr_Util::initializeTsfe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tx_Solr_Util
的用法示例。
在下文中一共展示了Tx_Solr_Util::initializeTsfe方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
Tx_Solr_Util::initializeTsfe('1');
$GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['targetPage'] = '0';
$GLOBALS['TSFE']->tmpl->setup['config.']['tx_realurl_enable'] = '0';
// setup up ts objects
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['detailPage'] = 5050;
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['renderObjects.'] = array('testContent' => 'TEXT', 'testContent.' => array('field' => 'argument_0'), 'testContent2' => 'TEXT', 'testContent2.' => array('field' => 'argument_1', 'stripHtml' => 1));
$this->fixtures = array('argument content', '<span>argument content with html</span>', 'third argument content');
$this->viewHelper = new Tx_Solr_viewhelper_Ts();
}
示例2: setUp
public function setUp()
{
Tx_Solr_Util::initializeTsfe('1');
$GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_solr.']['search.']['targetPage'] = '0';
$GLOBALS['TSFE']->tmpl->setup['config.']['tx_realurl_enable'] = '0';
$facetName = 'TestFacet';
$facetOptions = array('testoption' => 1);
$facetConfiguration = array('selectingSelectedFacetOptionRemovesFilter' => 0, 'renderingInstruction');
$parentPlugin = t3lib_div::makeInstance('Tx_Solr_PiResults_Results');
$parentPlugin->cObj = t3lib_div::makeInstance('tslib_cObj');
$parentPlugin->main('', array());
$query = t3lib_div::makeInstance('Tx_Solr_Query', array('test'));
$this->facetRenderer = t3lib_div::makeInstance('Tx_Solr_Facet_SimpleFacetRenderer', $facetName, $facetOptions, $facetConfiguration, $parentPlugin->getTemplate(), $query);
$this->facetRenderer->setLinkTargetPageId($parentPlugin->getLinkTargetPageId());
}
示例3: getConfigIndexEnableStatus
/**
* Checks whether config.index_enable is set to 1, otherwise indexing will
* not work.
*
* @return NULL|tx_reports_reports_status_Status An error status is returned for each site root page config.index_enable = 0.
*/
protected function getConfigIndexEnableStatus()
{
$status = NULL;
$rootPages = $this->getRootPages();
$rootPagesWithIndexingOff = array();
foreach ($rootPages as $rootPage) {
try {
Tx_Solr_Util::initializeTsfe($rootPage['uid']);
if (!$GLOBALS['TSFE']->config['config']['index_enable']) {
$rootPagesWithIndexingOff[] = $rootPage;
}
} catch (RuntimeException $rte) {
$rootPagesWithIndexingOff[] = $rootPage;
} catch (t3lib_error_http_ServiceUnavailableException $sue) {
if ($sue->getCode() == 1294587218) {
// No TypoScript template found, continue with next site
$rootPagesWithIndexingOff[] = $rootPage;
continue;
}
}
}
if (!empty($rootPagesWithIndexingOff)) {
foreach ($rootPagesWithIndexingOff as $key => $rootPageWithIndexingOff) {
$rootPagesWithIndexingOff[$key] = '[' . $rootPageWithIndexingOff['uid'] . '] ' . $rootPageWithIndexingOff['title'];
}
$status = t3lib_div::makeInstance('tx_reports_reports_status_Status', 'Page Indexing', 'Indexing is disabled', 'You need to set config.index_enable = 1 to allow page indexing.
The following sites were found with indexing disabled:
<ul><li>' . implode('</li><li>', $rootPagesWithIndexingOff) . '</li></ul>', tx_reports_reports_status_Status::ERROR);
}
return $status;
}
示例4: getFullItemRecord
/**
* Gets the full item record.
*
* This general record indexer simply gets the record from the item. Other
* more specialized indexers may provide more data for their specific item
* types.
*
* @param Tx_Solr_IndexQueue_Item $item The item to be indexed
* @param integer $language Language Id (sys_language.uid)
* @return array|NULL The full record with fields of data to be used for indexing or NULL to prevent an item from being indexed
*/
protected function getFullItemRecord(Tx_Solr_IndexQueue_Item $item, $language = 0)
{
$rootPageUid = $item->getRootPageUid();
$overlayIdentifier = $rootPageUid . '|' . $language;
if (!isset($this->sysLanguageOverlay[$overlayIdentifier])) {
Tx_Solr_Util::initializeTsfe($rootPageUid, $language);
$this->sysLanguageOverlay[$overlayIdentifier] = $GLOBALS['TSFE']->sys_language_contentOL;
}
$itemRecord = $item->getRecord();
if ($language > 0) {
$page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_pageSelect');
$page->init(FALSE);
$itemRecord = $page->getRecordOverlay($item->getType(), $itemRecord, $language, $this->sysLanguageOverlay[$rootPageUid . '|' . $language]);
}
if (!$itemRecord) {
$itemRecord = NULL;
}
/*
* Skip disabled records. This happens if the default language record
* is hidden but a certain translation isn't. Then the default language
* document appears here but must not be indexed.
*/
if (!empty($GLOBALS['TCA'][$item->getType()]['ctrl']['enablecolumns']['disabled']) && $itemRecord[$GLOBALS['TCA'][$item->getType()]['ctrl']['enablecolumns']['disabled']]) {
$itemRecord = NULL;
}
/*
* Skip translation mismatching records. Sometimes the requested language
* doesn't fit the returned language. This might happen with content fallback
* and is perfectly fine in general.
* But if the requested language doesn't match the returned language and
* the given record has no translation parent, the indexqueue_item most
* probably pointed to a non-translated language record that is dedicated
* to a very specific language. Now we have to avoid indexing this record
* into all language cores.
*/
$translationOriginalPointerField = 'l10n_parent';
if (!empty($GLOBALS['TCA'][$item->getType()]['ctrl']['transOrigPointerField'])) {
$translationOriginalPointerField = $GLOBALS['TCA'][$item->getType()]['ctrl']['transOrigPointerField'];
}
$languageField = $GLOBALS['TCA'][$item->getType()]['ctrl']['languageField'];
if ($itemRecord[$translationOriginalPointerField] == 0 && $this->sysLanguageOverlay[$overlayIdentifier] != 1 && !empty($languageField) && $itemRecord[$languageField] != $language && $itemRecord[$languageField] != '-1') {
$itemRecord = NULL;
}
if (!is_null($itemRecord)) {
$itemRecord['__solr_index_language'] = $language;
}
return $itemRecord;
}
示例5: getSysLanguageMode
/**
* Gets the site's config.sys_language_mode setting
*
* @return string The site's config.sys_language_mode
*/
public function getSysLanguageMode()
{
if (is_null($this->sysLanguageMode)) {
Tx_Solr_Util::initializeTsfe($this->getRootPageId());
$this->sysLanguageMode = $GLOBALS['TSFE']->sys_language_mode;
}
return $this->sysLanguageMode;
}