idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
37,100 | public function findSystemLanguages ( ) { $ languages = [ 0 ] ; $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ queryBuilder -> getRestrictions ( ) -> add ( GeneralUtility :: makeInstance ( HiddenRestriction :: class ) ) ; $ languageRecords = $ queryBuilder -> select ( 'uid' ) -> from ( $ this -> table ) -> execute ... | Finds the system s configured languages . |
37,101 | protected function register ( $ className , $ type , $ requiredBaseClass ) { if ( ! class_exists ( $ className ) ) { throw new \ InvalidArgumentException ( 'Class ' . $ className . ' does not exist.' , 1462883324 ) ; } if ( ! is_subclass_of ( $ className , $ requiredBaseClass ) ) { throw new \ InvalidArgumentException ... | Can be used to register an implementation in the classMap . |
37,102 | public function getAdditionalFields ( array & $ taskInfo , $ task , SchedulerModuleController $ schedulerModule ) { $ additionalFields = [ ] ; $ siteSelectorField = GeneralUtility :: makeInstance ( SiteSelectorField :: class ) ; if ( ! $ this -> isTaskInstanceofIndexQueueWorkerTask ( $ task ) ) { return $ additionalFie... | Used to define fields to provide the TYPO3 site to index and number of items to index per run when adding or editing a task . |
37,103 | public function validateAdditionalFields ( array & $ submittedData , SchedulerModuleController $ schedulerModule ) { $ result = false ; $ sites = $ this -> siteRepository -> getAvailableSites ( ) ; if ( array_key_exists ( $ submittedData [ 'site' ] , $ sites ) ) { $ result = true ; } $ submittedData [ 'documentsToIndex... | Checks any additional data that is relevant to this task . If the task class is not relevant the method is expected to return TRUE |
37,104 | private function passArgumentsToSubRequest ( CoreWidgetRequest $ subRequest ) { $ arguments = $ this -> getControllerContext ( ) -> getRequest ( ) -> getArguments ( ) ; if ( isset ( $ arguments ) ) { if ( isset ( $ arguments [ 'action' ] ) ) { $ subRequest -> setControllerActionName ( $ arguments [ 'action' ] ) ; unset... | Pass the arguments of the widget to the subrequest . |
37,105 | protected function parseLanguage ( \ stdClass $ schema ) { $ language = 'english' ; if ( ! is_object ( $ schema ) || ! isset ( $ schema -> fieldTypes ) ) { return $ language ; } foreach ( $ schema -> fieldTypes as $ fieldType ) { if ( $ fieldType -> name !== 'text' ) { continue ; } foreach ( $ fieldType -> queryAnalyze... | Extracts the language from a solr schema response . |
37,106 | public static function exportSynonymsToTxt ( array $ synonyms ) : string { if ( empty ( $ synonyms ) ) { throw new \ InvalidArgumentException ( 'Nothing to export!' , 1502978329 ) ; } $ contentLines = '' ; foreach ( $ synonyms as $ synonymBaseWord => $ synonymWords ) { $ contentLines .= $ synonymBaseWord . ' => ' . imp... | Export synonyms in plain text format |
37,107 | public static function importSynonymsFromPlainTextContents ( array $ synonymFileUpload ) : array { $ fileStream = new Stream ( $ synonymFileUpload [ 'tmp_name' ] ) ; $ fileLines = GeneralUtility :: trimExplode ( PHP_EOL , $ fileStream -> getContents ( ) , true ) ; $ synonymList = [ ] ; foreach ( $ fileLines as $ line )... | Read plain text synonym file and import these synonyms |
37,108 | protected static function convertSynonymFileLineForImport ( $ line , $ synonymList ) : array { $ lineParts = GeneralUtility :: trimExplode ( '=>' , $ line , true ) ; if ( isset ( $ lineParts [ 1 ] ) ) { $ baseWord = mb_strtolower ( $ lineParts [ 0 ] ) ; $ synonyms = GeneralUtility :: trimExplode ( ',' , mb_strtolower (... | Convert synonym file line for import |
37,109 | public function getSolrConnectionForNodes ( array $ readNodeConfiguration , array $ writeNodeConfiguration ) { $ connectionHash = md5 ( \ json_encode ( $ readNodeConfiguration ) . \ json_encode ( $ writeNodeConfiguration ) ) ; if ( ! isset ( self :: $ connections [ $ connectionHash ] ) ) { $ readNode = Node :: fromArra... | Creates a solr connection for read and write endpoints |
37,110 | public function getConnectionFromConfiguration ( array $ config ) { if ( empty ( $ config [ 'read' ] ) && ! empty ( $ config [ 'solrHost' ] ) ) { throw new \ InvalidArgumentException ( 'Invalid registry data please re-initialize your solr connections' ) ; } return $ this -> getSolrConnectionForNodes ( $ config [ 'read'... | Creates a solr configuration from the configuration array and returns it . |
37,111 | public function getConfigurationByPageId ( $ pageId , $ language = 0 , $ mount = '' ) { $ pageSelect = GeneralUtility :: makeInstance ( PageRepository :: class ) ; $ rootLine = GeneralUtility :: makeInstance ( Rootline :: class , $ pageSelect -> getRootLine ( $ pageId , $ mount ) ) ; $ siteRootPageId = $ rootLine -> ge... | Gets a Solr configuration for a page ID . |
37,112 | public function getConnectionByPageId ( $ pageId , $ language = 0 , $ mount = '' ) { $ solrConnections = $ this -> getConfigurationByPageId ( $ pageId , $ language , $ mount ) ; $ solrConnection = $ this -> getConnectionFromConfiguration ( $ solrConnections ) ; return $ solrConnection ; } | Gets a Solr connection for a page ID . |
37,113 | public function getConfigurationByRootPageId ( $ pageId , $ language = 0 ) { $ connectionKey = $ pageId . '|' . $ language ; $ solrServers = $ this -> getAllConfigurations ( ) ; if ( isset ( $ solrServers [ $ connectionKey ] ) ) { $ solrConfiguration = $ solrServers [ $ connectionKey ] ; } else { $ noSolrConnectionExce... | Gets a Solr configuration for a root page ID . |
37,114 | public function getConnectionByRootPageId ( $ pageId , $ language = 0 ) { $ config = $ this -> getConfigurationByRootPageId ( $ pageId , $ language ) ; $ solrConnection = $ this -> getConnectionFromConfiguration ( $ config ) ; return $ solrConnection ; } | Gets a Solr connection for a root page ID . |
37,115 | public function getAllConnections ( ) { $ solrConnections = [ ] ; $ solrConfigurations = $ this -> getAllConfigurations ( ) ; foreach ( $ solrConfigurations as $ solrConfiguration ) { $ solrConnections [ ] = $ this -> getConnectionFromConfiguration ( $ solrConfiguration ) ; } return $ solrConnections ; } | Gets all connections found . |
37,116 | public function getConfigurationsBySite ( Site $ site ) { $ solrConfigurations = [ ] ; $ allConfigurations = $ this -> getAllConfigurations ( ) ; foreach ( $ allConfigurations as $ configuration ) { if ( $ configuration [ 'rootPageUid' ] == $ site -> getRootPageId ( ) ) { $ solrConfigurations [ ] = $ configuration ; } ... | Gets all connection configurations for a given site . |
37,117 | public function getConnectionsBySite ( Site $ site ) { $ connections = [ ] ; $ solrServers = $ this -> getConfigurationsBySite ( $ site ) ; foreach ( $ solrServers as $ solrServer ) { $ connections [ ] = $ this -> getConnectionFromConfiguration ( $ solrServer ) ; } return $ connections ; } | Gets all connections configured for a given site . |
37,118 | public function updateConnections ( ) { $ solrConnections = $ this -> getConfiguredSolrConnections ( ) ; $ solrConnections = $ this -> filterDuplicateConnections ( $ solrConnections ) ; if ( ! empty ( $ solrConnections ) ) { $ this -> setAllConfigurations ( $ solrConnections ) ; } } | Updates the connections in the registry . |
37,119 | protected function getConfiguredSolrConnections ( ) { $ configuredSolrConnections = [ ] ; $ rootPages = $ this -> pagesRepositoryAtExtSolr -> findAllRootPages ( ) ; $ languages = $ this -> systemLanguageRepository -> findSystemLanguages ( ) ; foreach ( $ rootPages as $ rootPage ) { foreach ( $ languages as $ languageId... | Finds the configured Solr connections . Also respects multi - site environments . |
37,120 | protected function getConfiguredSolrConnectionByRootPage ( array $ rootPage , $ languageId ) { $ connection = [ ] ; $ languageId = ( int ) $ languageId ; GeneralUtility :: _GETset ( $ languageId , 'L' ) ; $ connectionKey = $ rootPage [ 'uid' ] . '|' . $ languageId ; $ pageSelect = GeneralUtility :: makeInstance ( PageR... | Gets the configured Solr connection for a specific root page and language ID . |
37,121 | protected function buildConnectionLabel ( array $ connection ) { return $ connection [ 'rootPageTitle' ] . ' (pid: ' . $ connection [ 'rootPageUid' ] . ', language: ' . $ this -> systemLanguageRepository -> findOneLanguageTitleByLanguageId ( $ connection [ 'language' ] ) . ') - Read node: ' . $ connection [ 'read' ] [ ... | Creates a human readable label from the connections configuration . |
37,122 | protected function filterDuplicateConnections ( array $ connections ) { $ hashedConnections = [ ] ; $ filteredConnections = [ ] ; foreach ( $ connections as $ key => $ connection ) { unset ( $ connection [ 'language' ] ) ; $ connectionHash = md5 ( implode ( '|' , $ connection ) ) ; $ hashedConnections [ $ key ] = $ con... | Filters duplicate connections . When detecting the configured connections this is done with a little brute force by simply combining all root pages with all languages this method filters out the duplicates . |
37,123 | public function indexAction ( ) { if ( $ this -> selectedSite === null || empty ( $ this -> solrConnectionManager -> getConnectionsBySite ( $ this -> selectedSite ) ) ) { $ this -> view -> assign ( 'can_not_proceed' , true ) ; } } | Index action shows an overview of available index maintenance operations . |
37,124 | public function emptyIndexAction ( ) { $ siteHash = $ this -> selectedSite -> getSiteHash ( ) ; try { $ affectedCores = [ ] ; $ solrServers = $ this -> solrConnectionManager -> getConnectionsBySite ( $ this -> selectedSite ) ; foreach ( $ solrServers as $ solrServer ) { $ writeService = $ solrServer -> getWriteService ... | Empties the site s indexes . |
37,125 | public function clearIndexQueueAction ( ) { $ this -> indexQueue -> deleteItemsBySite ( $ this -> selectedSite ) ; $ this -> addFlashMessage ( LocalizationUtility :: translate ( 'solr.backend.index_administration.success.queue_emptied' , 'Solr' , [ $ this -> selectedSite -> getLabel ( ) ] ) ) ; $ this -> redirectToRefe... | Empties the Index Queue |
37,126 | public function reloadIndexConfigurationAction ( ) { $ coresReloaded = true ; $ reloadedCores = [ ] ; $ solrServers = $ this -> solrConnectionManager -> getConnectionsBySite ( $ this -> selectedSite ) ; foreach ( $ solrServers as $ solrServer ) { $ coreAdmin = $ solrServer -> getAdminService ( ) ; $ coreReloaded = $ co... | Reloads the site s Solr cores . |
37,127 | protected function redirectToReferrerModule ( ) { $ wasFromQueue = $ this -> request -> hasArgument ( 'fromQueue' ) ; if ( ! $ wasFromQueue ) { $ this -> redirect ( 'index' ) ; return ; } $ backendUriBuilder = GeneralUtility :: makeInstance ( BackendUriBuilder :: class ) ; $ parameters = [ 'id' => $ this -> selectedPag... | Redirects to the referrer module index Action . |
37,128 | public function getFrequentSearchTerms ( ) : array { $ frequentSearchConfiguration = $ this -> configuration -> getSearchFrequentSearchesConfiguration ( ) ; $ identifier = $ this -> getCacheIdentifier ( $ frequentSearchConfiguration ) ; if ( $ this -> cache -> has ( $ identifier ) ) { $ terms = $ this -> cache -> get (... | Generates an array with terms and hits |
37,129 | protected function getFrequentSearchTermsFromStatistics ( array $ frequentSearchConfiguration ) : array { $ terms = [ ] ; if ( $ frequentSearchConfiguration [ 'select.' ] [ 'checkRootPageId' ] ) { $ checkRootPidWhere = 'root_pid = ' . $ this -> tsfe -> tmpl -> rootLine [ 0 ] [ 'uid' ] ; } else { $ checkRootPidWhere = '... | Gets frequent search terms from the statistics tracking table . |
37,130 | public function getSummary ( array $ parameters ) { $ this -> initialize ( $ parameters [ 'row' ] , $ parameters [ 'pObj' ] ) ; $ this -> addTargetPage ( ) ; $ this -> addSettingFromFlexForm ( 'Filter' , 'search.query.filter' ) ; $ this -> addSettingFromFlexForm ( 'Sorting' , 'search.query.sortBy' ) ; $ this -> addSett... | Returns information about a plugin s flexform configuration |
37,131 | protected function addTargetPage ( ) { $ targetPageId = $ this -> getFieldFromFlexform ( 'search.targetPage' ) ; if ( ! empty ( $ targetPageId ) ) { $ page = BackendUtility :: getRecord ( 'pages' , $ targetPageId , 'title' ) ; $ this -> settings [ 'Target Page' ] = '[' . ( int ) $ targetPageId . '] ' . $ page [ 'title'... | Adds the target page to the settings . |
37,132 | protected function getPluginLabel ( ) { $ label = BackendUtility :: getLabelFromItemListMerged ( $ this -> pluginContentElement [ 'pid' ] , 'tt_content' , 'list_type' , $ this -> pluginContentElement [ 'list_type' ] ) ; if ( ! empty ( $ label ) ) { $ label = $ this -> getLanguageService ( ) -> sL ( $ label ) ; } else {... | Returns the plugin label |
37,133 | public function getRootPageId ( ) { $ rootPageId = 0 ; if ( empty ( $ this -> rootLineArray ) ) { return $ rootPageId ; } foreach ( $ this -> rootLineArray as $ page ) { if ( Site :: isRootPage ( $ page ) ) { $ rootPageId = $ page [ 'uid' ] ; } } return $ rootPageId ; } | Returns the rootPageId as integer if a rootpage is given if non is given 0 will be returned |
37,134 | public function getParentPageIds ( ) { $ rootLineParentPageIds = [ ] ; if ( empty ( $ this -> rootLineArray ) ) { return $ rootLineParentPageIds ; } foreach ( $ this -> rootLineArray as $ pageRecord ) { $ rootLineParentPageIds [ ] = $ pageRecord [ 'uid' ] ; if ( Site :: isRootPage ( $ pageRecord ) ) { break ; } } retur... | Returns an array of the pageUids in the rootline . |
37,135 | protected function applyVersionSwap ( $ table , $ uid , DataHandler $ tceMain ) { $ isPageRelatedRecord = $ table === 'tt_content' || $ table === 'pages' ; if ( $ isPageRelatedRecord ) { $ uid = $ table === 'tt_content' ? $ this -> getValidatedPid ( $ tceMain , $ table , $ uid ) : $ uid ; $ this -> applyPageChangesToQu... | Apply s version swap to the IndexQueue . |
37,136 | protected function applyPageChangesToQueue ( $ uid ) { $ solrConfiguration = $ this -> getSolrConfigurationFromPageId ( $ uid ) ; $ record = $ this -> configurationAwareRecordService -> getRecord ( 'pages' , $ uid , $ solrConfiguration ) ; if ( ! empty ( $ record ) && $ this -> tcaService -> isEnabledRecord ( 'pages' ,... | Add s a page to the queue and updates mounts when it is enabled otherwise ensure that the page is removed from the queue . |
37,137 | protected function applyRecordChangesToQueue ( $ table , $ uid , $ pid ) { $ solrConfiguration = $ this -> getSolrConfigurationFromPageId ( $ pid ) ; $ isMonitoredTable = $ solrConfiguration -> getIndexQueueIsMonitoredTable ( $ table ) ; if ( $ isMonitoredTable ) { $ record = $ this -> configurationAwareRecordService -... | Add s a record to the queue if it is monitored and enabled otherwise it removes the record from the queue . |
37,138 | protected function skipMonitoringOfTable ( $ table ) { static $ configurationMonitorTables ; if ( empty ( $ configurationMonitorTables ) ) { $ configuration = GeneralUtility :: makeInstance ( ExtensionConfiguration :: class ) ; $ configurationMonitorTables = $ configuration -> getIsUseConfigurationMonitorTables ( ) ; }... | Check if the provided table is explicitly configured for monitoring |
37,139 | protected function processRecord ( $ recordTable , $ recordPageId , $ recordUid , $ fields ) { $ configurationPageId = $ this -> getConfigurationPageId ( $ recordTable , $ recordPageId , $ recordUid ) ; if ( $ configurationPageId === 0 ) { return ; } $ solrConfiguration = $ this -> getSolrConfigurationFromPageId ( $ co... | Process the record located in processDatamap_afterDatabaseOperations |
37,140 | protected function getConfigurationPageId ( $ recordTable , $ recordPageId , $ recordUid ) { $ rootPageId = $ this -> rootPageResolver -> getRootPageId ( $ recordPageId ) ; if ( $ this -> rootPageResolver -> getIsRootPageId ( $ rootPageId ) ) { return $ recordPageId ; } $ alternativeSiteRoots = $ this -> rootPageResolv... | This method is used to determine the pageId that should be used to retrieve the index queue configuration . |
37,141 | protected function getIsTranslationParentRecordEnabled ( $ recordTable , $ recordUid ) { $ tableEnableFields = implode ( ', ' , $ GLOBALS [ 'TCA' ] [ $ recordTable ] [ 'ctrl' ] [ 'enablecolumns' ] ) ; $ l10nParentRecord = ( array ) BackendUtility :: getRecord ( $ recordTable , $ recordUid , $ tableEnableFields , '' , f... | Checks if the parent record of the translated record is enabled . |
37,142 | protected function doPagesPostUpdateOperations ( array $ fields , $ recordUid ) { $ this -> updateCanonicalPages ( $ recordUid ) ; $ this -> mountPageUpdater -> update ( $ recordUid ) ; if ( $ this -> isRecursivePageUpdateRequired ( $ recordUid , $ fields ) ) { $ treePageIds = $ this -> getSubPageIds ( $ recordUid ) ; ... | Applies needed updates when a pages record was processed by the RecordMonitor . |
37,143 | protected function removeFromIndexAndQueue ( $ recordTable , $ recordUid ) { $ garbageCollector = GeneralUtility :: makeInstance ( GarbageCollector :: class ) ; $ garbageCollector -> collectGarbage ( $ recordTable , $ recordUid ) ; } | Removes record from the index queue and from the solr index |
37,144 | protected function removeFromIndexAndQueueWhenItemInQueue ( $ recordTable , $ recordUid ) { if ( ! $ this -> indexQueue -> containsItem ( $ recordTable , $ recordUid ) ) { return ; } $ this -> removeFromIndexAndQueue ( $ recordTable , $ recordUid ) ; } | Removes record from the index queue and from the solr index when the item is in the queue . |
37,145 | protected function updateCanonicalPages ( $ pageId ) { $ canonicalPages = $ this -> pagesRepository -> findPageUidsWithContentsFromPid ( ( int ) $ pageId ) ; foreach ( $ canonicalPages as $ page ) { $ this -> indexQueue -> updateItem ( 'pages' , $ page [ 'uid' ] ) ; } } | Triggers Index Queue updates for other pages showing content from the page currently being updated . |
37,146 | protected function getValidatedPid ( DataHandler $ tceMain , $ table , $ uid ) { $ pid = $ tceMain -> getPID ( $ table , $ uid ) ; if ( $ pid === false ) { throw new NoPidException ( 'Pid should not be false' ) ; } $ pid = intval ( $ pid ) ; return $ pid ; } | Retrieves the pid of a record and throws an exception when getPid returns false . |
37,147 | protected function getMappedFields ( Document $ pageDocument ) { $ fields = [ ] ; $ mappedFieldNames = $ this -> configuration -> getIndexQueueMappedFieldsByConfigurationName ( $ this -> pageIndexingConfigurationName ) ; foreach ( $ mappedFieldNames as $ mappedFieldName ) { if ( ! AbstractIndexer :: isAllowedToOverride... | Gets the mapped fields as an array mapping field names to values . |
37,148 | protected function resolveFieldValue ( $ solrFieldName , Document $ pageDocument ) { $ pageRecord = $ GLOBALS [ 'TSFE' ] -> page ; $ pageIndexingConfiguration = $ this -> configuration -> getIndexQueueFieldsConfigurationByConfigurationName ( $ this -> pageIndexingConfigurationName ) ; if ( isset ( $ pageIndexingConfigu... | Resolves a field mapping to its value depending on its configuration . |
37,149 | public function detailAction ( $ documentId = '' ) { try { $ document = $ this -> searchService -> getDocumentById ( $ documentId ) ; $ this -> view -> assign ( 'document' , $ document ) ; } catch ( SolrUnavailableException $ e ) { $ this -> handleSolrUnavailable ( ) ; } } | This action allows to render a detailView with data from solr . |
37,150 | protected function initializeSolrConnection ( ) { $ solr = GeneralUtility :: makeInstance ( ConnectionManager :: class ) -> getConnectionByPageId ( $ this -> page -> id , $ this -> page -> sys_language_uid ) ; if ( ! $ solr -> getWriteService ( ) -> ping ( ) ) { throw new \ Exception ( 'No Solr instance available while... | Initializes the Solr server connection . |
37,151 | public function setSolrConnection ( SolrConnection $ solrConnection ) { if ( ! $ solrConnection -> getWriteService ( ) -> ping ( ) ) { throw new \ Exception ( 'Could not connect to Solr server.' , 1323946472 ) ; } $ this -> solrConnection = $ solrConnection ; } | Allows to provide a Solr server connection other than the one initialized by the constructor . |
37,152 | public function indexPage ( ) { $ pageIndexed = false ; $ documents = [ ] ; if ( is_null ( $ this -> solrConnection ) ) { return $ pageIndexed ; } $ pageDocument = $ this -> getPageDocument ( ) ; $ pageDocument = $ this -> substitutePageDocument ( $ pageDocument ) ; $ this -> applyIndexPagePostProcessors ( $ pageDocume... | Indexes a page . |
37,153 | protected function getPageDocument ( ) { $ documentBuilder = GeneralUtility :: makeInstance ( Builder :: class ) ; $ document = $ documentBuilder -> fromPage ( $ this -> page , $ this -> pageUrl , $ this -> pageAccessRootline , ( string ) $ this -> mountPointParameter ) ; self :: $ pageSolrDocumentId = $ document [ 'id... | Builds the Solr document for the current page . |
37,154 | protected function substitutePageDocument ( Document $ pageDocument ) { if ( ! is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'Indexer' ] [ 'indexPageSubstitutePageDocument' ] ) ) { return $ pageDocument ; } $ indexConfigurationName = $ this -> getIndexConfigurationNameForCurrentPage ( ) ; foreac... | Allows third party extensions to replace or modify the page document created by this indexer . |
37,155 | protected function getAdditionalDocuments ( Document $ pageDocument , array $ existingDocuments ) { $ documents = $ existingDocuments ; if ( ! is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'Indexer' ] [ 'indexPageAddDocuments' ] ) ) { return $ documents ; } foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS... | Allows third party extensions to provide additional documents which should be indexed for the current page . |
37,156 | protected function processDocuments ( array $ documents ) { $ processingInstructions = $ this -> configuration -> getIndexFieldProcessingInstructionsConfiguration ( ) ; if ( count ( $ processingInstructions ) > 0 ) { $ service = GeneralUtility :: makeInstance ( Service :: class ) ; $ service -> processDocuments ( $ doc... | Sends the given documents to the field processing service which takes care of manipulating fields as defined in the field s configuration . |
37,157 | protected function addDocumentsToSolrIndex ( array $ documents ) { $ documentsAdded = false ; if ( ! count ( $ documents ) ) { return $ documentsAdded ; } try { $ this -> logger -> log ( SolrLogManager :: INFO , 'Adding ' . count ( $ documents ) . ' documents.' , $ documents ) ; $ documentChunks = array_chunk ( $ docum... | Adds the collected documents to the Solr index . |
37,158 | protected function isPageIndexable ( Item $ item ) { $ isIndexable = true ; $ record = $ item -> getRecord ( ) ; if ( isset ( $ GLOBALS [ 'TCA' ] [ 'pages' ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'disabled' ] ) && $ record [ $ GLOBALS [ 'TCA' ] [ 'pages' ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'disabled' ] ] ) { $ isIndexable = ... | Checks whether we can index this page . |
37,159 | protected function getSolrConnectionsByItem ( Item $ item ) { $ solrConnections = parent :: getSolrConnectionsByItem ( $ item ) ; $ page = $ item -> getRecord ( ) ; if ( $ page [ 'l18n_cfg' ] & 1 ) { unset ( $ solrConnections [ 0 ] ) ; } if ( GeneralUtility :: hideIfNotTranslated ( $ page [ 'l18n_cfg' ] ) ) { $ accessi... | Gets the Solr connections applicable for a page . |
37,160 | protected function getAccessGroupsFromContent ( Item $ item , $ language = 0 ) { static $ accessGroupsCache ; $ accessGroupsCacheEntryId = $ item -> getRecordUid ( ) . '|' . $ language ; if ( ! isset ( $ accessGroupsCache [ $ accessGroupsCacheEntryId ] ) ) { $ request = $ this -> buildBasePageIndexerRequest ( ) ; $ req... | Finds the FE user groups used on a page including all groups of content elements and groups of records of extensions that have correctly been pushed through ContentObjectRenderer during rendering . |
37,161 | protected function buildBasePageIndexerRequest ( ) { $ request = $ this -> getPageIndexerRequest ( ) ; $ request -> setParameter ( 'loggingEnabled' , $ this -> loggingEnabled ) ; if ( ! empty ( $ this -> options [ 'authorization.' ] ) ) { $ request -> setAuthorizationCredentials ( $ this -> options [ 'authorization.' ]... | Builds a base page indexer request with configured headers and other parameters . |
37,162 | protected function getDataUrl ( Item $ item , $ language = 0 ) { $ pageId = $ item -> getRecordUid ( ) ; $ strategy = $ this -> getUriStrategy ( $ pageId ) ; $ mountPointParameter = $ this -> getMountPageDataUrlParameter ( $ item ) ; $ dataUrl = $ strategy -> getPageIndexingUriFromPageItemAndLanguageId ( $ item , $ lan... | Determines a page ID s URL . |
37,163 | protected function indexPage ( Item $ item , $ language = 0 , $ userGroup = 0 ) { $ accessRootline = $ this -> getAccessRootline ( $ item , $ language , $ userGroup ) ; $ request = $ this -> buildBasePageIndexerRequest ( ) ; $ request -> setIndexQueueItem ( $ item ) ; $ request -> addAction ( 'indexPage' ) ; $ request ... | Creates a single Solr Document for a page in a specific language and for a specific frontend user group . |
37,164 | protected function getAccessRootline ( Item $ item , $ language = 0 , $ contentAccessGroup = null ) { static $ accessRootlineCache ; $ mountPointParameter = $ this -> getMountPageDataUrlParameter ( $ item ) ; $ accessRootlineCacheEntryId = $ item -> getRecordUid ( ) . '|' . $ language ; if ( $ mountPointParameter !== '... | Generates a page document s Access Rootline . |
37,165 | public function getResponsibleRootPageIds ( $ table , $ uid ) { $ cacheId = 'RootPageResolver' . '_' . 'getResponsibleRootPageIds' . '_' . $ table . '_' . $ uid ; $ methodResult = $ this -> runtimeCache -> get ( $ cacheId ) ; if ( ! empty ( $ methodResult ) ) { return $ methodResult ; } $ methodResult = $ this -> build... | This method determines the responsible site roots for a record by getting the rootPage of the record and checking if the pid is references in another site with additionalPageIds and returning those rootPageIds as well . The result is cached by the caching framework . |
37,166 | public function getIsRootPageId ( $ pageId ) { if ( $ pageId === 0 ) { return false ; } if ( $ pageId === - 1 ) { return false ; } $ cacheId = 'RootPageResolver' . '_' . 'getIsRootPageId' . '_' . $ pageId ; $ isSiteRoot = $ this -> runtimeCache -> get ( $ cacheId ) ; if ( ! empty ( $ isSiteRoot ) ) { return $ isSiteRoo... | Checks if the passed pageId is a root page . |
37,167 | public function getRootPageId ( $ pageId = 0 , $ forceFallback = false , $ mountPointIdentifier = '' ) { $ rootLine = GeneralUtility :: makeInstance ( Rootline :: class ) ; $ rootPageId = intval ( $ pageId ) ? : intval ( $ GLOBALS [ 'TSFE' ] -> id ) ; if ( ! empty ( $ GLOBALS [ 'TSFE' ] -> rootLine ) ) { $ rootLine -> ... | Determines the rootpage ID for a given page . |
37,168 | protected function buildResponsibleRootPageIds ( $ table , $ uid ) { $ rootPages = [ ] ; $ rootPageId = $ this -> getRootPageIdByTableAndUid ( $ table , $ uid ) ; if ( $ this -> getIsRootPageId ( $ rootPageId ) ) { $ rootPages [ ] = $ rootPageId ; } if ( $ this -> extensionConfiguration -> getIsUseConfigurationTrackRec... | This method determines the responsible site roots for a record by getting the rootPage of the record and checking if the pid is references in another site with additionalPageIds and returning those rootPageIds as well . |
37,169 | protected function getRootPageIdByTableAndUid ( $ table , $ uid ) { if ( $ table === 'pages' ) { $ rootPageId = $ this -> getRootPageId ( $ uid ) ; return $ rootPageId ; } else { $ recordPageId = $ this -> getRecordPageId ( $ table , $ uid ) ; $ rootPageId = $ this -> getRootPageId ( $ recordPageId , true ) ; return $ ... | This method checks if the record is a pages record or another one and determines the rootPageId from the records rootline . |
37,170 | protected function getRecordPageId ( $ table , $ uid ) { $ record = BackendUtility :: getRecord ( $ table , $ uid , 'pid' ) ; return ! empty ( $ record [ 'pid' ] ) ? ( int ) $ record [ 'pid' ] : 0 ; } | Returns the pageId of the record or 0 when no valid record was given . |
37,171 | public function getAlternativeSiteRootPagesIds ( $ table , $ uid , $ recordPageId ) { $ siteRootsByObservedPageIds = $ this -> getSiteRootsByObservedPageIds ( $ table , $ uid ) ; if ( ! isset ( $ siteRootsByObservedPageIds [ $ recordPageId ] ) ) { return [ ] ; } return $ siteRootsByObservedPageIds [ $ recordPageId ] ; ... | When no root page can be determined we check if the pageIdOf the record is configured as additionalPageId in the index configuration of another site if so we return the rootPageId of this site . The result is cached by the caching framework . |
37,172 | protected function getSiteRootsByObservedPageIds ( $ table , $ uid ) { $ cacheId = 'RootPageResolver' . '_' . 'getSiteRootsByObservedPageIds' . '_' . $ table . '_' . $ uid ; $ methodResult = $ this -> runtimeCache -> get ( $ cacheId ) ; if ( ! empty ( $ methodResult ) ) { return $ methodResult ; } $ methodResult = $ th... | Retrieves an optimized array structure we the monitored pageId as key and the relevant site rootIds as value . |
37,173 | protected function buildSiteRootsByObservedPageIds ( $ table , $ uid ) { $ siteRootByObservedPageIds = [ ] ; $ siteRepository = GeneralUtility :: makeInstance ( SiteRepository :: class ) ; $ allSites = $ siteRepository -> getAvailableSites ( ) ; foreach ( $ allSites as $ site ) { $ solrConfiguration = $ site -> getSolr... | This methods build an array with observer page id as key and rootPageIds as values to determine which root pages are responsible for this record by referencing the pageId in additionalPageIds configuration . |
37,174 | protected function getOneRowByUid ( $ fields , $ uid ) { $ queryBuilder = $ this -> getQueryBuilder ( ) ; return $ queryBuilder -> select ( $ fields ) -> from ( $ this -> table ) -> where ( $ queryBuilder -> expr ( ) -> eq ( 'uid' , intval ( $ uid ) ) ) -> execute ( ) -> fetch ( ) ; } | Retrieves a single row from the database by a given uid |
37,175 | public function count ( ) : int { return ( int ) $ this -> getQueryBuilder ( ) -> count ( '*' ) -> from ( $ this -> table ) -> execute ( ) -> fetchColumn ( 0 ) ; } | Returns current count of last searches |
37,176 | public function getConnectionForAllInTransactionInvolvedTables ( string ... $ tableNames ) : Connection { if ( empty ( $ tableNames ) || count ( $ tableNames ) < 2 ) { throw new \ InvalidArgumentException ( __METHOD__ . ' requires at least 2 table names.' , 1504801512 ) ; } if ( ! $ this -> isConnectionForAllTablesTheS... | Returns connection for all in transaction involved tables . |
37,177 | protected function isConnectionForAllTablesTheSame ( string ... $ tableNames ) : bool { $ connectionPool = GeneralUtility :: makeInstance ( ConnectionPool :: class ) ; $ connection = $ connectionPool -> getConnectionForTable ( array_shift ( $ tableNames ) ) ; foreach ( $ tableNames as $ tableName ) { $ connectionForTab... | Checks whether all table involved in transaction using same connection . |
37,178 | public function getStatus ( ) { $ reports = [ ] ; $ solrConnections = GeneralUtility :: makeInstance ( ConnectionManager :: class ) -> getAllConnections ( ) ; foreach ( $ solrConnections as $ solrConnection ) { $ adminService = $ solrConnection -> getAdminService ( ) ; if ( $ adminService -> ping ( ) && $ adminService ... | Compiles a collection of solrconfig version checks against each configured Solr server . Only adds an entry if a solrconfig other than the recommended one was found . |
37,179 | public function getPages ( $ rootPageId = 'SITE_ROOT' , $ maxDepth = 999 ) { $ pageIds = [ ] ; if ( $ rootPageId === 'SITE_ROOT' ) { $ rootPageId = ( int ) $ this -> rootPage [ 'uid' ] ; $ pageIds [ ] = $ rootPageId ; } $ configurationAwareRecordService = GeneralUtility :: makeInstance ( ConfigurationAwareRecordService... | Generates a list of page IDs in this site . Attention this includes all page types! Deleted pages are not included . |
37,180 | public function getSysLanguageMode ( $ languageUid = 0 ) { if ( ! is_null ( $ this -> sysLanguageMode ) ) { return $ this -> sysLanguageMode ; } try { Util :: initializeTsfe ( $ this -> getRootPageId ( ) , $ languageUid ) ; $ this -> sysLanguageMode = $ GLOBALS [ 'TSFE' ] -> sys_language_mode ; return $ this -> sysLang... | Gets the site s config . sys_language_mode setting |
37,181 | public static function getRootPageIdsFromSites ( array $ sites ) : array { $ rootPageIds = [ ] ; foreach ( $ sites as $ site ) { $ rootPageIds [ ] = ( int ) $ site -> getRootPageId ( ) ; } return $ rootPageIds ; } | Retrieves the rootPageIds as an array from a set of sites . |
37,182 | public function getSiteHashForDomain ( $ domain ) { static $ siteHashes = [ ] ; if ( isset ( $ siteHashes [ $ domain ] ) ) { return $ siteHashes [ $ domain ] ; } $ siteHashes [ $ domain ] = sha1 ( $ domain . $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'SYS' ] [ 'encryptionKey' ] . 'tx_solr' ) ; return $ siteHashes [ $ domain ] ;... | Gets the site hash for a domain |
37,183 | protected function getDomainListOfAllSites ( ) { $ sites = $ this -> getAvailableSites ( ) ; $ domains = [ ] ; foreach ( $ sites as $ site ) { $ domains [ ] = $ site -> getDomain ( ) ; } $ allowedSites = implode ( ',' , $ domains ) ; return $ allowedSites ; } | Returns a comma separated list of all domains from all sites . |
37,184 | public function getRecord ( ) { if ( empty ( $ this -> record ) ) { $ this -> record = ( array ) BackendUtility :: getRecord ( $ this -> type , $ this -> recordUid , '*' , '' , false ) ; } return $ this -> record ; } | Gets the item s full record . |
37,185 | public function storeIndexingProperties ( ) { $ this -> indexQueueIndexingPropertyRepository -> removeByRootPidAndIndexQueueUid ( intval ( $ this -> rootPageUid ) , intval ( $ this -> indexQueueUid ) ) ; if ( $ this -> hasIndexingProperties ( ) ) { $ this -> writeIndexingProperties ( ) ; } $ this -> queueItemRepository... | Stores the indexing properties . |
37,186 | protected function writeIndexingProperties ( ) { $ properties = [ ] ; foreach ( $ this -> indexingProperties as $ propertyKey => $ propertyValue ) { $ properties [ ] = [ 'root' => $ this -> rootPageUid , 'item_id' => $ this -> indexQueueUid , 'property_key' => $ propertyKey , 'property_value' => $ propertyValue ] ; } i... | Writes all indexing properties . |
37,187 | public function loadIndexingProperties ( ) { if ( $ this -> indexingPropertiesLoaded ) { return ; } $ indexingProperties = $ this -> indexQueueIndexingPropertyRepository -> findAllByIndexQueueUid ( intval ( $ this -> indexQueueUid ) ) ; $ this -> indexingPropertiesLoaded = true ; if ( empty ( $ indexingProperties ) ) {... | Loads the indexing properties for the item - if not already loaded . |
37,188 | public function setIndexingProperty ( $ key , $ value ) { $ this -> loadIndexingProperties ( ) ; $ key = ( string ) $ key ; if ( ! is_string ( $ value ) && ! is_int ( $ value ) && ! is_float ( $ value ) ) { throw new \ InvalidArgumentException ( 'Cannot set indexing property "' . $ key . '", its value must be string, i... | Sets an indexing property for the item . |
37,189 | public function deactivateTcaFrontendGroupEnableFields ( & $ parameters , $ parentObject ) { $ this -> originalTca = $ GLOBALS [ 'TCA' ] ; foreach ( $ GLOBALS [ 'TCA' ] as $ tableName => $ tableConfiguration ) { if ( isset ( $ GLOBALS [ 'TCA' ] [ $ tableName ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'fe_group' ] ) ) { unset (... | Deactivates the frontend user group fields in TCA so that no access restrictions apply during page rendering . |
37,190 | public function postProcessContentObjectInitialization ( ContentObjectRenderer & $ parentObject ) { if ( ! empty ( $ parentObject -> currentRecord ) ) { list ( $ table ) = explode ( ':' , $ parentObject -> currentRecord ) ; if ( ! empty ( $ table ) && $ table != 'pages' ) { $ this -> findFrontendGroups ( $ parentObject... | Hook for post processing the initialization of ContentObjectRenderer |
37,191 | protected function findFrontendGroups ( $ record , $ table ) { if ( $ this -> originalTca [ $ table ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'fe_group' ] ) { $ frontendGroups = $ record [ $ this -> originalTca [ $ table ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'fe_group' ] ] ; if ( empty ( $ frontendGroups ) ) { $ frontendGroups =... | Tracks user groups access restriction applied to records . |
37,192 | protected function getFrontendGroups ( ) { $ frontendGroupsList = implode ( ',' , $ this -> frontendGroups ) ; $ frontendGroups = GeneralUtility :: trimExplode ( ',' , $ frontendGroupsList , true ) ; $ frontendGroups = array_unique ( $ frontendGroups ) ; $ frontendGroups = array_values ( $ frontendGroups ) ; if ( empty... | Returns an array of user groups that have been tracked during page rendering . |
37,193 | public function getStatus ( ) { $ reports = [ ] ; $ solrConnections = GeneralUtility :: makeInstance ( ConnectionManager :: class ) -> getAllConnections ( ) ; foreach ( $ solrConnections as $ solrConnection ) { $ adminService = $ solrConnection -> getAdminService ( ) ; if ( $ adminService -> ping ( ) ) { $ installation... | Compiles a collection of solrconfig . xml checks against each configured Solr server . Only adds an entry if the Access Filter Query Parser Plugin is not configured . |
37,194 | protected function checkPluginInstallationStatus ( SolrAdminService $ adminService ) { if ( $ this -> isPluginInstalled ( $ adminService ) ) { return null ; } $ variables = [ 'solr' => $ adminService , 'recommendedVersion' => self :: RECOMMENDED_PLUGIN_VERSION ] ; $ report = $ this -> getRenderedReport ( 'AccessFilterP... | Checks whether the Solr plugin is installed . |
37,195 | protected function checkPluginVersion ( SolrAdminService $ adminService ) { if ( ! ( $ this -> isPluginInstalled ( $ adminService ) && $ this -> isPluginOutdated ( $ adminService ) ) ) { return null ; } $ version = $ this -> getInstalledPluginVersion ( $ adminService ) ; $ variables = [ 'solr' => $ adminService , 'inst... | Checks whether the Solr plugin version is up to date . |
37,196 | protected function isPluginInstalled ( SolrAdminService $ adminService ) { $ accessFilterQueryParserPluginInstalled = false ; $ pluginsInformation = $ adminService -> getPluginsInformation ( ) ; if ( isset ( $ pluginsInformation -> plugins -> OTHER -> { self :: PLUGIN_CLASS_NAME } ) ) { $ accessFilterQueryParserPluginI... | Checks whether the Access Filter Query Parser Plugin is installed for the given Solr server instance . |
37,197 | protected function isPluginOutdated ( SolrAdminService $ adminService ) { $ pluginVersion = $ this -> getInstalledPluginVersion ( $ adminService ) ; $ pluginVersionOutdated = version_compare ( $ pluginVersion , self :: RECOMMENDED_PLUGIN_VERSION , '<' ) ; return $ pluginVersionOutdated ; } | Checks whether the installed plugin is current . |
37,198 | public function getInstalledPluginVersion ( SolrAdminService $ adminService ) { $ pluginsInformation = $ adminService -> getPluginsInformation ( ) ; $ description = $ pluginsInformation -> plugins -> OTHER -> { self :: PLUGIN_CLASS_NAME } -> description ; $ matches = [ ] ; preg_match_all ( '/.*\(Version: (?<version>[^\... | Gets the version of the installed plugin . |
37,199 | public function findLastIndexedRow ( int $ rootPageId ) : array { $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ row = $ queryBuilder -> select ( 'uid' , 'indexed' ) -> from ( $ this -> table ) -> where ( $ queryBuilder -> expr ( ) -> eq ( 'root' , $ rootPageId ) ) -> andWhere ( $ queryBuilder -> expr ( ) -> neq ( ... | Fetches the last indexed row |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.