/** * Initializes indexer for files */ public function __construct($pObj) { parent::__construct($pObj); // get extension configuration of ke_search $this->extConf = tx_kesearch_helper::getExtConf(); $this->fileInfo = GeneralUtility::makeInstance('tx_kesearch_lib_fileinfo'); }
/** * Construcor of this object */ public function __construct($pObj) { parent::__construct($pObj); $this->templavoilaIsLoaded = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('templavoila'); if ($this->templavoilaIsLoaded) { $enableFields = TYPO3\CMS\Backend\Utility\BackendUtility::BEenableFields('pages') . TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause('pages'); $row = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('uid,title', 'pages', 'pid = 0' . $enableFields); $GLOBALS['TT'] = new t3lib_timeTrackNull(); $GLOBALS['TSFE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tslib_fe', $GLOBALS['TYPO3_CONF_VARS'], $row['uid'], 0); $GLOBALS['TSFE']->sys_page = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('t3lib_pageSelect'); $GLOBALS['TSFE']->sys_page->init(TRUE); $GLOBALS['TSFE']->initTemplate(); // Filling the config-array, first with the main "config." part if (is_array($GLOBALS['TSFE']->tmpl->setup['config.'])) { $GLOBALS['TSFE']->config['config'] = $GLOBALS['TSFE']->tmpl->setup['config.']; } // override it with the page/type-specific "config." if (is_array($GLOBALS['TSFE']->pSetup['config.'])) { $GLOBALS['TSFE']->config['config'] = TYPO3\CMS\Core\Utility\GeneralUtility::array_merge_recursive_overrule($GLOBALS['TSFE']->config['config'], $GLOBALS['TSFE']->pSetup['config.']); } // generate basic rootline $GLOBALS['TSFE']->rootLine = array(0 => array('uid' => $row['uid'], 'title' => $row['title'])); $this->tv = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_templavoila_pi1'); } $this->counter = 0; foreach ($this->indexCTypes as $value) { $cTypes[] = 'CType="' . $value . '"'; } $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records $this->sysLanguages = TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); }
/** * Initializes indexer for files */ public function __construct($pObj) { parent::__construct($pObj); // get extension configuration of ke_search $this->extConf = tx_kesearch_helper::getExtConf(); if (TYPO3_VERSION_INTEGER >= 6002000) { $this->fileInfo = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_kesearch_lib_fileinfo'); } else { $this->fileInfo = t3lib_div::makeInstance('tx_kesearch_lib_fileinfo'); } }
/** * Test method getPidList * * @test */ public function getPidListTest() { // get the rootPage UID. In most cases it should have recursive child elements $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'pages', 'deleted=0 AND hidden=0 AND is_siteroot=1', '', '', '1'); if (count($rows) > 0) { $rootPage = $rows[0]['uid']; } else { $rootPage = 1; } $pidArray = $this->indexerTypes->getPidList($rootPage, '', 'tt_news'); // check if it is of type array $this->assertInternalType('array', $pidArray); // there should be at last 1 record $this->assertGreaterThanOrEqual(1, count($pidArray)); foreach ($pidArray as $pid) { $this->assertInternalType('integer', $pid); } $pidArray = $this->indexerTypes->getPidList('', $rootPage, 'tt_news'); // check if it is of type array $this->assertInternalType('array', $pidArray); // there should be 1 record $this->assertEquals(1, count($pidArray)); $this->assertInternalType('integer', $pidArray[0]); }
/** * Initializes indexer for tt_news */ public function __construct($pObj) { parent::__construct($pObj); }
/** * Constructor of this object */ public function __construct($pObj) { parent::__construct($pObj); // set content types which should be index, fall back to default if not defined if (empty($this->indexerConfig['contenttypes'])) { $content_types_temp = $this->defaultIndexCTypes; } else { $content_types_temp = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->indexerConfig['contenttypes']); } // create a mysql WHERE clause for the content element types $cTypes = array(); foreach ($content_types_temp as $value) { $cTypes[] = 'CType="' . $value . '"'; } $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records $this->sysLanguages = \TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); // make file repository /* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */ $this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); }
/** * Constructor of this object */ public function __construct($pObj) { parent::__construct($pObj); foreach ($this->indexCTypes as $value) { $cTypes[] = 'CType="' . $value . '"'; } $this->whereClauseForCType = implode(' OR ', $cTypes); // get all available sys_language_uid records if (TYPO3_VERSION_INTEGER >= 7000000) { $this->sysLanguages = \TYPO3\CMS\Backend\Utility\BackendUtility::getSystemLanguages(); } else { $this->sysLanguages = t3lib_BEfunc::getSystemLanguages(); } // make file repository instance only if TYPO3 version is >= 6.0 if (TYPO3_VERSION_INTEGER >= 6000000) { if (TYPO3_VERSION_INTEGER >= 6002000) { /* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */ $this->fileRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); } else { /* @var $this->fileRepository \TYPO3\CMS\Core\Resource\FileRepository */ $this->fileRepository = t3lib_div::makeInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository'); } } }