idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
36,900 | public function getVisibilityAffectingFieldsByTable ( $ table ) { if ( isset ( $ this -> visibilityAffectingFields [ $ table ] ) ) { return $ this -> visibilityAffectingFields [ $ table ] ; } $ fields = [ 'uid' , 'pid' ] ; if ( isset ( $ this -> tca [ $ table ] [ 'ctrl' ] [ 'enablecolumns' ] ) ) { $ fields = array_merg... | Compiles a list of visibility affecting fields of a table so that it can be used in SQL queries . |
36,901 | public function getHasConfigurationForField ( string $ tableName , string $ fieldName ) : bool { return isset ( $ this -> tca [ $ tableName ] [ 'columns' ] [ $ fieldName ] ) ; } | Checks if TCA is available for column by table |
36,902 | protected function sanitizeString ( $ string ) { $ string = HtmlContentExtractor :: cleanContent ( $ string ) ; $ string = html_entity_decode ( $ string , ENT_QUOTES , 'UTF-8' ) ; $ string = filter_var ( strip_tags ( $ string ) , FILTER_SANITIZE_STRING ) ; $ string = trim ( $ string ) ; return $ string ; } | Sanitizes a string |
36,903 | protected function applyIpMask ( string $ ip , int $ maskLength ) : string { if ( empty ( $ ip ) || $ maskLength === 0 ) { return $ ip ; } if ( filter_var ( $ ip , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ) ) { return $ this -> applyIpV4Mask ( $ ip , $ maskLength ) ; } return $ this -> applyIpV6Mask ( $ ip , $ maskLength ... | Internal function to mask portions of the visitor IP address |
36,904 | protected function applyIpV4Mask ( $ ip , $ maskLength ) { $ i = strlen ( $ ip ) ; if ( $ maskLength > $ i ) { $ maskLength = $ i ; } while ( $ maskLength -- > 0 ) { $ ip [ -- $ i ] = chr ( 0 ) ; } return ( string ) $ ip ; } | Apply a mask filter on the ip v4 address . |
36,905 | protected function applyIpV6Mask ( $ ip , $ maskLength ) : string { $ masks = [ 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff' , 'ffff:ffff:ffff:ffff::' , 'ffff:ffff:ffff:0000::' , 'ffff:ff00:0000:0000::' ] ; $ packedAddress = inet_pton ( $ masks [ $ maskLength ] ) ; $ binaryString = pack ( 'a16' , $ packedAddress ) ; retur... | Apply a mask filter on the ip v6 address . |
36,906 | protected function getRawOptions ( ResponseAdapter $ response , $ fieldName ) { $ options = [ ] ; foreach ( $ response -> facet_counts -> facet_queries as $ rawValue => $ count ) { if ( ( int ) $ count === 0 ) { continue ; } $ rawValue = preg_replace ( '/^\{!ex=[^\}]*\}(.*)/' , '\\1' , $ rawValue ) ; list ( $ field , $... | Get raw query options |
36,907 | public function getStatus ( ) { $ reports = [ ] ; $ connectionManager = GeneralUtility :: makeInstance ( ConnectionManager :: class ) ; $ solrConnections = $ connectionManager -> getAllConnections ( ) ; foreach ( $ solrConnections as $ solrConnection ) { $ adminService = $ solrConnection -> getAdminService ( ) ; if ( !... | Compiles a collection of schema version checks against each configured Solr server . Only adds an entry if a schema other than the recommended one was found . |
36,908 | public static function translateAndReplaceMarkers ( $ id , $ extensionName , $ arguments , $ languageKey , $ alternativeLanguageKeys ) { $ result = LocalizationUtility :: translate ( $ id , $ extensionName , $ arguments , $ languageKey , $ alternativeLanguageKeys ) ; $ result = self :: replaceTranslationPrefixesWithAtW... | Wrapper call to static LocalizationUtility |
36,909 | public function render ( ) { $ pageUid = $ this -> arguments [ 'pageUid' ] ; if ( $ pageUid === null && ! empty ( $ this -> getTypoScriptConfiguration ( ) -> getSearchTargetPage ( ) ) ) { $ pageUid = $ this -> getTypoScriptConfiguration ( ) -> getSearchTargetPage ( ) ; } $ uri = $ this -> buildUriFromPageUidAndArgument... | Render search form tag |
36,910 | public function findOneClosestPageIdWithActiveTemplateByRootLine ( array $ rootLine ) { $ rootLinePageIds = [ 0 ] ; foreach ( $ rootLine as $ rootLineItem ) { $ rootLinePageIds [ ] = ( int ) $ rootLineItem [ 'uid' ] ; } $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ result = $ queryBuilder -> select ( 'uid' , 'pid'... | Finds a first closest page id with active template . |
36,911 | public function process ( SearchResultSet $ resultSet ) { if ( ! $ resultSet instanceof SearchResultSet ) { return $ resultSet ; } $ resultSet = $ this -> parseSpellCheckingResponseIntoObjects ( $ resultSet ) ; $ resultSet = $ this -> parseSortingIntoObjects ( $ resultSet ) ; $ resultSet = $ this -> parseFacetsIntoObje... | The implementation can be used to influence a SearchResultSet that is created and processed in the SearchResultSetService . |
36,912 | private function parseFacetsIntoObjects ( SearchResultSet $ resultSet ) { if ( ! $ resultSet -> getUsedSearchRequest ( ) || ! $ resultSet -> getUsedSearchRequest ( ) -> getContextTypoScriptConfiguration ( ) ) { return $ resultSet ; } $ response = $ resultSet -> getResponse ( ) ; if ( ! is_object ( $ response -> facet_c... | Parse available facets into objects |
36,913 | public function getAvailableSitesSelector ( $ selectorName , Site $ selectedSite = null ) { $ siteRepository = GeneralUtility :: makeInstance ( SiteRepository :: class ) ; $ sites = $ siteRepository -> getAvailableSites ( ) ; $ selector = '<select name="' . htmlspecialchars ( $ selectorName ) . '" class="form-control">... | Creates a dropdown selector of available TYPO3 sites with Solr configured . |
36,914 | public static function clean ( $ string ) : string { $ string = trim ( $ string ) ; $ string = htmlspecialchars ( $ string ) ; return $ string ; } | Applies trim and htmlspecialchars on the querystring to use it as output . |
36,915 | protected static function tokenizeByQuotesAndEscapeDependingOnContext ( $ string ) { $ result = '' ; $ quotesCount = substr_count ( $ string , '"' ) ; $ isEvenAmountOfQuotes = $ quotesCount % 2 === 0 ; $ segments = explode ( '"' , $ string ) ; $ segmentsIndex = 0 ; foreach ( $ segments as $ segment ) { $ isInQuote = $ ... | This method is used to escape the content in the query string surrounded by quotes different then when it is not in a quoted context . |
36,916 | public function getLastSearches ( ) { $ lastSearchesKeywords = [ ] ; $ mode = $ this -> configuration -> getSearchLastSearchesMode ( ) ; $ limit = $ this -> configuration -> getSearchLastSearchesLimit ( ) ; switch ( $ mode ) { case 'user' : $ lastSearchesKeywords = $ this -> getLastSearchesFromSession ( $ limit ) ; bre... | Retrieves the last searches from the session or database depending on the configuration . |
36,917 | public function addToLastSearches ( $ keywords ) { $ mode = $ this -> configuration -> getSearchLastSearchesMode ( ) ; switch ( $ mode ) { case 'user' : $ this -> storeKeywordsToSession ( $ keywords ) ; break ; case 'global' : $ this -> lastSearchesRepository -> add ( $ keywords , ( int ) $ this -> configuration -> get... | Saves the keywords to the last searches in the database or session depending on the configuration . |
36,918 | protected function getLastSearchesFromSession ( $ limit ) { $ lastSearches = $ this -> session -> getLastSearches ( ) ; $ lastSearches = array_slice ( array_reverse ( array_unique ( $ lastSearches ) ) , 0 , $ limit ) ; return $ lastSearches ; } | Gets the last searched keywords from the user s session |
36,919 | protected function storeKeywordsToSession ( $ keywords ) { $ currentLastSearches = $ this -> session -> getLastSearches ( ) ; $ lastSearches = $ currentLastSearches ; $ newLastSearchesCount = array_push ( $ lastSearches , $ keywords ) ; while ( $ newLastSearchesCount > $ this -> configuration -> getSearchLastSearchesLi... | Stores the keywords from the current query to the user s session . |
36,920 | public function getStatus ( ) { $ reports = [ ] ; $ solrConnections = GeneralUtility :: makeInstance ( ConnectionManager :: class ) -> getAllConnections ( ) ; foreach ( $ solrConnections as $ solrConnection ) { $ coreAdmin = $ solrConnection -> getAdminService ( ) ; if ( ! $ coreAdmin -> ping ( ) ) { $ url = $ coreAdmi... | Compiles a version check against each configured Solr server . |
36,921 | protected function getCleanSolrVersion ( $ solrVersion ) { $ explodedSolrVersion = explode ( '.' , $ solrVersion ) ; $ shortSolrVersion = $ explodedSolrVersion [ 0 ] . '.' . $ explodedSolrVersion [ 1 ] . '.' . $ explodedSolrVersion [ 2 ] ; return $ shortSolrVersion ; } | Gets the clean Solr version in case of a custom build which may have additional information in the version string . |
36,922 | public function decode ( $ hierarchy , array $ configuration = [ ] ) { $ escapedHierarchy = HierarchyTool :: substituteSlashes ( $ hierarchy ) ; $ escapedHierarchy = substr ( $ escapedHierarchy , 1 ) ; $ escapedHierarchy = rtrim ( $ escapedHierarchy , '/' ) ; $ hierarchyItems = explode ( self :: DELIMITER , $ escapedHi... | Parses the given hierarchy filter and returns a Solr filter query . |
36,923 | public function processDocuments ( array $ documents , array $ processingConfiguration ) { foreach ( $ documents as $ document ) { $ this -> processDocument ( $ document , $ processingConfiguration ) ; } } | Modifies a list of documents |
36,924 | public function processDocument ( Document $ document , array $ processingConfiguration ) { foreach ( $ processingConfiguration as $ fieldName => $ instruction ) { $ fieldValue = $ document [ $ fieldName ] ?? false ; $ isSingleValueField = false ; if ( $ fieldValue !== false ) { if ( ! is_array ( $ fieldValue ) ) { $ f... | modifies a document according to the given configuration |
36,925 | public function cObjGetSingleExt ( $ name , array $ configuration , $ TyposcriptKey , $ contentObject ) { $ data = '' ; if ( isset ( $ configuration [ 'value' ] ) ) { $ data = $ configuration [ 'value' ] ; unset ( $ configuration [ 'value' ] ) ; } if ( ! empty ( $ configuration ) ) { $ data = $ contentObject -> stdWrap... | Executes the SOLR_MULTIVALUE content object . |
36,926 | public function getPluginsInformation ( ) { if ( count ( $ this -> pluginsData ) == 0 ) { $ url = $ this -> _constructUrl ( self :: PLUGINS_SERVLET , [ 'wt' => 'json' ] ) ; $ pluginsInformation = $ this -> _sendRawGet ( $ url ) ; $ pluginsInformation -> responseHeader ; $ this -> pluginsData = $ pluginsInformation ; } ... | Gets information about the plugins installed in Solr |
36,927 | public function getLukeMetaData ( $ numberOfTerms = 0 ) { if ( ! isset ( $ this -> lukeData [ $ numberOfTerms ] ) ) { $ lukeUrl = $ this -> _constructUrl ( self :: LUKE_SERVLET , [ 'numTerms' => $ numberOfTerms , 'wt' => 'json' , 'fl' => '*' ] ) ; $ this -> lukeData [ $ numberOfTerms ] = $ this -> _sendRawGet ( $ lukeU... | Retrieves meta data about the index from the luke request handler |
36,928 | public function getSystemInformation ( ) { if ( empty ( $ this -> systemData ) ) { $ systemInformation = $ this -> system ( ) ; $ systemInformation -> responseHeader ; $ this -> systemData = $ systemInformation ; } return $ this -> systemData ; } | Gets information about the Solr server |
36,929 | public function getSolrconfigName ( ) { if ( is_null ( $ this -> solrconfigName ) ) { $ solrconfigXmlUrl = $ this -> _constructUrl ( self :: FILE_SERVLET , [ 'file' => 'solrconfig.xml' ] ) ; $ response = $ this -> _sendRawGet ( $ solrconfigXmlUrl ) ; $ solrconfigXml = simplexml_load_string ( $ response -> getRawRespons... | Gets the name of the solrconfig . xml file installed and in use on the Solr server . |
36,930 | public function reloadCoreByName ( $ coreName ) { $ coreAdminReloadUrl = $ this -> _constructUrl ( self :: CORES_SERVLET ) . '?action=reload&core=' . $ coreName ; $ response = $ this -> _sendRawGet ( $ coreAdminReloadUrl ) ; return $ response ; } | Reloads a core of the connection by a given corename . |
36,931 | public function getSchema ( ) { if ( $ this -> schema !== null ) { return $ this -> schema ; } $ response = $ this -> _sendRawGet ( $ this -> _constructUrl ( self :: SCHEMA_SERVLET ) ) ; $ this -> schema = $ this -> schemaParser -> parseJson ( $ response -> getRawResponse ( ) ) ; return $ this -> schema ; } | Get the configured schema for the current core . |
36,932 | public function getSynonyms ( $ baseWord = '' ) { $ this -> initializeSynonymsUrl ( ) ; $ synonymsUrl = $ this -> _synonymsUrl ; if ( ! empty ( $ baseWord ) ) { $ synonymsUrl .= '/' . $ baseWord ; } $ response = $ this -> _sendRawGet ( $ synonymsUrl ) ; return $ this -> synonymParser -> parseJson ( $ baseWord , $ respo... | Get currently configured synonyms |
36,933 | public function addSynonym ( $ baseWord , array $ synonyms ) { $ this -> initializeSynonymsUrl ( ) ; $ json = $ this -> synonymParser -> toJson ( $ baseWord , $ synonyms ) ; $ response = $ this -> _sendRawPost ( $ this -> _synonymsUrl , $ json , 'application/json' ) ; return $ response ; } | Add list of synonyms for base word to managed synonyms map |
36,934 | public function deleteSynonym ( $ baseWord ) { $ this -> initializeSynonymsUrl ( ) ; if ( empty ( $ baseWord ) ) { throw new \ InvalidArgumentException ( 'Must provide base word.' ) ; } $ response = $ this -> _sendRawDelete ( $ this -> _synonymsUrl . '/' . urlencode ( $ baseWord ) ) ; return $ response ; } | Remove a synonym from the synonyms map |
36,935 | public function getStopWords ( ) { $ this -> initializeStopWordsUrl ( ) ; $ response = $ this -> _sendRawGet ( $ this -> _stopWordsUrl ) ; return $ this -> stopWordParser -> parseJson ( $ response -> getRawResponse ( ) ) ; } | Get currently configured stop words |
36,936 | public function addStopWords ( $ stopWords ) { $ this -> initializeStopWordsUrl ( ) ; $ json = $ this -> stopWordParser -> toJson ( $ stopWords ) ; return $ this -> _sendRawPost ( $ this -> _stopWordsUrl , $ json , 'application/json' ) ; } | Adds stop words to the managed stop word list |
36,937 | public function deleteStopWord ( $ stopWord ) { $ this -> initializeStopWordsUrl ( ) ; if ( empty ( $ stopWord ) ) { throw new \ InvalidArgumentException ( 'Must provide stop word.' ) ; } return $ this -> _sendRawDelete ( $ this -> _stopWordsUrl . '/' . urlencode ( $ stopWord ) ) ; } | Deletes a words from the managed stop word list |
36,938 | public function dispatch ( PageIndexerRequest $ request , PageIndexerResponse $ response ) { $ actions = $ request -> getActions ( ) ; foreach ( $ actions as $ action ) { $ frontendHelper = $ this -> frontendHelperManager -> resolveAction ( $ action ) ; $ frontendHelper -> activate ( ) ; $ frontendHelper -> processRequ... | Takes the request s actions and hands them of to the according frontend helpers . |
36,939 | public function shutdown ( ) { $ frontendHelpers = $ this -> frontendHelperManager -> getActivatedFrontendHelpers ( ) ; foreach ( $ frontendHelpers as $ frontendHelper ) { $ frontendHelper -> deactivate ( ) ; } } | Sends a shutdown signal to all activated frontend helpers . |
36,940 | public function search ( Query $ query , $ offset = 0 , $ limit = 10 ) { $ this -> query = $ query ; if ( ! empty ( $ limit ) ) { $ query -> setRows ( $ limit ) ; } $ query -> setStart ( $ offset ) ; try { $ response = $ this -> solr -> getReadService ( ) -> search ( $ query ) ; if ( $ this -> configuration -> getLoggi... | Executes a query against a Solr server . |
36,941 | public function ping ( $ useCache = true ) { $ solrAvailable = false ; try { if ( ! $ this -> solr -> getReadService ( ) -> ping ( $ useCache ) ) { throw new \ Exception ( 'Solr Server not responding.' , 1237475791 ) ; } $ solrAvailable = true ; } catch ( \ Exception $ e ) { if ( $ this -> configuration -> getLoggingEx... | Sends a ping to the solr server to see whether it is available . |
36,942 | public function cObjGetSingleExt ( $ name , array $ configuration , $ TyposcriptKey , $ parentContentObject ) { $ this -> configuration = array_merge ( $ this -> configuration , $ configuration ) ; $ relatedItems = $ this -> getRelatedItems ( $ parentContentObject ) ; if ( ! empty ( $ this -> configuration [ 'removeDup... | Executes the SOLR_RELATION content object . |
36,943 | protected function getRelatedItems ( ContentObjectRenderer $ parentContentObject ) { list ( $ table , $ uid ) = explode ( ':' , $ parentContentObject -> currentRecord ) ; $ uid = ( int ) $ uid ; $ field = $ this -> configuration [ 'localField' ] ; if ( ! $ this -> tcaService -> getHasConfigurationForField ( $ table , $... | Gets the related items of the current record s configured field . |
36,944 | protected function resolveForeignTableLabelField ( array $ foreignTableTca ) { $ foreignTableLabelField = $ foreignTableTca [ 'ctrl' ] [ 'label' ] ; if ( empty ( $ this -> configuration [ 'foreignLabelField' ] ) ) { return $ foreignTableLabelField ; } if ( strpos ( $ this -> configuration [ 'foreignLabelField' ] , '.' ... | Resolves the field to use as the related item s label depending on TCA and TypoScript configuration |
36,945 | protected function resolveRelatedValue ( array $ relatedRecord , $ foreignTableTca , $ foreignTableLabelField , ContentObjectRenderer $ parentContentObject , $ foreignTableName = '' ) { if ( $ GLOBALS [ 'TSFE' ] -> sys_language_uid > 0 && ! empty ( $ foreignTableName ) ) { $ relatedRecord = $ this -> frontendOverlaySer... | Resolves the value of the related field . If the related field s value is a relation itself this method takes care of resolving it recursively . |
36,946 | protected function getRelatedRecords ( $ foreignTable , int ... $ uids ) : array { $ queryBuilder = GeneralUtility :: makeInstance ( ConnectionPool :: class ) -> getQueryBuilderForTable ( $ foreignTable ) ; $ queryBuilder -> select ( '*' ) -> from ( $ foreignTable ) -> where ( $ queryBuilder -> expr ( ) -> in ( 'uid' ,... | Return records via relation . |
36,947 | public function process ( array $ values ) { $ results = [ ] ; foreach ( $ values as $ value ) { list ( $ rootPageUid , $ mountPoint ) = GeneralUtility :: trimExplode ( ',' , $ value , true , 2 ) ; $ results [ ] = $ this -> getSolrRootlineForPageId ( $ rootPageUid , $ mountPoint ) ; } return $ results ; } | Expects a page ID of a page . Returns a Solr hierarchy notation for the rootline of the page ID . |
36,948 | protected function getSolrRootlineForPageId ( $ pageId , $ mountPoint = '' ) { $ pageIdRootline = $ this -> buildPageIdRootline ( $ pageId , $ mountPoint ) ; $ solrRootline = $ this -> buildSolrHierarchyFromIdRootline ( $ pageIdRootline ) ; return $ solrRootline ; } | Returns a Solr hierarchy notation string for rootline of given PID . |
36,949 | protected function buildPageIdRootline ( $ pageId , $ mountPoint = '' ) { $ rootlinePageIds = [ ] ; $ pageSelector = GeneralUtility :: makeInstance ( PageRepository :: class ) ; $ rootline = $ pageSelector -> getRootLine ( $ pageId , ( string ) $ mountPoint ) ; foreach ( $ rootline as $ page ) { if ( Site :: isRootPage... | Builds a page s rootline of parent page Ids |
36,950 | public function initializeMountedPage ( array $ mountProperties , $ mountPageId ) { $ mountedPages = [ $ mountPageId ] ; $ this -> addMountedPagesToIndexQueue ( $ mountedPages , $ mountProperties ) ; $ this -> addIndexQueueItemIndexingProperties ( $ mountProperties , $ mountedPages ) ; } | Initialize a single page that is part of a mounted tree . |
36,951 | protected function initializeMountPages ( ) { $ mountPagesInitialized = false ; $ mountPages = $ this -> pagesRepository -> findAllMountPagesByWhereClause ( $ this -> buildPagesClause ( ) . $ this -> buildTcaWhereClause ( ) . ' AND doktype = 7 AND no_search = 0' ) ; if ( empty ( $ mountPages ) ) { $ mountPagesInitializ... | Initializes Mount Pages to be indexed through the Index Queue . The Mount Pages are searched and their mounted virtual sub - trees are then resolved and added to the Index Queue as if they were actually present below the Mount Page . |
36,952 | protected function validateMountPage ( array $ mountPage ) { $ isValidMountPage = true ; if ( empty ( $ mountPage [ 'mountPageSource' ] ) ) { $ isValidMountPage = false ; $ flashMessage = GeneralUtility :: makeInstance ( FlashMessage :: class , 'Property "Mounted page" must not be empty. Invalid Mount Page configuratio... | Checks whether a Mount Page is properly configured . |
36,953 | protected function addIndexQueueItemIndexingProperties ( array $ mountPage , array $ mountedPages ) { $ mountIdentifier = $ this -> getMountPointIdentifier ( $ mountPage ) ; $ mountPageItems = $ this -> queueItemRepository -> findAllIndexQueueItemsByRootPidAndMountIdentifierAndMountedPids ( $ this -> site -> getRootPag... | Adds Index Queue item indexing properties for mounted pages . The page indexer later needs to know that he s dealing with a mounted page the indexing properties will let make it possible for the indexer to distinguish the mounted pages . |
36,954 | protected function resolveMountPageTree ( $ mountPage ) { $ mountPageSourceId = $ mountPage [ 'mountPageSource' ] ; $ mountPageIdentifier = $ this -> getMountPointIdentifier ( $ mountPage ) ; $ siteRepository = GeneralUtility :: makeInstance ( SiteRepository :: class ) ; $ mountedSite = $ siteRepository -> getSiteByPag... | Gets all the pages from a mounted page tree . |
36,955 | public function validateArguments ( ) { parent :: validateArguments ( ) ; if ( empty ( $ this -> arguments [ 'signature' ] ) && ( empty ( $ this -> arguments [ 'extension' ] ) || empty ( $ this -> arguments [ 'main' ] ) || empty ( $ this -> arguments [ 'sub' ] ) ) ) { throw new \ InvalidArgumentException ( 'ifHasAccess... | Validates arguments given to this view helper . |
36,956 | protected function indexItem ( Item $ item , $ language = 0 ) { $ itemIndexed = false ; $ documents = [ ] ; $ itemDocument = $ this -> itemToDocument ( $ item , $ language ) ; if ( is_null ( $ itemDocument ) ) { return true ; } $ documents [ ] = $ itemDocument ; $ documents = array_merge ( $ documents , $ this -> getAd... | Creates a single Solr Document for an item in a specific language . |
36,957 | protected function getFullItemRecord ( Item $ item , $ language = 0 ) { Util :: initializeTsfe ( $ item -> getRootPageUid ( ) , $ language ) ; $ systemLanguageContentOverlay = $ GLOBALS [ 'TSFE' ] -> sys_language_contentOL ; $ itemRecord = $ this -> getItemRecordOverlayed ( $ item , $ language , $ systemLanguageContent... | Gets the full item record . |
36,958 | protected function getItemRecordOverlayed ( Item $ item , $ language , $ systemLanguageContentOverlay ) { $ itemRecord = $ item -> getRecord ( ) ; if ( $ language > 0 ) { $ page = GeneralUtility :: makeInstance ( PageRepository :: class ) ; $ page -> init ( false ) ; $ itemRecord = $ page -> getRecordOverlay ( $ item -... | Returns the overlayed item record . |
36,959 | protected function getItemTypeConfiguration ( Item $ item , $ language = 0 ) { $ indexConfigurationName = $ item -> getIndexingConfigurationName ( ) ; $ fields = $ this -> getFieldConfigurationFromItemRecordPage ( $ item , $ language , $ indexConfigurationName ) ; if ( count ( $ fields ) === 0 ) { $ fields = $ this -> ... | Gets the configuration how to process an item s fields for indexing . |
36,960 | protected function getAccessRootline ( Item $ item ) { $ accessRestriction = '0' ; $ itemRecord = $ item -> getRecord ( ) ; if ( isset ( $ GLOBALS [ 'TCA' ] [ $ item -> getType ( ) ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'fe_group' ] ) ) { $ accessRestriction = $ itemRecord [ $ GLOBALS [ 'TCA' ] [ $ item -> getType ( ) ] [ ... | Generates an Access Rootline for an item . |
36,961 | protected function processDocuments ( Item $ item , array $ documents ) { $ solrConfiguration = Util :: getSolrConfigurationFromPageId ( $ item -> getRootPageUid ( ) ) ; $ fieldProcessingInstructions = $ solrConfiguration -> getIndexFieldProcessingInstructionsConfiguration ( ) ; if ( is_array ( $ fieldProcessingInstruc... | Sends the documents to the field processing service which takes care of manipulating fields as defined in the field s configuration . |
36,962 | protected function getAdditionalDocuments ( Item $ item , $ language , Document $ itemDocument ) { $ documents = [ ] ; if ( is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'IndexQueueIndexer' ] [ 'indexItemAddDocuments' ] ) ) { foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ '... | Allows third party extensions to provide additional documents which should be indexed for the current item . |
36,963 | protected function preAddModifyDocuments ( Item $ item , $ language , array $ documents ) { if ( is_array ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'IndexQueueIndexer' ] [ 'preAddModifyDocuments' ] ) ) { foreach ( $ GLOBALS [ 'TYPO3_CONF_VARS' ] [ 'EXTCONF' ] [ 'solr' ] [ 'IndexQueueIndexer' ] [ 'pre... | Provides a hook to manipulate documents right before they get added to the Solr index . |
36,964 | protected function getSolrConnectionsByItem ( Item $ item ) { $ solrConnections = [ ] ; $ pageId = $ item -> getRootPageUid ( ) ; if ( $ item -> getType ( ) === 'pages' ) { $ pageId = $ item -> getRecordUid ( ) ; } $ site = $ item -> getSite ( ) ; $ solrConfigurationsBySite = $ this -> connectionManager -> getConfigura... | Gets the Solr connections applicable for an item . |
36,965 | protected function getTranslationOverlaysWithConfiguredSite ( $ pageId , Site $ site , $ defaultLanguageUid , $ siteLanguages ) { $ translationOverlays = $ this -> getTranslationOverlaysForPage ( $ pageId , $ site -> getSysLanguageMode ( $ defaultLanguageUid ) ) ; foreach ( $ translationOverlays as $ key => $ translati... | Retrieves only translation overlays where a solr site is configured . |
36,966 | protected function getTranslationOverlaysForPage ( $ pageId , $ languageMode ) { $ translationOverlays = [ ] ; $ pageId = intval ( $ pageId ) ; $ languageModes = [ 'content_fallback' , 'strict' , 'ignore' ] ; $ hasOverlayMode = in_array ( $ languageMode , $ languageModes , true ) ; $ isContentFallbackMode = ( $ languag... | Finds the alternative page language overlay records for a page based on the sys_language_mode . |
36,967 | protected function getConnectionsForIndexableLanguages ( array $ translationOverlays ) { $ connections = [ ] ; foreach ( $ translationOverlays as $ translationOverlay ) { $ pageId = $ translationOverlay [ 'l10n_parent' ] ; $ languageId = $ translationOverlay [ 'sys_language_uid' ] ; try { $ connection = $ this -> conne... | Checks for which languages connections have been configured and returns these connections . |
36,968 | protected function setLogging ( Item $ item ) { $ solrConfiguration = Util :: getSolrConfigurationFromPageId ( $ item -> getRootPageUid ( ) ) ; $ this -> loggingEnabled = $ solrConfiguration -> getLoggingIndexingQueueOperationsByConfigurationNameWithFallBack ( $ item -> getIndexingConfigurationName ( ) ) ; } | Enables logging dependent on the configuration of the item s site |
36,969 | protected function log ( Item $ item , array $ itemDocuments , ResponseAdapter $ response ) { if ( ! $ this -> loggingEnabled ) { return ; } $ message = 'Index Queue indexing ' . $ item -> getType ( ) . ':' . $ item -> getRecordUid ( ) . ' - ' ; $ documents = [ ] ; foreach ( $ itemDocuments as $ document ) { $ document... | Logs the item and what document was created from it |
36,970 | public function getClosestPageIdWithActiveTemplate ( $ startPageId ) { if ( $ startPageId === 0 ) { return 0 ; } $ cacheId = 'ConfigurationPageResolver' . '_' . 'getClosestPageIdWithActiveTemplate' . '_' . $ startPageId ; $ methodResult = $ this -> runtimeCache -> get ( $ cacheId ) ; if ( ! empty ( $ methodResult ) ) {... | This method fetches the rootLine and calculates the id of the closest template in the rootLine . The result is stored in the runtime cache . |
36,971 | protected function calculateClosestPageIdWithActiveTemplate ( $ startPageId ) { $ rootLine = $ this -> pageRepository -> getRootLine ( $ startPageId ) ; if ( ! is_array ( $ rootLine ) ) { return $ startPageId ; } $ closestPageIdWithTemplate = $ this -> systemTemplateRepository -> findOneClosestPageIdWithActiveTemplateB... | This method fetches the rootLine and calculates the id of the closest template in the rootLine . |
36,972 | public function getGroups ( $ user , $ knownGroups ) { $ groupData = [ ] ; $ requestHandler = GeneralUtility :: makeInstance ( PageIndexerRequestHandler :: class ) ; $ accessRootline = $ requestHandler -> getRequest ( ) -> getParameter ( 'accessRootline' ) ; if ( $ user [ 'username' ] == self :: SOLR_INDEXER_USERNAME &... | Creates user group records so that the page indexer is granted access to protected pages . |
36,973 | public function manipulateCacheActions ( & $ cacheActions , & $ optionValues ) { if ( ! $ this -> backendUser -> isAdmin ( ) ) { return ; } $ href = $ this -> uriBuilder -> buildUriFromRoute ( 'ajax_solr_updateConnections' ) ; $ optionValues [ ] = 'clearSolrConnectionCache' ; $ cacheActions [ ] = [ 'id' => 'clearSolrCo... | Adds a menu entry to the clear cache menu to detect Solr connections . |
36,974 | public function execute ( ) { $ cliEnvironment = null ; if ( TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI ) { $ cliEnvironment = GeneralUtility :: makeInstance ( CliEnvironment :: class ) ; $ cliEnvironment -> backup ( ) ; $ cliEnvironment -> initialize ( $ this -> getWebRoot ( ) ) ; } $ site = $ this -> getSite ( ) ; $ i... | Works through the indexing queue and indexes the queued items into Solr . |
36,975 | public function getAdditionalInformation ( ) { $ site = $ this -> getSite ( ) ; if ( is_null ( $ site ) ) { return 'Invalid site configuration for scheduler please re-create the task!' ; } $ message = 'Site: ' . $ site -> getLabel ( ) ; $ indexService = $ this -> getInitializedIndexService ( $ site ) ; $ failedItemsCou... | Returns some additional information about indexing progress shown in the scheduler s task overview list . |
36,976 | public function getProgress ( ) { $ site = $ this -> getSite ( ) ; if ( is_null ( $ site ) ) { return 0.0 ; } $ indexService = $ this -> getInitializedIndexService ( $ site ) ; return $ indexService -> getProgress ( ) ; } | Gets the indexing progress . |
36,977 | protected function getInitializedIndexService ( Site $ site ) { $ indexService = GeneralUtility :: makeInstance ( IndexService :: class , $ site ) ; $ indexService -> setContextTask ( $ this ) ; return $ indexService ; } | Returns the initialize IndexService instance . |
36,978 | public function process ( array $ values ) { $ results = [ ] ; $ formatService = GeneralUtility :: makeInstance ( FormatService :: class ) ; foreach ( $ values as $ timestamp ) { $ results [ ] = $ formatService -> timestampToUtcIso ( $ timestamp ) ; } return $ results ; } | Expects a timestamp and converts it to an ISO 8601 date in UTC as needed by Solr . |
36,979 | public function getAdditionalFields ( array & $ taskInfo , $ task , SchedulerModuleController $ schedulerModule ) { $ additionalFields = [ ] ; if ( ! $ this -> isTaskInstanceofReIndexTask ( $ task ) ) { return $ additionalFields ; } $ this -> initialize ( $ taskInfo , $ task , $ schedulerModule ) ; $ siteSelectorField ... | Used to define fields to provide the Solr server address when adding or editing a task . |
36,980 | public function getIsUseConfigurationMonitorTables ( ) { $ monitorTables = [ ] ; $ monitorTablesList = $ this -> getConfigurationOrDefaultValue ( 'useConfigurationMonitorTables' , '' ) ; if ( empty ( $ monitorTablesList ) ) { return $ monitorTables ; } return GeneralUtility :: trimExplode ( ',' , $ monitorTablesList ) ... | Get configuration for useConfigurationMonitorTables |
36,981 | protected function getIndexQueueConfigurationTableMap ( ) { $ indexingTableMap = [ ] ; $ solrConfiguration = $ this -> site -> getSolrConfiguration ( ) ; $ configurationNames = $ solrConfiguration -> getEnabledIndexQueueConfigurationNames ( ) ; foreach ( $ configurationNames as $ configurationName ) { $ indexingTableMa... | Builds a map of indexing configuration names to tables to to index . |
36,982 | protected function buildSelectorItems ( array $ tablesToIndex ) { $ selectorItems = [ ] ; foreach ( $ tablesToIndex as $ configurationName => $ tableName ) { $ icon = 'tcarecords-' . $ tableName . '-default' ; if ( $ tableName === 'pages' ) { $ icon = 'apps-pagetree-page-default' ; } $ labelTableName = '' ; if ( $ conf... | Builds the items to render in the TCEforms select field . |
36,983 | protected function getOnlyArrayKeysWhereValueIsNotAnArray ( $ inputArray ) { $ keysWithNonArrayValue = [ ] ; foreach ( $ inputArray as $ key => $ value ) { if ( is_array ( $ value ) ) { continue ; } $ keysWithNonArrayValue [ ] = $ key ; } return $ keysWithNonArrayValue ; } | This method can be used to only retrieve array keys where the value is not an array . |
36,984 | public function getValueByPathOrDefaultValue ( $ path , $ defaultValue ) { $ value = $ this -> getValueByPath ( $ path ) ; if ( is_null ( $ value ) ) { return $ defaultValue ; } return $ value ; } | This method can be used to get a configuration value by path if it exists or return a default value when it does not exist . |
36,985 | public function getObjectByPath ( $ path ) { if ( substr ( $ path , - 1 ) !== '.' ) { $ path = rtrim ( $ path , '.' ) ; $ path = substr ( $ path , 0 , strrpos ( $ path , '.' ) + 1 ) ; } if ( ! is_string ( $ path ) ) { throw new InvalidArgumentException ( 'Parameter $path is not a string' , 1325627243 ) ; } return $ thi... | Gets the parent TypoScript Object from a given TypoScript path . |
36,986 | public function getObjectByPathOrDefault ( $ path , array $ defaultValue ) { try { $ object = $ this -> getObjectByPath ( $ path ) ; } catch ( \ InvalidArgumentException $ e ) { return $ defaultValue ; } if ( ! is_array ( $ object ) ) { return $ defaultValue ; } return $ object ; } | Gets the parent TypoScript Object from a given TypoScript path and if not present return the default value |
36,987 | public function isValidPath ( $ path ) { $ isValidPath = false ; $ pathValue = $ this -> getValueByPath ( $ path ) ; if ( ! is_null ( $ pathValue ) ) { $ isValidPath = true ; } return $ isValidPath ; } | Checks whether a given TypoScript path is valid . |
36,988 | public function mergeSolrConfiguration ( array $ configurationToMerge , $ addKeys = true , $ includeEmptyValues = true , $ enableUnsetFeature = true ) { $ data = $ this -> configurationAccess -> getData ( ) ; ArrayUtility :: mergeRecursiveWithOverrule ( $ data [ 'plugin.' ] [ 'tx_solr.' ] , $ configurationToMerge , $ a... | Merges a configuration with another configuration a |
36,989 | public function getEnabled ( $ defaultIfEmpty = false ) { $ path = 'plugin.tx_solr.enabled' ; $ result = $ this -> getValueByPathOrDefaultValue ( $ path , $ defaultIfEmpty ) ; return $ this -> getBool ( $ result ) ; } | Returns true when ext_solr is enabled |
36,990 | public function getIndexMappedAdditionalFieldNames ( $ defaultIfEmpty = [ ] ) { $ mappingConfiguration = $ this -> getIndexAdditionalFieldsConfiguration ( ) ; $ mappedFieldNames = $ this -> getOnlyArrayKeysWhereValueIsNotAnArray ( $ mappingConfiguration ) ; return count ( $ mappedFieldNames ) == 0 ? $ defaultIfEmpty : ... | Returns all solr fields names where a mapping is configured in index . additionalFields |
36,991 | public function getIndexQueueConfigurationByName ( $ configurationName , array $ defaultIfEmpty = [ ] ) { $ path = 'plugin.tx_solr.index.queue.' . $ configurationName . '.' ; $ result = $ this -> getObjectByPathOrDefault ( $ path , $ defaultIfEmpty ) ; return $ result ; } | Retrieves the indexing configuration array for an indexing queue by configuration name . |
36,992 | public function getIndexQueueAdditionalPageIdsByConfigurationName ( $ configurationName = 'pages' , $ defaultIfEmpty = [ ] ) { $ path = 'plugin.tx_solr.index.queue.' . $ configurationName . '.additionalPageIds' ; $ result = $ this -> getValueByPathOrDefaultValue ( $ path , '' ) ; if ( trim ( $ result ) === '' ) { retur... | Returns an array of all additionalPageIds by index configuration name . |
36,993 | public function getIndexQueuePagesExcludeContentByClassArray ( $ defaultIfEmpty = [ ] ) { $ path = 'plugin.tx_solr.index.queue.pages.excludeContentByClass' ; $ result = $ this -> getValueByPathOrDefaultValue ( $ path , '' ) ; if ( trim ( $ result ) === '' ) { return $ defaultIfEmpty ; } return GeneralUtility :: trimExp... | Returns the configured excludeContentByClass patterns as array . |
36,994 | public function getIndexQueueTableNameOrFallbackToConfigurationName ( $ configurationName = '' ) { $ path = 'plugin.tx_solr.index.queue.' . $ configurationName . '.table' ; $ result = $ this -> getValueByPathOrDefaultValue ( $ path , $ configurationName ) ; return $ result ; } | Returns the configured database table for an indexing queue configuration or the configurationName itself that is used by convention as tableName when no other tablename is present . |
36,995 | public function getIndexQueueFieldsConfigurationByConfigurationName ( $ configurationName = '' , $ defaultIfEmpty = [ ] ) { $ path = 'plugin.tx_solr.index.queue.' . $ configurationName . '.fields.' ; $ result = $ this -> getObjectByPathOrDefault ( $ path , $ defaultIfEmpty ) ; return $ result ; } | Returns the field configuration for a specific index queue . |
36,996 | public function getIndexQueueMonitoredTables ( ) { $ monitoredTables = [ ] ; $ indexingConfigurations = $ this -> getEnabledIndexQueueConfigurationNames ( ) ; foreach ( $ indexingConfigurations as $ indexingConfigurationName ) { $ monitoredTable = $ this -> getIndexQueueTableNameOrFallbackToConfigurationName ( $ indexi... | Gets an array of tables configured for indexing by the Index Queue . Since the record monitor must watch these tables for manipulation . |
36,997 | public function getIndexQueueIndexerByConfigurationName ( $ configurationName , $ defaultIfEmpty = Indexer :: class ) { $ path = 'plugin.tx_solr.index.queue.' . $ configurationName . '.indexer' ; $ result = $ this -> getValueByPathOrDefaultValue ( $ path , $ defaultIfEmpty ) ; return $ result ; } | Returns the configured indexer class that should be used for a certain indexingConfiguration . By default ApacheSolrForTypo3 \ Solr \ IndexQueue \ Indexer will be returned . |
36,998 | public function getIndexQueueIndexerConfigurationByConfigurationName ( $ configurationName , $ defaultIfEmpty = [ ] ) { $ path = 'plugin.tx_solr.index.queue.' . $ configurationName . '.indexer.' ; $ result = $ this -> getObjectByPathOrDefault ( $ path , $ defaultIfEmpty ) ; return $ result ; } | Returns the configuration of an indexer for a special indexingConfiguration . By default an empty array is returned . |
36,999 | public function getIndexQueueMappedFieldsByConfigurationName ( $ configurationName = '' , $ defaultIfEmpty = [ ] ) { $ mappingConfiguration = $ this -> getIndexQueueFieldsConfigurationByConfigurationName ( $ configurationName ) ; $ mappedFieldNames = $ this -> getOnlyArrayKeysWhereValueIsNotAnArray ( $ mappingConfigura... | Returns all solr fields names where a mapping configuration is set for a certain index configuration |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.