Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace ***\***\Scheduler;
- use TYPO3\CMS\Backend\Utility\BackendUtility;
- use TYPO3\CMS\Core\Utility\GeneralUtility;
- /**
- * This class provides an enhanced task for Solr that uses proper domains.
- *
- * @author Dmitry Dulepov <***@***.***>
- */
- class IndexTask extends \Tx_Solr_Scheduler_IndexQueueWorkerTask {
- /**
- * Executes the task.
- *
- * @return bool
- */
- public function execute() {
- $rootPageId = $this->site->getRootPageId();
- $domainRecords = BackendUtility::getRecordsByField('sys_domain', 'pid', $rootPageId, ' AND redirectTo=\'\' AND hidden=0', '', 'sorting');
- if (is_array($domainRecords)) {
- $domainRecord = reset($domainRecords);
- $_SERVER['HTTP_HOST'] = rtrim($domainRecord['domainName'], '/');
- /* ... some code here, specific to our package structure that you do not need */
- }
- return parent::execute();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement