From d45c1d062579bdd7822e5c40e4f49d192f9b825f Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 6 Jun 2017 15:22:13 +0200 Subject: [PATCH 01/13] TASK: Adjust travis * As this is support branch for TYPO3 6.2, we do not need to cover other TYPO3 Versions in travis. --- .travis.yml | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index e583e51..14c0a04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,35 +17,9 @@ env: - typo3DatabasePassword="" matrix: - TYPO3_VERSION="~6.2" - - TYPO3_VERSION="~7.6" - - TYPO3_VERSION="~8" - - TYPO3_VERSION="dev-master" matrix: fast_finish: true - exclude: - # TYPO3 no longer supports 5.6 - - env: TYPO3_VERSION="~7.6" - php: 5.6 - - env: TYPO3_VERSION="~8" - php: 5.6 - - env: TYPO3_VERSION="dev-master" - php: 5.6 - allow_failures: - # 7 and 8 are not working due to current relation resolving. - # See: https://github.com/DanielSiepmann/search_core/projects/1 - - env: TYPO3_VERSION="~7.6" - php: 7.0 - - env: TYPO3_VERSION="~7.6" - php: 7.1 - - env: TYPO3_VERSION="~8" - php: 7.0 - - env: TYPO3_VERSION="~8" - php: 7.1 - - env: TYPO3_VERSION="dev-master" - php: 7.0 - - env: TYPO3_VERSION="dev-master" - php: 7.1 services: - mysql From aebe58721d6cc31fc8f71a062fd7bec00eae8edc Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 10 Oct 2017 11:15:06 +0200 Subject: [PATCH 02/13] TASK: Add changes from customer project --- .../Connection/Elasticsearch/IndexFactory.php | 40 +++++-- .../Connection/Elasticsearch/SearchResult.php | 2 +- Classes/Connection/SearchResultInterface.php | 2 +- Classes/DataProcessing/CopyToProcessor.php | 54 ++++++++++ Classes/DataProcessing/ProcessorInterface.php | 39 +++++++ .../Domain/Index/TcaIndexer/PagesIndexer.php | 46 +++++++- .../Index/TcaIndexer/RelationResolver.php | 14 +++ .../Index/TcaIndexer/TcaTableService.php | 13 +++ Classes/Domain/Search/QueryFactory.php | 33 +++--- .../Connection/Elasticsearch/FilterTest.php | 4 +- Tests/Functional/Fixtures/BasicSetup.ts | 1 + .../Elasticsearch/IndexFactoryTest.php | 1 + .../Index/TcaIndexer/TcaTableServiceTest.php | 20 +--- Tests/Unit/Domain/Search/QueryFactoryTest.php | 102 +++++++++--------- ext_localconf.php | 2 +- 15 files changed, 270 insertions(+), 103 deletions(-) create mode 100644 Classes/DataProcessing/CopyToProcessor.php create mode 100644 Classes/DataProcessing/ProcessorInterface.php diff --git a/Classes/Connection/Elasticsearch/IndexFactory.php b/Classes/Connection/Elasticsearch/IndexFactory.php index 66b448b..49956f0 100644 --- a/Classes/Connection/Elasticsearch/IndexFactory.php +++ b/Classes/Connection/Elasticsearch/IndexFactory.php @@ -39,6 +39,21 @@ class IndexFactory implements Singleton */ protected $configuration; + /** + * @var \TYPO3\CMS\Core\Log\Logger + */ + protected $logger; + + /** + * Inject log manager to get concrete logger from it. + * + * @param \TYPO3\CMS\Core\Log\LogManager $logManager + */ + public function injectLogger(\TYPO3\CMS\Core\Log\LogManager $logManager) + { + $this->logger = $logManager->getLogger(__CLASS__); + } + /** * @param ConfigurationContainerInterface $configuration */ @@ -60,7 +75,10 @@ class IndexFactory implements Singleton $index = $connection->getClient()->getIndex('typo3content'); if ($index->exists() === false) { - $index->create($this->getConfigurationFor($documentType)); + $config = $this->getConfigurationFor($documentType); + $this->logger->debug(sprintf('Create index %s.', $documentType), [$documentType, $config]); + $index->create($config); + $this->logger->debug(sprintf('Created index %s.', $documentType), [$documentType]); } return $index; @@ -76,9 +94,11 @@ class IndexFactory implements Singleton try { $configuration = $this->configuration->get('indexing.' . $documentType . '.index'); - if (isset($configuration['analysis']['analyzer'])) { - foreach ($configuration['analysis']['analyzer'] as $key => $analyzer) { - $configuration['analysis']['analyzer'][$key] = $this->prepareAnalyzerConfiguration($analyzer); + foreach (['analyzer', 'filter'] as $optionsToExpand) { + if (isset($configuration['analysis'][$optionsToExpand])) { + foreach ($configuration['analysis'][$optionsToExpand] as $key => $options) { + $configuration['analysis'][$optionsToExpand][$key] = $this->prepareOptions($options); + } } } @@ -89,20 +109,20 @@ class IndexFactory implements Singleton } /** - * @param array $analyzer + * @param array $options * * @return array */ - protected function prepareAnalyzerConfiguration(array $analyzer) + protected function prepareOptions(array $options) { - $fieldsToExplode = ['char_filter', 'filter']; + $fieldsToExplode = ['char_filter', 'filter', 'word_list']; foreach ($fieldsToExplode as $fieldToExplode) { - if (isset($analyzer[$fieldToExplode])) { - $analyzer[$fieldToExplode] = GeneralUtility::trimExplode(',', $analyzer[$fieldToExplode], true); + if (isset($options[$fieldToExplode])) { + $options[$fieldToExplode] = GeneralUtility::trimExplode(',', $options[$fieldToExplode], true); } } - return $analyzer; + return $options; } } diff --git a/Classes/Connection/Elasticsearch/SearchResult.php b/Classes/Connection/Elasticsearch/SearchResult.php index f45f02f..3919722 100644 --- a/Classes/Connection/Elasticsearch/SearchResult.php +++ b/Classes/Connection/Elasticsearch/SearchResult.php @@ -83,7 +83,7 @@ class SearchResult implements SearchResultInterface /** * Return all facets, if any. * - * @return array + * @return array */ public function getFacets() { diff --git a/Classes/Connection/SearchResultInterface.php b/Classes/Connection/SearchResultInterface.php index d52a8ba..60718cd 100644 --- a/Classes/Connection/SearchResultInterface.php +++ b/Classes/Connection/SearchResultInterface.php @@ -35,7 +35,7 @@ interface SearchResultInterface extends \Iterator, \Countable, QueryResultInterf /** * Return all facets, if any. * - * @return array + * @return array */ public function getFacets(); diff --git a/Classes/DataProcessing/CopyToProcessor.php b/Classes/DataProcessing/CopyToProcessor.php new file mode 100644 index 0000000..bac60d0 --- /dev/null +++ b/Classes/DataProcessing/CopyToProcessor.php @@ -0,0 +1,54 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +/** + * Copies values from one field to another one. + */ +class CopyToProcessor implements ProcessorInterface +{ + public function processRecord(array $record, array $configuration) + { + $all = []; + + $this->addArray($all, $record); + $all = array_filter($all); + $record[$configuration['to']] = implode(PHP_EOL, $all); + + return $record; + } + + /** + * @param array &$to + * @param array $from + */ + protected function addArray(array &$to, array $from) + { + foreach ($from as $property => $value) { + if (is_array($value)) { + $this->addArray($to, $value, $exclude); + continue; + } + + $to[] = (string) $value; + } + } +} diff --git a/Classes/DataProcessing/ProcessorInterface.php b/Classes/DataProcessing/ProcessorInterface.php new file mode 100644 index 0000000..841edb9 --- /dev/null +++ b/Classes/DataProcessing/ProcessorInterface.php @@ -0,0 +1,39 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +/** + * All DataProcessing Processor should implement this interface, otherwise they + * will not be executed. + */ +interface ProcessorInterface +{ + /** + * Processes the given record. + * Also retrieves the configuration for this processor instance. + * + * @param array $record + * @param array $configuration + * + * @return array + */ + public function processRecord(array $record, array $configuration); +} diff --git a/Classes/Domain/Index/TcaIndexer/PagesIndexer.php b/Classes/Domain/Index/TcaIndexer/PagesIndexer.php index b6b71be..ebf2b49 100644 --- a/Classes/Domain/Index/TcaIndexer/PagesIndexer.php +++ b/Classes/Domain/Index/TcaIndexer/PagesIndexer.php @@ -34,6 +34,12 @@ class PagesIndexer extends TcaIndexer */ protected $contentTableService; + /** + * @var \TYPO3\CMS\Core\Resource\FileRepository + * @inject + */ + protected $fileRepository; + /** * @param TcaTableService $tcaTableService * @param TcaTableService $tcaTableService @@ -65,7 +71,9 @@ class PagesIndexer extends TcaIndexer } } - $record['content'] = $this->fetchContentForPage($record['uid']); + $content = $this->fetchContentForPage($record['uid']); + $record['content'] = $content['content']; + $record['media'] = array_unique(array_merge($record['media'], $content['images'])); parent::prepareRecord($record); } @@ -88,14 +96,42 @@ class PagesIndexer extends TcaIndexer } $this->logger->debug('Fetched content for page ' . $uid); + $images = []; $content = []; foreach ($contentElements as $contentElement) { + $images = array_merge( + $images, + $this->getContentElementImages($contentElement['uid']) + ); $content[] = $contentElement['bodytext']; } - // Remove Tags. - // Interpret escaped new lines and special chars. - // Trim, e.g. trailing or leading new lines. - return trim(stripcslashes(strip_tags(implode(' ', $content)))); + return [ + // Remove Tags. + // Interpret escaped new lines and special chars. + // Trim, e.g. trailing or leading new lines. + 'content' => trim(stripcslashes(strip_tags(implode(' ', $content)))), + 'images' => $images, + ]; + } + + /** + * @param int $uidOfContentElement + * @return array + */ + protected function getContentElementImages($uidOfContentElement) + { + $imageRelationUids = []; + $imageRelations = $this->fileRepository->findByRelation( + 'tt_content', + 'image', + $uidOfContentElement + ); + + foreach ($imageRelations as $relation) { + $imageRelationUids[] = $relation->getUid(); + } + + return $imageRelationUids; } } diff --git a/Classes/Domain/Index/TcaIndexer/RelationResolver.php b/Classes/Domain/Index/TcaIndexer/RelationResolver.php index ceb5506..42dafc1 100644 --- a/Classes/Domain/Index/TcaIndexer/RelationResolver.php +++ b/Classes/Domain/Index/TcaIndexer/RelationResolver.php @@ -86,6 +86,9 @@ class RelationResolver implements Singleton */ protected function resolveValue($value, array $config) { + if (isset($config['foreign_table']) && $config['foreign_table'] === 'sys_file_reference') { + return $this->resolveFalRelations($value); + } if ($value === '' || $value === '0') { return ''; } @@ -102,6 +105,17 @@ class RelationResolver implements Singleton return ''; } + /** + * @param string $value + * @return array + */ + protected function resolveFalRelations($value) + { + $files = GeneralUtility::trimExplode(',', $value); + $files = array_filter($files); + return array_map('intval', $files); + } + /** * @param array Column config. * @return bool diff --git a/Classes/Domain/Index/TcaIndexer/TcaTableService.php b/Classes/Domain/Index/TcaIndexer/TcaTableService.php index 70bb52d..e68a94f 100644 --- a/Classes/Domain/Index/TcaIndexer/TcaTableService.php +++ b/Classes/Domain/Index/TcaIndexer/TcaTableService.php @@ -21,6 +21,8 @@ namespace Codappix\SearchCore\Domain\Index\TcaIndexer; */ use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; +use Codappix\SearchCore\Configuration\InvalidArgumentException as InvalidConfigurationArgumentException; +use Codappix\SearchCore\DataProcessing\ProcessorInterface; use Codappix\SearchCore\Domain\Index\IndexingException; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; @@ -148,6 +150,17 @@ class TcaTableService { $this->relationResolver->resolveRelationsForRecord($this, $record); + try { + foreach ($this->configuration->get('indexing.' . $this->tableName . '.dataProcessing') as $configuration) { + $dataProcessor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($configuration['_typoScriptNodeValue']); + if ($dataProcessor instanceof ProcessorInterface) { + $record = $dataProcessor->processRecord($record, $configuration); + } + } + } catch (InvalidConfigurationArgumentException $e) { + // Nothing to do. + } + if (isset($record['uid']) && !isset($record['search_identifier'])) { $record['search_identifier'] = $record['uid']; } diff --git a/Classes/Domain/Search/QueryFactory.php b/Classes/Domain/Search/QueryFactory.php index 9455f80..b30fcbf 100644 --- a/Classes/Domain/Search/QueryFactory.php +++ b/Classes/Domain/Search/QueryFactory.php @@ -25,6 +25,7 @@ use Codappix\SearchCore\Configuration\InvalidArgumentException; use Codappix\SearchCore\Connection\ConnectionInterface; use Codappix\SearchCore\Connection\Elasticsearch\Query; use Codappix\SearchCore\Connection\SearchRequestInterface; +use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Utility\ArrayUtility; class QueryFactory @@ -109,20 +110,18 @@ class QueryFactory return; } - $query = ArrayUtility::setValueByPath( - $query, - 'query.bool.must.0.match._all.query', - $searchRequest->getSearchTerm() - ); + $matchExpression = [ + 'type' => 'most_fields', + 'query' => $searchRequest->getSearchTerm(), + 'fields' => GeneralUtility::trimExplode(',', $this->configuration->get('searching.fields')), + ]; $minimumShouldMatch = $this->configuration->getIfExists('searching.minimumShouldMatch'); if ($minimumShouldMatch) { - $query = ArrayUtility::setValueByPath( - $query, - 'query.bool.must.0.match._all.minimum_should_match', - $minimumShouldMatch - ); + $matchExpression['minimum_should_match'] = $minimumShouldMatch; } + + $query = ArrayUtility::setValueByPath($query, 'query.bool.must.0.multi_match', $matchExpression); } /** @@ -150,13 +149,15 @@ class QueryFactory ]; } - $query = ArrayUtility::arrayMergeRecursiveOverrule($query, [ - 'query' => [ - 'bool' => [ - 'should' => $boostQueryParts, + if (!empty($boostQueryParts)) { + $query = ArrayUtility::arrayMergeRecursiveOverrule($query, [ + 'query' => [ + 'bool' => [ + 'should' => $boostQueryParts, + ], ], - ], - ]); + ]); + } } /** diff --git a/Tests/Functional/Connection/Elasticsearch/FilterTest.php b/Tests/Functional/Connection/Elasticsearch/FilterTest.php index 9c5aada..2430833 100644 --- a/Tests/Functional/Connection/Elasticsearch/FilterTest.php +++ b/Tests/Functional/Connection/Elasticsearch/FilterTest.php @@ -48,7 +48,7 @@ class FilterTest extends AbstractFunctionalTestCase $searchService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class) ->get(SearchService::class); - $searchRequest = new SearchRequest('Search Word'); + $searchRequest = new SearchRequest(); $result = $searchService->search($searchRequest); $this->assertSame(2, count($result), 'Did not receive both indexed elements without filter.'); @@ -73,7 +73,7 @@ class FilterTest extends AbstractFunctionalTestCase $searchService = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class) ->get(SearchService::class); - $searchRequest = new SearchRequest('Search Word'); + $searchRequest = new SearchRequest(); $result = $searchService->search($searchRequest); $this->assertSame(1, count($result->getFacets()), 'Did not receive the single defined facet.'); diff --git a/Tests/Functional/Fixtures/BasicSetup.ts b/Tests/Functional/Fixtures/BasicSetup.ts index 1e2b3a9..9795b0f 100644 --- a/Tests/Functional/Fixtures/BasicSetup.ts +++ b/Tests/Functional/Fixtures/BasicSetup.ts @@ -37,6 +37,7 @@ plugin { } searching { + fields = search_title facets { contentTypes { field = CType diff --git a/Tests/Unit/Connection/Elasticsearch/IndexFactoryTest.php b/Tests/Unit/Connection/Elasticsearch/IndexFactoryTest.php index c73fe36..4ede3cb 100644 --- a/Tests/Unit/Connection/Elasticsearch/IndexFactoryTest.php +++ b/Tests/Unit/Connection/Elasticsearch/IndexFactoryTest.php @@ -38,6 +38,7 @@ class IndexFactoryTest extends AbstractUnitTestCase $this->configuration = $this->getMockBuilder(ConfigurationContainerInterface::class)->getMock(); $this->subject = new IndexFactory($this->configuration); + $this->subject->injectLogger($this->getMockedLogger()); } /** diff --git a/Tests/Unit/Domain/Index/TcaIndexer/TcaTableServiceTest.php b/Tests/Unit/Domain/Index/TcaIndexer/TcaTableServiceTest.php index 7fb0280..9e88d4b 100644 --- a/Tests/Unit/Domain/Index/TcaIndexer/TcaTableServiceTest.php +++ b/Tests/Unit/Domain/Index/TcaIndexer/TcaTableServiceTest.php @@ -60,18 +60,10 @@ class TcaTableServiceTest extends AbstractUnitTestCase ->method('getIfExists') ->withConsecutive(['indexing.table.additionalWhereClause'], ['indexing.table.rootLineBlacklist']) ->will($this->onConsecutiveCalls(null, false)); - $this->subject->expects($this->once()) - ->method('getSystemWhereClause') - ->will($this->returnValue('1=1 AND pages.no_search = 0')); - $whereClause = $this->subject->getWhereClause(); $this->assertSame( '1=1 AND pages.no_search = 0', - $whereClause->getStatement() - ); - $this->assertSame( - [], - $whereClause->getParameters() + $this->subject->getWhereClause() ); } @@ -84,18 +76,10 @@ class TcaTableServiceTest extends AbstractUnitTestCase ->method('getIfExists') ->withConsecutive(['indexing.table.additionalWhereClause'], ['indexing.table.rootLineBlacklist']) ->will($this->onConsecutiveCalls('table.field = "someValue"', false)); - $this->subject->expects($this->once()) - ->method('getSystemWhereClause') - ->will($this->returnValue('1=1 AND pages.no_search = 0')); - $whereClause = $this->subject->getWhereClause(); $this->assertSame( '1=1 AND pages.no_search = 0 AND table.field = "someValue"', - $whereClause->getStatement() - ); - $this->assertSame( - [], - $whereClause->getParameters() + $this->subject->getWhereClause() ); } } diff --git a/Tests/Unit/Domain/Search/QueryFactoryTest.php b/Tests/Unit/Domain/Search/QueryFactoryTest.php index 54fdc2a..f719fdf 100644 --- a/Tests/Unit/Domain/Search/QueryFactoryTest.php +++ b/Tests/Unit/Domain/Search/QueryFactoryTest.php @@ -50,13 +50,11 @@ class QueryFactoryTest extends AbstractUnitTestCase /** * @test */ - public function creatonOfQueryWorksInGeneral() + public function creationOfQueryWorksInGeneral() { - $searchRequest = new SearchRequest('SearchWord'); + $this->mockConfiguration(); - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); + $searchRequest = new SearchRequest('SearchWord'); $query = $this->subject->create($searchRequest); $this->assertInstanceOf( @@ -71,9 +69,7 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function filterIsAddedToQuery() { - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); + $this->mockConfiguration(); $searchRequest = new SearchRequest('SearchWord'); $searchRequest->setFilter(['field' => 'content']); @@ -83,7 +79,7 @@ class QueryFactoryTest extends AbstractUnitTestCase [ ['term' => ['field' => 'content']] ], - $query->toArray()['query']['bool']['filter'], + $query->toArray()['query']['function_score']['query']['bool']['filter'], 'Filter was not added to query.' ); } @@ -93,9 +89,7 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function emptyFilterIsNotAddedToQuery() { - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); + $this->mockConfiguration(); $searchRequest = new SearchRequest('SearchWord'); $searchRequest->setFilter([ @@ -112,7 +106,7 @@ class QueryFactoryTest extends AbstractUnitTestCase $query = $this->subject->create($searchRequest); $this->assertSame( null, - $query->toArray()['query']['bool']['filter'], + $query->toArray()['query']['function_score']['query']['bool']['filter'], 'Filter was added to query, even if no filter exists.' ); } @@ -122,9 +116,8 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function facetsAreAddedToQuery() { - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); + $this->mockConfiguration(); + $searchRequest = new SearchRequest('SearchWord'); $searchRequest->addFacet(new FacetRequest('Identifier', 'FieldName')); $searchRequest->addFacet(new FacetRequest('Identifier 2', 'FieldName 2')); @@ -153,9 +146,8 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function sizeIsAddedToQuery() { - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); + $this->mockConfiguration(); + $searchRequest = new SearchRequest('SearchWord'); $searchRequest->setLimit(45); $searchRequest->setOffset(35); @@ -178,10 +170,9 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function searchTermIsAddedToQuery() { + $this->mockConfiguration(); + $searchRequest = new SearchRequest('SearchWord'); - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); $query = $this->subject->create($searchRequest); $this->assertSame( @@ -189,16 +180,18 @@ class QueryFactoryTest extends AbstractUnitTestCase 'bool' => [ 'must' => [ [ - 'match' => [ - '_all' => [ - 'query' => 'SearchWord', + 'multi_match' => [ + 'type' => 'most_fields', + 'query' => 'SearchWord', + 'fields' => [ + 0 => 'test_field', ], ], ], ], ], ], - $query->toArray()['query'], + $query->toArray()['query']['function_score']['query'], 'Search term was not added to query as expected.' ); } @@ -208,14 +201,13 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function minimumShouldMatchIsAddedToQuery() { - $searchRequest = new SearchRequest('SearchWord'); $this->configuration->expects($this->once()) ->method('getIfExists') ->with('searching.minimumShouldMatch') ->willReturn('50%'); - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); + $this->mockConfiguration(); + + $searchRequest = new SearchRequest('SearchWord'); $query = $this->subject->create($searchRequest); $this->assertArraySubset( @@ -223,16 +215,14 @@ class QueryFactoryTest extends AbstractUnitTestCase 'bool' => [ 'must' => [ [ - 'match' => [ - '_all' => [ - 'minimum_should_match' => '50%', - ], + 'multi_match' => [ + 'minimum_should_match' => '50%', ], ], ], ], ], - $query->toArray()['query'], + $query->toArray()['query']['function_score']['query'], 'minimum_should_match was not added to query as configured.' ); } @@ -244,10 +234,11 @@ class QueryFactoryTest extends AbstractUnitTestCase { $searchRequest = new SearchRequest('SearchWord'); - $this->configuration->expects($this->exactly(2)) + $this->configuration->expects($this->exactly(3)) ->method('get') - ->withConsecutive(['searching.boost'], ['searching.fieldValueFactor']) + ->withConsecutive(['searching.fields'], ['searching.boost'], ['searching.fieldValueFactor']) ->will($this->onConsecutiveCalls( + 'test_field', [ 'search_title' => 3, 'search_abstract' => 1.5, @@ -292,10 +283,11 @@ class QueryFactoryTest extends AbstractUnitTestCase 'factor' => '2', 'missing' => '1', ]; - $this->configuration->expects($this->exactly(2)) + $this->configuration->expects($this->exactly(3)) ->method('get') - ->withConsecutive(['searching.boost'], ['searching.fieldValueFactor']) + ->withConsecutive(['searching.fields'], ['searching.boost'], ['searching.fieldValueFactor']) ->will($this->onConsecutiveCalls( + 'test_field', $this->throwException(new InvalidArgumentException), $fieldConfig )); @@ -308,9 +300,11 @@ class QueryFactoryTest extends AbstractUnitTestCase 'bool' => [ 'must' => [ [ - 'match' => [ - '_all' => [ - 'query' => 'SearchWord', + 'multi_match' => [ + 'type' => 'most_fields', + 'query' => 'SearchWord', + 'fields' => [ + 0 => 'test_field', ], ], ], @@ -330,17 +324,27 @@ class QueryFactoryTest extends AbstractUnitTestCase */ public function emptySearchStringWillNotAddSearchToQuery() { + $this->mockConfiguration(); + $searchRequest = new SearchRequest(); - $this->configuration->expects($this->any()) - ->method('get') - ->will($this->throwException(new InvalidArgumentException)); - $query = $this->subject->create($searchRequest); - $this->assertInstanceOf( - stdClass, - $query->toArray()['query']['match_all'], + $this->assertNull( + $query->toArray()['query']['function_score']['query'], 'Empty search request does not create expected query.' ); } + + protected function mockConfiguration() + { + $this->configuration->expects($this->any()) + ->method('get') + ->will($this->returnCallback(function ($option) { + if ($option === 'searching.fields') { + return 'test_field'; + } + + return $this->throwException(new InvalidArgumentException); + })); + } } diff --git a/ext_localconf.php b/ext_localconf.php index 54bf43b..882f6ad 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -11,7 +11,7 @@ call_user_func( 'SC_OPTIONS' => [ 'extbase' => [ 'commandControllers' => [ - Codappix\SearchCore\Command\IndexCommandController::class, + $extensionKey . '::index' => Codappix\SearchCore\Command\IndexCommandController::class, ], ], 't3lib/class.t3lib_tcemain.php' => [ From 7ca998c03abeb812f6cd0a89ae1fec6cdc1de103 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 24 Oct 2017 14:06:56 +0200 Subject: [PATCH 03/13] TASK: Fix PR issues --- Classes/DataProcessing/CopyToProcessor.php | 2 +- Classes/Domain/Index/IndexerFactory.php | 2 -- Classes/Domain/Index/TcaIndexer/PagesIndexer.php | 10 ++++++---- Classes/Domain/Index/TcaIndexer/RelationResolver.php | 2 +- Classes/Domain/Search/QueryFactory.php | 1 - Classes/Domain/Service/DataHandler.php | 1 - Classes/Hook/DataHandler.php | 1 - 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Classes/DataProcessing/CopyToProcessor.php b/Classes/DataProcessing/CopyToProcessor.php index bac60d0..e9eb8cf 100644 --- a/Classes/DataProcessing/CopyToProcessor.php +++ b/Classes/DataProcessing/CopyToProcessor.php @@ -44,7 +44,7 @@ class CopyToProcessor implements ProcessorInterface { foreach ($from as $property => $value) { if (is_array($value)) { - $this->addArray($to, $value, $exclude); + $this->addArray($to, $value); continue; } diff --git a/Classes/Domain/Index/IndexerFactory.php b/Classes/Domain/Index/IndexerFactory.php index dbae818..e228780 100644 --- a/Classes/Domain/Index/IndexerFactory.php +++ b/Classes/Domain/Index/IndexerFactory.php @@ -22,8 +22,6 @@ namespace Codappix\SearchCore\Domain\Index; use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; use Codappix\SearchCore\Configuration\InvalidArgumentException; -use Codappix\SearchCore\Domain\Index\IndexerInterface; -use Codappix\SearchCore\Domain\Index\TcaIndexer; use Codappix\SearchCore\Domain\Index\TcaIndexer\TcaTableService; use TYPO3\CMS\Core\SingletonInterface as Singleton; use TYPO3\CMS\Extbase\Object\ObjectManagerInterface; diff --git a/Classes/Domain/Index/TcaIndexer/PagesIndexer.php b/Classes/Domain/Index/TcaIndexer/PagesIndexer.php index ebf2b49..558af09 100644 --- a/Classes/Domain/Index/TcaIndexer/PagesIndexer.php +++ b/Classes/Domain/Index/TcaIndexer/PagesIndexer.php @@ -72,14 +72,16 @@ class PagesIndexer extends TcaIndexer } $content = $this->fetchContentForPage($record['uid']); - $record['content'] = $content['content']; - $record['media'] = array_unique(array_merge($record['media'], $content['images'])); + if ($content !== []) { + $record['content'] = $content['content']; + $record['media'] = array_unique(array_merge($record['media'], $content['images'])); + } parent::prepareRecord($record); } /** * @param int $uid - * @return string + * @return [] */ protected function fetchContentForPage($uid) { @@ -92,7 +94,7 @@ class PagesIndexer extends TcaIndexer if ($contentElements === null) { $this->logger->debug('No content for page ' . $uid); - return ''; + return []; } $this->logger->debug('Fetched content for page ' . $uid); diff --git a/Classes/Domain/Index/TcaIndexer/RelationResolver.php b/Classes/Domain/Index/TcaIndexer/RelationResolver.php index 42dafc1..9b4fcf8 100644 --- a/Classes/Domain/Index/TcaIndexer/RelationResolver.php +++ b/Classes/Domain/Index/TcaIndexer/RelationResolver.php @@ -117,7 +117,7 @@ class RelationResolver implements Singleton } /** - * @param array Column config. + * @param array $config Column config. * @return bool */ protected function isRelation(array &$config) diff --git a/Classes/Domain/Search/QueryFactory.php b/Classes/Domain/Search/QueryFactory.php index b30fcbf..c4b66c9 100644 --- a/Classes/Domain/Search/QueryFactory.php +++ b/Classes/Domain/Search/QueryFactory.php @@ -22,7 +22,6 @@ namespace Codappix\SearchCore\Domain\Search; use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; use Codappix\SearchCore\Configuration\InvalidArgumentException; -use Codappix\SearchCore\Connection\ConnectionInterface; use Codappix\SearchCore\Connection\Elasticsearch\Query; use Codappix\SearchCore\Connection\SearchRequestInterface; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Domain/Service/DataHandler.php b/Classes/Domain/Service/DataHandler.php index 6ac8069..4b0386e 100644 --- a/Classes/Domain/Service/DataHandler.php +++ b/Classes/Domain/Service/DataHandler.php @@ -23,7 +23,6 @@ namespace Codappix\SearchCore\Domain\Service; use Codappix\SearchCore\Configuration\ConfigurationContainerInterface; use Codappix\SearchCore\Domain\Index\IndexerFactory; use Codappix\SearchCore\Domain\Index\NoMatchingIndexerException; -use Codappix\SearchCore\Domain\Index\TcaIndexer; use TYPO3\CMS\Core\SingletonInterface as Singleton; use TYPO3\CMS\Core\Utility\GeneralUtility; diff --git a/Classes/Hook/DataHandler.php b/Classes/Hook/DataHandler.php index d0eb1ba..3c4902a 100644 --- a/Classes/Hook/DataHandler.php +++ b/Classes/Hook/DataHandler.php @@ -21,7 +21,6 @@ namespace Codappix\SearchCore\Hook; */ use Codappix\SearchCore\Configuration\NoConfigurationException; -use Codappix\SearchCore\Domain\Index\NoMatchingIndexerException; use Codappix\SearchCore\Domain\Service\DataHandler as OwnDataHandler; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\DataHandling\DataHandler as CoreDataHandler; From 97dbe75eebfce373f29de566f558841850f29cfc Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 24 Oct 2017 14:14:35 +0200 Subject: [PATCH 04/13] TASK: Add php 5.6 for TYPO3 6.2 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b347b8e..7630c54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ before_install: language: php php: + - 5.6 - 7.0 - 7.1 From a3323b326c08e7a75736b00e63ef941fc0e8ee57 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Wed, 25 Oct 2017 10:50:44 +0200 Subject: [PATCH 05/13] TASK: merge changes made on support/62 branch to support/76 --- .travis.yml | 43 +++++++++++++++++++++++++++++-------------- Makefile | 6 +++--- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7630c54..b6b969b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,3 @@ -sudo: true - -addons: - apt: - packages: - - oracle-java8-set-default -before_install: - - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.0.deb && sudo dpkg -i --force-confnew elasticsearch-5.2.0.deb && sudo service elasticsearch start - - mysql -u root -e 'GRANT ALL ON `typo3_ci_ft%`.* TO travis@127.0.0.1;' - language: php php: @@ -25,19 +15,44 @@ env: - typo3DatabaseHost="127.0.0.1" - typo3DatabaseUsername="travis" - typo3DatabasePassword="" - - TYPO3_VERSION="~6.2" + matrix: + - TYPO3_VERSION="~7.6" + - TYPO3_VERSION="~8" + - TYPO3_VERSION="dev-master" matrix: fast_finish: true + exclude: + # TYPO3 no longer supports 5.6 + - env: TYPO3_VERSION="~7.6" + php: 5.6 + - env: TYPO3_VERSION="~8" + php: 5.6 + - env: TYPO3_VERSION="dev-master" + php: 5.6 + allow_failures: + # 7 and 8 are not working due to current relation resolving. + # See: https://github.com/DanielSiepmann/search_core/projects/1 + - env: TYPO3_VERSION="~7.6" + php: 7.0 + - env: TYPO3_VERSION="~7.6" + php: 7.1 + - env: TYPO3_VERSION="~8" + php: 7.0 + - env: TYPO3_VERSION="~8" + php: 7.1 + - env: TYPO3_VERSION="dev-master" + php: 7.0 + - env: TYPO3_VERSION="dev-master" + php: 7.1 services: - mysql + - elasticsearch install: make install -script: - - make unitTests - - make functionalTests +script: make functionalTests after_script: - make uploadCodeCoverage diff --git a/Makefile b/Makefile index e4a3414..b6bc72b 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,15 @@ current_dir := $(dir $(mkfile_path)) TYPO3_WEB_DIR := $(current_dir).Build/web TYPO3_PATH_ROOT := $(current_dir).Build/web # Allow different versions on travis -TYPO3_VERSION ?= ~6.2 -typo3DatabaseName ?= "searchcore_test" +TYPO3_VERSION ?= ~8.7 +typo3DatabaseName ?= "searchcore_test2" typo3DatabaseUsername ?= "dev" typo3DatabasePassword ?= "dev" typo3DatabaseHost ?= "127.0.0.1" .PHONY: install install: clean - COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source --ignore-platform-reqs typo3/cms="$(TYPO3_VERSION)" + COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-dist --ignore-platform-reqs typo3/cms="$(TYPO3_VERSION)" git checkout composer.json functionalTests: From a05bf09e19a377fdf9bc2c47596c27bf94e227b4 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Wed, 25 Oct 2017 11:48:35 +0200 Subject: [PATCH 06/13] FIX: get correct RelationResolver class of support/76 branch --- .../Index/TcaIndexer/RelationResolver.php | 161 ++++-------------- 1 file changed, 32 insertions(+), 129 deletions(-) diff --git a/Classes/Domain/Index/TcaIndexer/RelationResolver.php b/Classes/Domain/Index/TcaIndexer/RelationResolver.php index 9b4fcf8..b6fc287 100644 --- a/Classes/Domain/Index/TcaIndexer/RelationResolver.php +++ b/Classes/Domain/Index/TcaIndexer/RelationResolver.php @@ -22,8 +22,6 @@ namespace Codappix\SearchCore\Domain\Index\TcaIndexer; use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Core\SingletonInterface as Singleton; -use TYPO3\CMS\Core\Utility\GeneralUtility; -use TYPO3\CMS\Extbase\Utility\LocalizationUtility; /** * Resolves relations from TCA using TCA. @@ -33,160 +31,65 @@ use TYPO3\CMS\Extbase\Utility\LocalizationUtility; */ class RelationResolver implements Singleton { - /** - * @var \TYPO3\CMS\Backend\Form\DataPreprocessor - * @inject - */ - protected $formEngine; - - /** - * Resolve relations for the given record. - * - * @param TcaTableService $service - * @param array $record - */ public function resolveRelationsForRecord(TcaTableService $service, array &$record) { - $preprocessedData = $this->formEngine->renderRecordRaw( - $service->getTableName(), - $record['uid'], - $record['pid'], - $record - ); - foreach (array_keys($record) as $column) { + // TODO: Define / configure fields to exclude?! + if ($column === 'pid') { + continue; + } + $record[$column] = BackendUtility::getProcessedValueExtra( + $service->getTableName(), + $column, + $record[$column], + 0, + $record['uid'] + ); + try { $config = $service->getColumnConfig($column); + + if ($this->isRelation($config)) { + $record[$column] = $this->resolveValue($record[$column], $config); + } } catch (InvalidArgumentException $e) { // Column is not configured. continue; } - - if (! $this->isRelation($config)) { - continue; - } - - $record[$column] = $this->resolveValue($preprocessedData[$column], $config); } } - /** - * Resolve the given value from TYPO3 API response. - * - * As FormEngine uses an internal format, we resolve it to a usable format - * for indexing. - * - * TODO: Unittest to break as soon as TYPO3 api has changed, so we know - * exactly that we need to tackle this place. - * - * @param string $value The value from FormEngine to resolve. - * @param array $config The tca config of the relation. - * - * @return array|string - */ - protected function resolveValue($value, array $config) + protected function resolveValue($value, array $tcaColumn) { - if (isset($config['foreign_table']) && $config['foreign_table'] === 'sys_file_reference') { - return $this->resolveFalRelations($value); - } - if ($value === '' || $value === '0') { - return ''; - } - if (strpos($value, '|') !== false) { - return $this->resolveSelectValue($value); - } - if (strpos($value, ',') !== false) { - return $this->resolveInlineValue($value, $config['foreign_table']); - } - if ($config['type'] === 'select' && is_array($config['items'])) { - return $this->resolveSelectItemValue($value, $config['items']); + if ($value === '' || $value === 'N/A') { + return []; } - return ''; + if ($tcaColumn['type'] === 'select' && strpos($value, ';') !== false) { + return $this->resolveForeignDbValue($value); + } + if (in_array($tcaColumn['type'], ['inline', 'group', 'select'])) { + return $this->resolveInlineValue($value); + } + + return []; } - /** - * @param string $value - * @return array - */ - protected function resolveFalRelations($value) - { - $files = GeneralUtility::trimExplode(',', $value); - $files = array_filter($files); - return array_map('intval', $files); - } - - /** - * @param array $config Column config. - * @return bool - */ protected function isRelation(array &$config) { return isset($config['foreign_table']) - || (isset($config['items']) && is_array($config['items'])) + || (isset($config['renderType']) && $config['renderType'] !== 'selectSingle') || (isset($config['internal_type']) && strtolower($config['internal_type']) === 'db') ; } - /** - * Resolves internal representation of select to array of labels. - * - * @param string $value - * @return array - */ - protected function resolveSelectValue($value) + protected function resolveForeignDbValue($value) { - $newValue = []; - - foreach (GeneralUtility::trimExplode(',', $value) as $value) { - $value = substr($value, strpos($value, '|') + 1); - $value = rawurldecode($value); - $newValue[] = $value; - } - - return $newValue; + return array_map('trim', explode(';', $value)); } - /** - * @param string $value - * @param string $table - * - * @return array - */ - protected function resolveInlineValue($value, $table) + protected function resolveInlineValue($value) { - $newValue = []; - $records = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', $table, 'uid in (' . $value . ')'); - if ($records === null) { - return $newValue; - } - - foreach ($records as $record) { - $newValue[] = BackendUtility::getRecordTitle($table, $record); - } - - return $newValue; - } - - /** - * @param string $value - * @param array $items - * - * @return string - */ - protected function resolveSelectItemValue($value, array $items) - { - foreach ($items as $item) { - if ($item[1] === $value) { - $newValue = LocalizationUtility::translate($item[0], ''); - - if ($newValue === null) { - return ''; - } - return $newValue; - } - } - - return ''; + return array_map('trim', explode(',', $value)); } } From dd0cfc2377f92cfb43d69c9c88d9892f30828f06 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Wed, 25 Oct 2017 11:48:56 +0200 Subject: [PATCH 07/13] FIX: get correct .travis.yml of support/76 branch --- .travis.yml | 44 +++++++++++++------------------------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index b6b969b..4490198 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,16 @@ +sudo: true + +addons: + apt: + packages: + - oracle-java8-set-default +before_install: + - curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.0.deb && sudo dpkg -i --force-confnew elasticsearch-5.2.0.deb && sudo service elasticsearch start + - mysql -u root -e 'GRANT ALL ON `typo3_ci_ft%`.* TO travis@127.0.0.1;' + language: php php: - - 5.6 - - 7.0 - 7.1 env: @@ -15,44 +23,18 @@ env: - typo3DatabaseHost="127.0.0.1" - typo3DatabaseUsername="travis" - typo3DatabasePassword="" - matrix: - - TYPO3_VERSION="~7.6" - - TYPO3_VERSION="~8" - - TYPO3_VERSION="dev-master" matrix: fast_finish: true - exclude: - # TYPO3 no longer supports 5.6 - - env: TYPO3_VERSION="~7.6" - php: 5.6 - - env: TYPO3_VERSION="~8" - php: 5.6 - - env: TYPO3_VERSION="dev-master" - php: 5.6 - allow_failures: - # 7 and 8 are not working due to current relation resolving. - # See: https://github.com/DanielSiepmann/search_core/projects/1 - - env: TYPO3_VERSION="~7.6" - php: 7.0 - - env: TYPO3_VERSION="~7.6" - php: 7.1 - - env: TYPO3_VERSION="~8" - php: 7.0 - - env: TYPO3_VERSION="~8" - php: 7.1 - - env: TYPO3_VERSION="dev-master" - php: 7.0 - - env: TYPO3_VERSION="dev-master" - php: 7.1 services: - mysql - - elasticsearch install: make install -script: make functionalTests +script: + - make unitTests + - make functionalTests after_script: - make uploadCodeCoverage From b8abaef0d2f408f853f4067fb1227be8c27485f1 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Wed, 25 Oct 2017 12:01:08 +0200 Subject: [PATCH 08/13] FIX: correct changes between support branches found by comparison --- .travis.yml | 3 +++ Makefile | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4490198..73a7888 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ before_install: language: php php: + - 5.6 + - 7.0 - 7.1 env: @@ -23,6 +25,7 @@ env: - typo3DatabaseHost="127.0.0.1" - typo3DatabaseUsername="travis" - typo3DatabasePassword="" + - TYPO3_VERSION="~7.6" matrix: fast_finish: true diff --git a/Makefile b/Makefile index b6bc72b..19220b9 100644 --- a/Makefile +++ b/Makefile @@ -4,15 +4,15 @@ current_dir := $(dir $(mkfile_path)) TYPO3_WEB_DIR := $(current_dir).Build/web TYPO3_PATH_ROOT := $(current_dir).Build/web # Allow different versions on travis -TYPO3_VERSION ?= ~8.7 -typo3DatabaseName ?= "searchcore_test2" +TYPO3_VERSION ?= ~7.6 +typo3DatabaseName ?= "searchcore_test" typo3DatabaseUsername ?= "dev" typo3DatabasePassword ?= "dev" typo3DatabaseHost ?= "127.0.0.1" .PHONY: install install: clean - COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-dist --ignore-platform-reqs typo3/cms="$(TYPO3_VERSION)" + COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source --ignore-platform-reqs typo3/cms="$(TYPO3_VERSION)" git checkout composer.json functionalTests: From 871f31ec79ddbc8066a63c2c8f8b9a86b62fdfff Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Wed, 25 Oct 2017 12:08:51 +0200 Subject: [PATCH 09/13] FIX: Set correct dependency versions --- composer.json | 2 +- ext_emconf.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 96c2dea..6020513 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require" : { "php": ">=5.6.0", - "typo3/cms": "~6.2", + "typo3/cms": "~7.6", "ruflin/elastica": "~3.2" }, "require-dev": { diff --git a/ext_emconf.php b/ext_emconf.php index 065896a..b2591d4 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -7,7 +7,7 @@ $EM_CONF[$_EXTKEY] = [ 'clearCacheOnLoad' => 1, 'constraints' => [ 'depends' => [ - 'typo3' => '6.2.0-6.2.99', + 'typo3' => '6.2.0-7.6.99', 'php' => '5.6.0-7.99.99' ], 'conflicts' => [], From 088b8589d69fffc8782a07117a2a92d0da2aba7c Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Thu, 9 Nov 2017 14:02:13 +0100 Subject: [PATCH 10/13] [TASK] remove php 5.6 build in travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 73a7888..d3660ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ before_install: language: php php: - - 5.6 - 7.0 - 7.1 From bcb57df3492ab1953e95a211ccb985dd6b3f5515 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Thu, 9 Nov 2017 14:08:05 +0100 Subject: [PATCH 11/13] [TASK] remove ignore-platform-reqs in makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 19220b9..72a1b9b 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ typo3DatabaseHost ?= "127.0.0.1" .PHONY: install install: clean - COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source --ignore-platform-reqs typo3/cms="$(TYPO3_VERSION)" + COMPOSER_PROCESS_TIMEOUT=1000 composer require -vv --dev --prefer-source typo3/cms="$(TYPO3_VERSION)" git checkout composer.json functionalTests: From 82bd5721eb6c4f63017969550f0e5a9876995a23 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Thu, 9 Nov 2017 14:09:27 +0100 Subject: [PATCH 12/13] [TASK] readd php5.6 in travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d3660ff..73a7888 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ before_install: language: php php: + - 5.6 - 7.0 - 7.1 From df9421433d405b0e17091d2d7817b5cd55b30038 Mon Sep 17 00:00:00 2001 From: Willi Wehmeier Date: Thu, 9 Nov 2017 14:22:51 +0100 Subject: [PATCH 13/13] [FIX] set correct TYPO3 version constraint in emconf --- ext_emconf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext_emconf.php b/ext_emconf.php index b2591d4..118e2df 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -7,7 +7,7 @@ $EM_CONF[$_EXTKEY] = [ 'clearCacheOnLoad' => 1, 'constraints' => [ 'depends' => [ - 'typo3' => '6.2.0-7.6.99', + 'typo3' => '7.6.0-7.6.99', 'php' => '5.6.0-7.99.99' ], 'conflicts' => [],