├── .github ├── ISSUE_TEMPLATE └── PULL_REQUEST_TEMPLATE ├── .gitignore ├── CHANGELOG.txt ├── FACT-Finder-PHP-Library.sublime-project ├── LICENSE.md ├── README.md ├── build-release.ps1 ├── build-release.sh ├── code-mockup-dataprovider.php ├── composer.json ├── docs ├── classes │ ├── FACTFinder.Adapter.AbstractAdapter.html │ ├── FACTFinder.Adapter.Compare.html │ ├── FACTFinder.Adapter.ConfigurableResponse.html │ ├── FACTFinder.Adapter.Import.html │ ├── FACTFinder.Adapter.PersonalisedResponse.html │ ├── FACTFinder.Adapter.ProductCampaign.html │ ├── FACTFinder.Adapter.Recommendation.html │ ├── FACTFinder.Adapter.Search.html │ ├── FACTFinder.Adapter.SimilarRecords.html │ ├── FACTFinder.Adapter.Suggest.html │ ├── FACTFinder.Adapter.TagCloud.html │ ├── FACTFinder.Adapter.Tracking.html │ ├── FACTFinder.Core.AbstractConfiguration.html │ ├── FACTFinder.Core.AbstractEncodingConverter.html │ ├── FACTFinder.Core.ArrayConfiguration.html │ ├── FACTFinder.Core.Client.RequestParser.html │ ├── FACTFinder.Core.Client.UrlBuilder.html │ ├── FACTFinder.Core.ConfigurationInterface.html │ ├── FACTFinder.Core.IConvEncodingConverter.html │ ├── FACTFinder.Core.ManualConfiguration.html │ ├── FACTFinder.Core.ParametersConverter.html │ ├── FACTFinder.Core.Server.AbstractDataProvider.html │ ├── FACTFinder.Core.Server.ConnectionData.html │ ├── FACTFinder.Core.Server.EasyCurlDataProvider.html │ ├── FACTFinder.Core.Server.EasyCurlRequestFactory.html │ ├── FACTFinder.Core.Server.FileSystemDataProvider.html │ ├── FACTFinder.Core.Server.FileSystemRequestFactory.html │ ├── FACTFinder.Core.Server.MultiCurlDataProvider.html │ ├── FACTFinder.Core.Server.MultiCurlRequestFactory.html │ ├── FACTFinder.Core.Server.NullResponse.html │ ├── FACTFinder.Core.Server.Request.html │ ├── FACTFinder.Core.Server.RequestFactoryInterface.html │ ├── FACTFinder.Core.Server.Response.html │ ├── FACTFinder.Core.Server.UrlBuilder.html │ ├── FACTFinder.Core.Utf8EncodingConverter.html │ ├── FACTFinder.Core.XmlConfiguration.html │ ├── FACTFinder.Data.AdvisorAnswer.html │ ├── FACTFinder.Data.AdvisorQuestion.html │ ├── FACTFinder.Data.AfterSearchNavigation.html │ ├── FACTFinder.Data.ArticleNumberSearchStatus.html │ ├── FACTFinder.Data.BreadCrumb.html │ ├── FACTFinder.Data.BreadCrumbTrail.html │ ├── FACTFinder.Data.BreadCrumbType.html │ ├── FACTFinder.Data.Campaign.html │ ├── FACTFinder.Data.CampaignIterator.html │ ├── FACTFinder.Data.Filter.html │ ├── FACTFinder.Data.FilterGroup.html │ ├── FACTFinder.Data.FilterSelectionType.html │ ├── FACTFinder.Data.FilterStyle.html │ ├── FACTFinder.Data.FilterType.html │ ├── FACTFinder.Data.Item.html │ ├── FACTFinder.Data.Page.html │ ├── FACTFinder.Data.Paging.html │ ├── FACTFinder.Data.Record.html │ ├── FACTFinder.Data.Result.html │ ├── FACTFinder.Data.ResultsPerPageOptions.html │ ├── FACTFinder.Data.SearchParameters.html │ ├── FACTFinder.Data.SearchStatus.html │ ├── FACTFinder.Data.SingleWordSearchItem.html │ ├── FACTFinder.Data.SliderFilter.html │ ├── FACTFinder.Data.Sorting.html │ ├── FACTFinder.Data.SortingDirection.html │ ├── FACTFinder.Data.SortingItem.html │ ├── FACTFinder.Data.SortingItems.html │ ├── FACTFinder.Data.SuggestQuery.html │ ├── FACTFinder.Data.TagQuery.html │ ├── FACTFinder.Loader.html │ ├── FACTFinder.Util.Curl.html │ ├── FACTFinder.Util.CurlHandle.html │ ├── FACTFinder.Util.CurlInterface.html │ ├── FACTFinder.Util.CurlMultiHandle.html │ ├── FACTFinder.Util.CurlStub.html │ ├── FACTFinder.Util.Log4PhpLogger.html │ ├── FACTFinder.Util.LoggerInterface.html │ ├── FACTFinder.Util.NullLogger.html │ ├── FACTFinder.Util.Parameters.html │ └── FACTFinder.Util.Pimple.html ├── files │ ├── Adapter.AbstractAdapter.html │ ├── Adapter.Compare.html │ ├── Adapter.ConfigurableResponse.html │ ├── Adapter.Import.html │ ├── Adapter.PersonalisedResponse.html │ ├── Adapter.ProductCampaign.html │ ├── Adapter.Recommendation.html │ ├── Adapter.Search.html │ ├── Adapter.SimilarRecords.html │ ├── Adapter.Suggest.html │ ├── Adapter.TagCloud.html │ ├── Adapter.Tracking.html │ ├── Adapter │ │ ├── AbstractAdapter.php.txt │ │ ├── Compare.php.txt │ │ ├── ConfigurableResponse.php.txt │ │ ├── Import.php.txt │ │ ├── PersonalisedResponse.php.txt │ │ ├── ProductCampaign.php.txt │ │ ├── Recommendation.php.txt │ │ ├── Search.php.txt │ │ ├── SimilarRecords.php.txt │ │ ├── Suggest.php.txt │ │ ├── TagCloud.php.txt │ │ └── Tracking.php.txt │ ├── Core.AbstractConfiguration.html │ ├── Core.AbstractEncodingConverter.html │ ├── Core.ArrayConfiguration.html │ ├── Core.Client.RequestParser.html │ ├── Core.Client.UrlBuilder.html │ ├── Core.ConfigurationInterface.html │ ├── Core.IConvEncodingConverter.html │ ├── Core.ManualConfiguration.html │ ├── Core.ParametersConverter.html │ ├── Core.Server.AbstractDataProvider.html │ ├── Core.Server.ConnectionData.html │ ├── Core.Server.EasyCurlDataProvider.html │ ├── Core.Server.EasyCurlRequestFactory.html │ ├── Core.Server.FileSystemDataProvider.html │ ├── Core.Server.FileSystemRequestFactory.html │ ├── Core.Server.MultiCurlDataProvider.html │ ├── Core.Server.MultiCurlRequestFactory.html │ ├── Core.Server.NullResponse.html │ ├── Core.Server.Request.html │ ├── Core.Server.RequestFactoryInterface.html │ ├── Core.Server.Response.html │ ├── Core.Server.UrlBuilder.html │ ├── Core.Utf8EncodingConverter.html │ ├── Core.XmlConfiguration.html │ ├── Core │ │ ├── AbstractConfiguration.php.txt │ │ ├── AbstractEncodingConverter.php.txt │ │ ├── ArrayConfiguration.php.txt │ │ ├── ConfigurationInterface.php.txt │ │ ├── ManualConfiguration.php.txt │ │ ├── ParametersConverter.php.txt │ │ ├── Server │ │ │ ├── EasyCurlDataProvider.php.txt │ │ │ ├── FileSystemDataProvider.php.txt │ │ │ └── Request.php.txt │ │ └── XmlConfiguration.php.txt │ ├── Data.AdvisorAnswer.html │ ├── Data.AdvisorQuestion.html │ ├── Data.AfterSearchNavigation.html │ ├── Data.ArticleNumberSearchStatus.html │ ├── Data.BreadCrumb.html │ ├── Data.BreadCrumbTrail.html │ ├── Data.BreadCrumbType.html │ ├── Data.Campaign.html │ ├── Data.CampaignIterator.html │ ├── Data.Filter.html │ ├── Data.FilterGroup.html │ ├── Data.FilterSelectionType.html │ ├── Data.FilterStyle.html │ ├── Data.FilterType.html │ ├── Data.Item.html │ ├── Data.Page.html │ ├── Data.Paging.html │ ├── Data.Record.html │ ├── Data.Result.html │ ├── Data.ResultsPerPageOptions.html │ ├── Data.SearchParameters.html │ ├── Data.SearchStatus.html │ ├── Data.SingleWordSearchItem.html │ ├── Data.SliderFilter.html │ ├── Data.Sorting.html │ ├── Data.SortingDirection.html │ ├── Data.SortingItem.html │ ├── Data.SortingItems.html │ ├── Data.SuggestQuery.html │ ├── Data.TagQuery.html │ ├── Data │ │ ├── ArticleNumberSearchStatus.php.txt │ │ ├── BreadCrumbType.php.txt │ │ ├── Campaign.php.txt │ │ ├── FilterGroup.php.txt │ │ ├── FilterStyle.php.txt │ │ ├── Item.php.txt │ │ ├── Result.php.txt │ │ ├── SearchParameters.php.txt │ │ ├── SliderFilter.php.txt │ │ ├── SortingDirection.php.txt │ │ ├── SortingItem.php.txt │ │ ├── SortingItems.php.txt │ │ └── SuggestQuery.php.txt │ ├── Loader.html │ ├── Loader.php.txt │ ├── Util.Curl.html │ ├── Util.CurlHandle.html │ ├── Util.CurlInterface.html │ ├── Util.CurlMultiHandle.html │ ├── Util.CurlStub.html │ ├── Util.Log4PhpLogger.html │ ├── Util.LoggerInterface.html │ ├── Util.NullLogger.html │ ├── Util.Parameters.html │ ├── Util.Pimple.html │ └── Util │ │ ├── CurlStub.php.txt │ │ ├── Log4PhpLogger.php.txt │ │ └── Parameters.php.txt ├── graphs │ └── class.html ├── index.html ├── namespaces │ ├── FACTFinder.Adapter.html │ ├── FACTFinder.Core.Client.html │ ├── FACTFinder.Core.Server.html │ ├── FACTFinder.Core.html │ ├── FACTFinder.Data.html │ ├── FACTFinder.Util.html │ ├── FACTFinder.html │ └── default.html ├── phpdoc-cache-0b │ └── phpdoc-cache-file_33307589aea3808c429961332e9481a7.dat ├── phpdoc-cache-0e │ └── phpdoc-cache-file_1a309d9a8ed00d6e6cf744f71748afd0.dat ├── phpdoc-cache-0f │ └── phpdoc-cache-file_0f22b7e93c133791913ed02d869a75cc.dat ├── phpdoc-cache-12 │ └── phpdoc-cache-file_e9b4b2d27bcf944d050e79550a2446e6.dat ├── phpdoc-cache-15 │ └── phpdoc-cache-file_4d10b1e3c380362050b80c16cfb1bfb0.dat ├── phpdoc-cache-17 │ └── phpdoc-cache-file_434ba7be6ab6873850ca2468eedf9c7b.dat ├── phpdoc-cache-19 │ └── phpdoc-cache-file_f2615b50c08b862de30c7a7815af5237.dat ├── phpdoc-cache-1d │ └── phpdoc-cache-file_5a60cf724e9b51a62c726fbdf42ad8c2.dat ├── phpdoc-cache-2c │ └── phpdoc-cache-file_e56cc8441ad0a4eb61cfd3e5ca6d8166.dat ├── phpdoc-cache-2d │ └── phpdoc-cache-file_9e926a9e867b9f4941e5574d0dc8379f.dat ├── phpdoc-cache-30 │ └── phpdoc-cache-file_8baceb4d02c4d6270cf480da4f4bb745.dat ├── phpdoc-cache-44 │ ├── phpdoc-cache-file_65161fd243a884891ffd4f9f6b8c5257.dat │ └── phpdoc-cache-file_eaa13a6fb342dc7273d5715651e08fcf.dat ├── phpdoc-cache-4a │ └── phpdoc-cache-file_d8fdb6ccbdda95b428863591b0bd99b3.dat ├── phpdoc-cache-4b │ └── phpdoc-cache-file_1c0eddcc26854457328068730148819d.dat ├── phpdoc-cache-4c │ └── phpdoc-cache-file_2ef510ff34b44a65679e704bfa2e7f32.dat ├── phpdoc-cache-4e │ └── phpdoc-cache-file_a0f05e95bb5fec2ab8bf166e979e4821.dat ├── phpdoc-cache-51 │ └── phpdoc-cache-file_9add38600b5ad33d8dd834cde18a4f5e.dat ├── phpdoc-cache-54 │ ├── phpdoc-cache-file_323a91c9d8682bdae2575c08219a0f60.dat │ └── phpdoc-cache-file_af036fa2ad64a41b8fb33abd9894728f.dat ├── phpdoc-cache-57 │ └── phpdoc-cache-file_8f26c4f72dbe8a692f871ba39a5ba13d.dat ├── phpdoc-cache-68 │ ├── phpdoc-cache-file_1884f410747a777df27638a26e43c637.dat │ └── phpdoc-cache-file_7b2ddadb79a9db3789ae7705de349ffb.dat ├── phpdoc-cache-6a │ └── phpdoc-cache-file_df2fd826a5cfac28bbad678474b13174.dat ├── phpdoc-cache-6b │ └── phpdoc-cache-file_b3d57ba841f9e3ea5eced0aeb4f3e007.dat ├── phpdoc-cache-6c │ └── phpdoc-cache-file_9e194925a1f4acfb4d9610ecd204ed8e.dat ├── phpdoc-cache-6d │ └── phpdoc-cache-file_7620b60c28cc18621b7d03ed429004da.dat ├── phpdoc-cache-70 │ └── phpdoc-cache-file_f261b34f904a2f07b932315bd1f8221d.dat ├── phpdoc-cache-72 │ └── phpdoc-cache-file_d0705324c0a7e536bb81ccef91aad19d.dat ├── phpdoc-cache-79 │ └── phpdoc-cache-file_beb231459868ceb986b9239709a3bb54.dat ├── phpdoc-cache-7a │ └── phpdoc-cache-file_157bbe64337ca2ac9bc58f1c951aefc3.dat ├── phpdoc-cache-7c │ └── phpdoc-cache-file_f0dbeba6938668729218879b06927892.dat ├── phpdoc-cache-84 │ ├── phpdoc-cache-file_053f3f772d264d7c7f0876824cd9e431.dat │ └── phpdoc-cache-file_cd229b3f3a844a6c8854823b814a9ffd.dat ├── phpdoc-cache-88 │ └── phpdoc-cache-file_44235ff93f4dfbb246036d05e2ceb2b2.dat ├── phpdoc-cache-97 │ └── phpdoc-cache-file_424e5945a226c8240e28f9314cd56922.dat ├── phpdoc-cache-98 │ └── phpdoc-cache-file_055eb9b8210ff5747407f007cdeedba8.dat ├── phpdoc-cache-9f │ ├── phpdoc-cache-file_66546b9b13f240ec6730383a52f00b82.dat │ └── phpdoc-cache-file_9b677e837c949a81f5ec0215271171cc.dat ├── phpdoc-cache-a1 │ ├── phpdoc-cache-file_0908bc8dc7143dc0ab90424aa0fec4cd.dat │ └── phpdoc-cache-file_95d3a0b6a81c57b666f856f96a6474f2.dat ├── phpdoc-cache-a5 │ ├── phpdoc-cache-file_6c902d6889ec297e1ef44efc8581201e.dat │ └── phpdoc-cache-file_8245d3567535282203d5c9053b7a90e0.dat ├── phpdoc-cache-aa │ └── phpdoc-cache-file_caf54d17e8254a13a8e022c8d1410950.dat ├── phpdoc-cache-ac │ └── phpdoc-cache-file_5df6e52676cc11d3c3a060f69fd5a968.dat ├── phpdoc-cache-ad │ └── phpdoc-cache-file_2043c00af8623208ade3d83280a0d0f5.dat ├── phpdoc-cache-af │ └── phpdoc-cache-file_5baa7b3d5179a928448643f2361d319d.dat ├── phpdoc-cache-b0 │ ├── phpdoc-cache-file_65a1aac43e7d5e29227dcfd473106365.dat │ └── phpdoc-cache-file_8c764ea44016858699e25aa49c2b3d12.dat ├── phpdoc-cache-b5 │ └── phpdoc-cache-file_53650eea8cbc5d362e45551a9822359a.dat ├── phpdoc-cache-b6 │ └── phpdoc-cache-file_f5a7bd75f8fff9594f69a0ce1f48dab3.dat ├── phpdoc-cache-bc │ └── phpdoc-cache-file_94a776e943ee8729f7752e95a30ada92.dat ├── phpdoc-cache-be │ └── phpdoc-cache-file_7543d0b8327f11ce91686970eae9f74f.dat ├── phpdoc-cache-bf │ ├── phpdoc-cache-file_319a6bb4660ce2916076d60930aed1c6.dat │ └── phpdoc-cache-file_9887b1c5db43accbccaa1b52114f6a04.dat ├── phpdoc-cache-c2 │ ├── phpdoc-cache-file_567bcb3eabd62b7371590a3ac209edae.dat │ └── phpdoc-cache-file_fc9729c6bcce824080c822ee721635e8.dat ├── phpdoc-cache-c4 │ ├── phpdoc-cache-file_a3474131532c1ab8fa681646a445a844.dat │ └── phpdoc-cache-file_bdddd84914260fe35cdf99fabe36b0c7.dat ├── phpdoc-cache-c7 │ └── phpdoc-cache-file_6ceada5c1b8cc6a20dea9ac0283f30cb.dat ├── phpdoc-cache-d1 │ └── phpdoc-cache-file_d19e62a884dd6e1a4a8e9d61e3c54ab9.dat ├── phpdoc-cache-d2 │ └── phpdoc-cache-file_abf52e79f7ae7ef525229c7e0ca0de63.dat ├── phpdoc-cache-d4 │ └── phpdoc-cache-file_877c90ccadb9af99cea65a365d6afd85.dat ├── phpdoc-cache-d7 │ └── phpdoc-cache-file_0d875190d6b1c41bf19be8fbde3ea6b2.dat ├── phpdoc-cache-dc │ └── phpdoc-cache-file_617eb6c009726251051c7b391cb92cc9.dat ├── phpdoc-cache-de │ ├── phpdoc-cache-file_1c6947417a817f57ebbd570f7ea23a4b.dat │ └── phpdoc-cache-file_d858b5149f2b77a9c072e95dc7f4b6a8.dat ├── phpdoc-cache-e9 │ └── phpdoc-cache-file_9b59cdc4eea1906dcbd97d9124ed58fb.dat ├── phpdoc-cache-eb │ └── phpdoc-cache-file_ad3ba64699b393f6c7cb12cbbd8d35f0.dat ├── phpdoc-cache-ec │ └── phpdoc-cache-file_1a757eec03a2dccf4b11f21c93dedb2b.dat ├── phpdoc-cache-f1 │ └── phpdoc-cache-file_55c26935ef652c44a57aa6946ce8ee69.dat ├── phpdoc-cache-f8 │ └── phpdoc-cache-file_8076834438b6398d9b9e91ae63545aa5.dat ├── phpdoc-cache-f9 │ ├── phpdoc-cache-file_9e010d120ca62b9b02e65d0e938808d5.dat │ └── phpdoc-cache-file_be2c2d2eaf612a1da0d7feba2ce6187b.dat ├── phpdoc-cache-fd │ └── phpdoc-cache-file_29ff93c78bb6f247fbc8ef40e1de88c8.dat ├── phpdoc-cache-fe │ └── phpdoc-cache-file_9faaa4056d2aeba5e7df96a9134fe9e7.dat ├── phpdoc-cache-ff │ └── phpdoc-cache-file_452dede6821d712aa584513b22bbcd49.dat └── reports │ ├── deprecated.html │ ├── errors.html │ └── markers.html ├── src ├── FACTFinder │ ├── Adapter │ │ ├── AbstractAdapter.php │ │ ├── Compare.php │ │ ├── ConfigurableResponse.php │ │ ├── Import.php │ │ ├── PersonalisedResponse.php │ │ ├── ProductCampaign.php │ │ ├── Recommendation.php │ │ ├── Search.php │ │ ├── SimilarRecords.php │ │ ├── Suggest.php │ │ ├── TagCloud.php │ │ └── Tracking.php │ ├── Core │ │ ├── AbstractConfiguration.php │ │ ├── AbstractEncodingConverter.php │ │ ├── ArrayConfiguration.php │ │ ├── Client │ │ │ ├── RequestParser.php │ │ │ └── UrlBuilder.php │ │ ├── ConfigurationInterface.php │ │ ├── IConvEncodingConverter.php │ │ ├── ManualConfiguration.php │ │ ├── Page │ │ │ └── .gitignore │ │ ├── ParametersConverter.php │ │ ├── Server │ │ │ ├── AbstractDataProvider.php │ │ │ ├── ConnectionData.php │ │ │ ├── EasyCurlDataProvider.php │ │ │ ├── EasyCurlRequestFactory.php │ │ │ ├── FileSystemDataProvider.php │ │ │ ├── FileSystemRequestFactory.php │ │ │ ├── MultiCurlDataProvider.php │ │ │ ├── MultiCurlRequestFactory.php │ │ │ ├── NullResponse.php │ │ │ ├── Request.php │ │ │ ├── RequestFactoryInterface.php │ │ │ ├── Response.php │ │ │ └── UrlBuilder.php │ │ ├── Utf8EncodingConverter.php │ │ └── XmlConfiguration.php │ ├── Custom │ │ └── .gitignore │ ├── Data │ │ ├── AdvisorAnswer.php │ │ ├── AdvisorQuestion.php │ │ ├── AfterSearchNavigation.php │ │ ├── ArticleNumberSearchStatus.php │ │ ├── BreadCrumb.php │ │ ├── BreadCrumbTrail.php │ │ ├── BreadCrumbType.php │ │ ├── Campaign.php │ │ ├── CampaignIterator.php │ │ ├── Filter.php │ │ ├── FilterGroup.php │ │ ├── FilterSelectionType.php │ │ ├── FilterStyle.php │ │ ├── FilterType.php │ │ ├── Item.php │ │ ├── Page.php │ │ ├── Paging.php │ │ ├── Record.php │ │ ├── Result.php │ │ ├── ResultsPerPageOptions.php │ │ ├── SearchParameters.php │ │ ├── SearchStatus.php │ │ ├── SingleWordSearchItem.php │ │ ├── SliderFilter.php │ │ ├── Sorting.php │ │ ├── SortingDirection.php │ │ ├── SortingItem.php │ │ ├── SortingItems.php │ │ ├── SuggestQuery.php │ │ └── TagQuery.php │ ├── Loader.php │ └── Util │ │ ├── Curl.php │ │ ├── CurlHandle.php │ │ ├── CurlInterface.php │ │ ├── CurlMultiHandle.php │ │ ├── CurlStub.php │ │ ├── Log4PhpLogger.php │ │ ├── LoggerInterface.php │ │ ├── NullLogger.php │ │ ├── Parameters.php │ │ └── Pimple.php └── log4php │ ├── Logger.php │ ├── LoggerAppender.php │ ├── LoggerAppenderPool.php │ ├── LoggerAutoloader.php │ ├── LoggerConfigurable.php │ ├── LoggerConfigurator.php │ ├── LoggerException.php │ ├── LoggerFilter.php │ ├── LoggerHierarchy.php │ ├── LoggerLayout.php │ ├── LoggerLevel.php │ ├── LoggerLocationInfo.php │ ├── LoggerLoggingEvent.php │ ├── LoggerMDC.php │ ├── LoggerNDC.php │ ├── LoggerReflectionUtils.php │ ├── LoggerRoot.php │ ├── LoggerThrowableInformation.php │ ├── appenders │ ├── LoggerAppenderConsole.php │ ├── LoggerAppenderDailyFile.php │ ├── LoggerAppenderEcho.php │ ├── LoggerAppenderFile.php │ ├── LoggerAppenderFirePHP.php │ ├── LoggerAppenderMail.php │ ├── LoggerAppenderMailEvent.php │ ├── LoggerAppenderMongoDB.php │ ├── LoggerAppenderNull.php │ ├── LoggerAppenderPDO.php │ ├── LoggerAppenderPhp.php │ ├── LoggerAppenderRollingFile.php │ ├── LoggerAppenderSocket.php │ └── LoggerAppenderSyslog.php │ ├── configurators │ ├── LoggerConfigurationAdapter.php │ ├── LoggerConfigurationAdapterINI.php │ ├── LoggerConfigurationAdapterPHP.php │ ├── LoggerConfigurationAdapterXML.php │ └── LoggerConfiguratorDefault.php │ ├── filters │ ├── LoggerFilterDenyAll.php │ ├── LoggerFilterLevelMatch.php │ ├── LoggerFilterLevelRange.php │ └── LoggerFilterStringMatch.php │ ├── helpers │ ├── LoggerFormattingInfo.php │ ├── LoggerOptionConverter.php │ ├── LoggerPatternParser.php │ └── LoggerUtils.php │ ├── layouts │ ├── LoggerLayoutHtml.php │ ├── LoggerLayoutPattern.php │ ├── LoggerLayoutSerialized.php │ ├── LoggerLayoutSimple.php │ ├── LoggerLayoutTTCC.php │ └── LoggerLayoutXml.php │ ├── pattern │ ├── LoggerPatternConverter.php │ ├── LoggerPatternConverterClass.php │ ├── LoggerPatternConverterCookie.php │ ├── LoggerPatternConverterDate.php │ ├── LoggerPatternConverterEnvironment.php │ ├── LoggerPatternConverterFile.php │ ├── LoggerPatternConverterLevel.php │ ├── LoggerPatternConverterLine.php │ ├── LoggerPatternConverterLiteral.php │ ├── LoggerPatternConverterLocation.php │ ├── LoggerPatternConverterLogger.php │ ├── LoggerPatternConverterMDC.php │ ├── LoggerPatternConverterMessage.php │ ├── LoggerPatternConverterMethod.php │ ├── LoggerPatternConverterNDC.php │ ├── LoggerPatternConverterNewLine.php │ ├── LoggerPatternConverterProcess.php │ ├── LoggerPatternConverterRelative.php │ ├── LoggerPatternConverterRequest.php │ ├── LoggerPatternConverterServer.php │ ├── LoggerPatternConverterSession.php │ ├── LoggerPatternConverterSessionID.php │ ├── LoggerPatternConverterSuperglobal.php │ └── LoggerPatternConverterThrowable.php │ ├── renderers │ ├── LoggerRenderer.php │ ├── LoggerRendererDefault.php │ ├── LoggerRendererException.php │ └── LoggerRendererMap.php │ └── xml │ └── log4php.dtd └── tests ├── Adapter ├── CompareTest.php ├── ImportTest.php ├── ProductCampaignTest.php ├── RecommendationTest.php ├── SearchTest.php ├── SimilarRecordsTest.php ├── SuggestTest.php ├── TagCloudTest.php └── TrackingTest.php ├── BaseTestCase.php ├── Core ├── ArrayConfigurationTest.php ├── Client │ ├── RequestParserTest.php │ └── UrlBuilderTest.php ├── IConvEncodingConverterTest.php ├── ManualConfigurationTest.php ├── ParametersConverterTest.php ├── Server │ ├── ConnectionDataTest.php │ ├── EasyCurlDataProviderTest.php │ ├── EasyCurlRequestFactoryTest.php │ ├── FileSystemDataProviderTest.php │ ├── FileSystemRequestFactoryTest.php │ ├── MultiCurlDataProviderTest.php │ ├── MultiCurlRequestFactoryTest.php │ ├── NullResponseTest.php │ ├── RequestTest.php │ ├── ResponseTest.php │ └── UrlBuilderTest.php ├── Utf8EncodingConverterTest.php └── XmlConfigurationTest.php ├── Data ├── ArticleNumberSearchStatusTest.php ├── BreadCrumbTypeTest.php ├── FilterSelectionTypeTest.php ├── FilterStyleTest.php ├── FilterTypeTest.php ├── SearchParametersTest.php ├── SearchStatusTest.php └── SortingDirectionTest.php ├── Util ├── CurlStubEasyTest.php ├── CurlStubMultiTest.php └── ParametersTest.php ├── bootstrap.php ├── phpunit-coverage.xml ├── phpunit.xml └── resources ├── config.php ├── config.xml ├── log4php.xml └── responses ├── Compare.321116f225b95696dd2cafcaa51a2672.json ├── Import.844a5c89c89bea171adf1c3c9a1729b8.xml ├── Import.a4bc62d5d9902c5541c5185afebfe648.xml ├── ProductCampaign.352a6bad748b50a6d115d148621f975e.json ├── ProductCampaign.38137e7aaeeb7adc088f04950c6b8c12.json ├── ProductCampaign.663b8f17e0f46b2551fa572e477562d6.json ├── ProductCampaign.70a599881206e33b5b7de01bada8e80e.json ├── ProductCampaign.ddc85811988a3ce1d3e36333d6cfbb8e.json ├── Recommender.19bf53a3da240560cc52d8d64afd7738.json ├── Recommender.458ff06163902ca9ab116c2af83d8822.json ├── Recommender.5346e6860c6dc90638bdabcfdeba1409.xml ├── Recommender.5573182e743503ec59b699001b3d9013.json ├── Recommender.6d0c178098da25a3e330b572d0ac9bf5.json ├── Recommender.c8a5e11101a387f172faa9a0e2afe0a6.json ├── Search.5dc9a7af6795b32accb673299b96ffbd.json ├── Search.83a57102ce8aa0ff3816a8db5742d1bf.json ├── Search.8854de8076908229b9fe479c8d8ad9ac.json ├── Search.c507903fea6dfb74d4cea3ee061f00f8.json ├── Search.d45bc6c3191b890eff59f5db77f939e6.json ├── Search.dec35fbbd93a3010d9dc0a2a2b03c32e.json ├── SimilarRecords.1593eac7948cac5e57ea875d85469d1f.json ├── SimilarRecords.23f77c8e44aca8b6aa88d706ac218192.json ├── SimilarRecords.651f51fe3a2a8afafd7c8864b664db60.json ├── SimilarRecords.c17f7d2a6e34270aec58a412a8732599.json ├── Suggest.6a04ee7d32f09b252b21e4f2781ff14f.jsonp ├── Suggest.83a57102ce8aa0ff3816a8db5742d1bf.json ├── Suggest.83a57102ce8aa0ff3816a8db5742d1bf.raw ├── TagCloud.86b6b33590e092674009abfe3d7fc170.json ├── TagCloud.897e35880b61d7aa8b4f7efb05f80543.json ├── Tracking.4446d2c43f9ba331b67de05285465e05.raw ├── Tracking.8a9e67e07ad8e3cbc23f7892a7d78a39.raw ├── Tracking.a06e15af39100870e12137d1d4e741c2.raw ├── Tracking.b34f64c0aa7da15837309840708db491.raw ├── Tracking.e7ddc998961b8255e53556c7a6605070.raw └── Tracking.f187577ce93dd3fb117cbd07211fe412.raw /.github/ISSUE_TEMPLATE: -------------------------------------------------------------------------------- 1 | - FACT-Finder PHP Library version: 2 | - PHP version: 3 | - Expected behavior: 4 | - Actual behavior: 5 | - Steps to reproduce: 6 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE: -------------------------------------------------------------------------------- 1 | - Solves issue # 2 | - Description 3 | 4 | ### Please note that the source and target branch must be "development" (details: https://github.com/FACT-Finder/FACT-Finder-PHP-Library/wiki/Guide-for-contributors). 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /FACT-Finder-PHP-Library.sublime-workspace 2 | 3 | /tests/ff.log 4 | 5 | /countloc.ps1 6 | /tests/report 7 | 8 | phpdoc*.log 9 | .idea/ 10 | -------------------------------------------------------------------------------- /FACT-Finder-PHP-Library.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "path": "." 6 | } 7 | ], 8 | 9 | "settings": 10 | { 11 | "rulers": [80, 120], 12 | "default_encoding": "UTF-8", 13 | "default_line_ending": "unix", 14 | "ensure_newline_at_eof_on_save": true, 15 | "todo": { 16 | "folder_exclude_patterns": [ 17 | "log4php", 18 | "report" 19 | ], 20 | "file_exclude_patterns": [ 21 | "Pimple.php" 22 | ] 23 | }, 24 | "trim_trailing_white_space_on_save": true 25 | }, 26 | 27 | "build_systems": 28 | [ 29 | { 30 | "name": "FACT-Finder PHP Library", 31 | "cmd": ["phpunit", 32 | "--configuration", "phpunit.xml", 33 | "."], 34 | "shell": "true", 35 | "file_regex": "^(?:Notice|Warning|Error|Fatal error|Parse error|Exception):(?=.*in (.*) on line (\\d+)())? ((?:(?! in ).)*)", 36 | "working_dir": "$project_path/tests", 37 | "variants": [ 38 | { 39 | "name": "Run", 40 | "cmd": ["phpunit", 41 | "--configuration", "phpunit-coverage.xml", 42 | "."] 43 | }, 44 | { 45 | "name": "PHPDoc", 46 | "cmd": ["phpdoc", 47 | "-d", "src/FACTFinder", 48 | "-t", "docs", 49 | "--template", "clean", 50 | "--sourcecode"], 51 | "working_dir": "$project_path" 52 | } 53 | ] 54 | } 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Omikron Data Quality GmbH 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | FACT-Finder-PHP-Library 2 | ======================= 3 | 4 | This is a complete rewrite of and replaces the old 5 | [FACT Finder PHP Library](https://github.com/FACT-Finder/FACT-Finder-PHP-Framework). 6 | 7 | For usage, see the [**demo**](https://github.com/FACT-Finder/FACT-Finder-PHP-Library-Demo). 8 | 9 | For documentation please see [the library's GitHub wiki](https://github.com/FACT-Finder/FACT-Finder-PHP-Library/wiki) as well as [the demo's GitHub wiki](https://github.com/FACT-Finder/FACT-Finder-PHP-Library-Demo/wiki). There is also source documentation generated with [phpDocumentor](http://www.phpdoc.org/), which you can view if you clone the repository. 10 | 11 | If you want to contribute to the library, please see our [guide for contributors](https://github.com/FACT-Finder/FACT-Finder-PHP-Library/wiki/Guide-for-contributors). 12 | 13 | 14 | Motivation & Goals 15 | ------------------ 16 | 17 | - No longer support multiple FACT-Finder versions and interfaces at once, as 18 | legacy code and deep inheritance trees make the project increasingly hard to 19 | maintain. 20 | - Use the recommended FACT-Finder interface (JSON) instead of providing every 21 | possibility. 22 | - Make the API clearer and more easily accessible to give developers more 23 | control over the requests to FACT-Finder. 24 | 25 | Documentation ToDos 26 | ------------------- 27 | 28 | - PHPDoc of the code 29 | - General documentation in GitHub wiki 30 | - How to use 31 | -------------------------------------------------------------------------------- /build-release.ps1: -------------------------------------------------------------------------------- 1 | # This script assumes that the 'release' branch is actually ready for release. 2 | # That includes merging in all relevant changes for the release (in particular 3 | # the 'development' branch), and adding a new entry to CHANGELOG.txt. The latter 4 | # is very important as the target version will be read from that file. 5 | # You do NOT need to build the documentation yet. This script takes care of 6 | # that. 7 | # Note that this script does NOT merge the updated 'release' branch back into 8 | # 'development'. If you need the documentation, CHANGELOG or other commits on 9 | # 'release' in 'development', you'll need to do that extra merge manually. 10 | # We recommend that you use git's credential cache or an SSH agent so you don't 11 | # have to enter your credentials several times during the script. 12 | 13 | ################################################################################ 14 | 15 | # Make the project root directory the working directory (regardless of where the 16 | # script has been called from). 17 | 18 | $scriptPath = $MyInvocation.MyCommand.Path 19 | $dir = Split-Path $scriptPath 20 | Push-Location $dir 21 | 22 | # Read current branch 23 | 24 | $branch = git status | Select-String -Pattern "On branch (.*)" -List ` 25 | | %{$_.matches[0].groups[1].value} 26 | 27 | git checkout release 28 | 29 | # Read version 30 | 31 | $version = Select-String -Pattern "Version\s+([\d\w.-]+)" -List .\CHANGELOG.txt ` 32 | | %{$_.matches[0].groups[1].value} 33 | 34 | # Build and commit documentation 35 | 36 | phpdoc -d src/FACTFinder -t docs --template clean --sourcecode 37 | git add --all docs 38 | git commit -m "Update documentation for release $version" 39 | git push origin release 40 | 41 | # Prepare and push master branch 42 | 43 | git checkout master 44 | git merge --no-ff --log release 45 | git push origin master 46 | 47 | # Prepare and push src-only branch 48 | 49 | git subtree split --prefix=src --onto=src-only --branch=src-only 50 | git push origin src-only 51 | 52 | # Create release tags 53 | 54 | git tag $version 55 | git tag $version+src src-only 56 | 57 | git push --tags origin 58 | 59 | # Move back to original branch 60 | 61 | git checkout $branch 62 | 63 | Pop-Location 64 | -------------------------------------------------------------------------------- /build-release.sh: -------------------------------------------------------------------------------- 1 | # TODO: This still needs to be ported from build-release.ps1 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fact-finder/fact-finder-php-library", 3 | "description": "FACT Finder PHP Library", 4 | "license": "GPL-3.0", 5 | "keywords": [ 6 | "fact finder", 7 | "fact finder php library" 8 | ], 9 | "homepage": "https://github.com/FACT-Finder/FACT-Finder-PHP-Library", 10 | "authors": [ 11 | { 12 | "name": "Martin Büttner" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.3.0" 17 | }, 18 | "autoload": { 19 | "psr-0": { 20 | "FACTFinder\\": "src/" 21 | } 22 | }, 23 | "autoload-dev": { 24 | "psr-4": { 25 | "FACTFinder\\Test\\": "tests/" 26 | } 27 | }, 28 | "archive": { 29 | "exclude": ["/tests", "/build-*", "/code-mockup-dataprovider.php", "/FACT-Finder-PHP-Library.sublime-project"] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /docs/files/Adapter/ConfigurableResponse.php.txt: -------------------------------------------------------------------------------- 1 | idsOnly && !$idsOnly) 47 | $this->upToDate = false; 48 | 49 | $this->idsOnly = $idsOnly; 50 | $parameters = $this->request->getParameters(); 51 | $parameters['idsOnly'] = $idsOnly ? 'true' : 'false'; 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /docs/files/Adapter/PersonalisedResponse.php.txt: -------------------------------------------------------------------------------- 1 | sid) !== 0) { 47 | $this->sid = $sessionId; 48 | $this->parameters['sid'] = $this->sid; 49 | $this->upToDate = false; 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /docs/files/Data/ArticleNumberSearchStatus.php.txt: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$isArticleNumberResultFound = new ArticleNumberSearchStatus(); 27 | self::$isNoArticleNumberResultFound = new ArticleNumberSearchStatus(); 28 | self::$isNoArticleNumberSearch = new ArticleNumberSearchStatus(); 29 | 30 | self::$initialized = true; 31 | } 32 | } 33 | 34 | static public function IsArticleNumberResultFound() { return self::$isArticleNumberResultFound; } 35 | static public function IsNoArticleNumberResultFound() { return self::$isNoArticleNumberResultFound; } 36 | static public function IsNoArticleNumberSearch() { return self::$isNoArticleNumberSearch; } 37 | } 38 | 39 | ArticleNumberSearchStatus::initialize(); 40 | 41 | -------------------------------------------------------------------------------- /docs/files/Data/BreadCrumbType.php.txt: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$search = new BreadCrumbType(); 27 | self::$filter = new BreadCrumbType(); 28 | self::$advisor = new BreadCrumbType(); 29 | 30 | self::$initialized = true; 31 | } 32 | } 33 | 34 | static public function Search() { return self::$search; } 35 | static public function Filter() { return self::$filter; } 36 | static public function Advisor() { return self::$advisor; } 37 | } 38 | 39 | BreadCrumbType::initialize(); 40 | 41 | -------------------------------------------------------------------------------- /docs/files/Data/FilterStyle.php.txt: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 27 | } 28 | 29 | // Another workaround! We need to initialize those private properties with 30 | // instances of the class, but PHP does not allow calling functions 31 | // (including constructors) when declaring properties. Hence, we need a 32 | // static class constructor to do that. But PHP does not have those either, 33 | // so we write our own and call it at the end of the file. At the same time, 34 | // we use a private flag to ensure that after this file has been loaded, 35 | // calling the initializer again will have no effect. 36 | // By the way, alternatively we could generate these instances lazily in all 37 | // the getters at the bottom. 38 | static private $initialized = false; 39 | static public function initialize() 40 | { 41 | if (!self::$initialized) 42 | { 43 | self::$regular = new FilterStyle(); 44 | self::$slider = new FilterStyle(); 45 | self::$tree = new FilterStyle(); 46 | self::$multiSelect = new FilterStyle(); 47 | 48 | self::$initialized = true; 49 | } 50 | } 51 | 52 | // Let's provide read-access to those instances. 53 | static public function Regular() { return self::$regular; } 54 | static public function Slider() { return self::$slider; } 55 | static public function Tree() { return self::$tree; } 56 | static public function MultiSelect() { return self::$multiSelect; } 57 | } 58 | 59 | // And finally we call the class initializer. 60 | FilterStyle::initialize(); 61 | 62 | -------------------------------------------------------------------------------- /docs/files/Data/Item.php.txt: -------------------------------------------------------------------------------- 1 | label = (string)$label; 39 | $this->url = (string)$url; 40 | $this->selected = (bool)$isSelected; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function getLabel() 47 | { 48 | return $this->label; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function getUrl() 55 | { 56 | return $this->url; 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function setUrl($url) 63 | { 64 | $this->url = $url; 65 | } 66 | 67 | /** 68 | * @return bool 69 | */ 70 | public function isSelected() 71 | { 72 | return $this->selected; 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /docs/files/Data/Result.php.txt: -------------------------------------------------------------------------------- 1 | foundRecordsCount = (int)$foundRecordsCount; 29 | } 30 | 31 | /** 32 | * @return int 33 | */ 34 | public function getFoundRecordsCount() 35 | { 36 | return $this->foundRecordsCount; 37 | } 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /docs/files/Data/SortingDirection.php.txt: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$asc = new SortingDirection(); 27 | self::$desc = new SortingDirection(); 28 | 29 | self::$initialized = true; 30 | } 31 | } 32 | 33 | static public function Ascending() { return self::$asc; } 34 | static public function Descending() { return self::$desc; } 35 | } 36 | 37 | SortingDirection::initialize(); 38 | 39 | -------------------------------------------------------------------------------- /docs/files/Data/SortingItem.php.txt: -------------------------------------------------------------------------------- 1 | name = (string)$name; 37 | $this->order = $order; 38 | } 39 | 40 | /** 41 | * @return string 42 | */ 43 | public function getName() 44 | { 45 | return $this->name; 46 | } 47 | 48 | /** 49 | * @return bool 50 | */ 51 | public function isAscending() 52 | { 53 | $orderEnum = FF::getClassName('Data\SortingDirection'); 54 | return $this->order == $orderEnum::Ascending(); 55 | } 56 | 57 | /** 58 | * @return bool 59 | */ 60 | public function isDescending() 61 | { 62 | $orderEnum = FF::getClassName('Data\SortingDirection'); 63 | return $this->order == $orderEnum::Descending(); 64 | } 65 | } 66 | 67 | -------------------------------------------------------------------------------- /docs/files/Data/SortingItems.php.txt: -------------------------------------------------------------------------------- 1 | hitCount = (int)$hitCount; 35 | $this->type = (string)$type; 36 | $this->imageUrl = (string)$imageUrl; 37 | $this->attributes = $attributes; 38 | } 39 | 40 | /** 41 | * @return int Indicates how many products this suggestions will lead to. 42 | */ 43 | public function getHitCount() { 44 | return $this->hitCount; 45 | } 46 | 47 | /** 48 | * @return string Indicates where this suggest query comes from (e.g. 49 | * product name, category, log file). 50 | */ 51 | public function getType() { 52 | return $this->type; 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getImageUrl() { 59 | return $this->imageUrl; 60 | } 61 | 62 | /** 63 | * @return array Returns the additional return data fields 64 | */ 65 | public function getAttributes() { 66 | return $this->attributes; 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /docs/files/Util/Log4PhpLogger.php.txt: -------------------------------------------------------------------------------- 1 | log = \Logger::getLogger($name); 42 | } 43 | 44 | public function trace($message) 45 | { 46 | $this->log->trace($message); 47 | } 48 | 49 | public function debug($message) 50 | { 51 | $this->log->debug($message); 52 | } 53 | 54 | public function info($message) 55 | { 56 | $this->log->info($message); 57 | } 58 | 59 | public function warn($message) 60 | { 61 | $this->log->warn($message); 62 | } 63 | 64 | public function error($message) 65 | { 66 | $this->log->error($message); 67 | } 68 | 69 | public function fatal($message) 70 | { 71 | $this->log->fatal($message); 72 | } 73 | 74 | } 75 | 76 | -------------------------------------------------------------------------------- /src/FACTFinder/Adapter/ConfigurableResponse.php: -------------------------------------------------------------------------------- 1 | idsOnly && !$idsOnly) 47 | $this->upToDate = false; 48 | 49 | $this->idsOnly = $idsOnly; 50 | $parameters = $this->request->getParameters(); 51 | $parameters['idsOnly'] = $idsOnly ? 'true' : 'false'; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/FACTFinder/Adapter/PersonalisedResponse.php: -------------------------------------------------------------------------------- 1 | sid) !== 0) { 47 | $this->sid = $sessionId; 48 | $this->parameters['sid'] = $this->sid; 49 | $this->upToDate = false; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/Client/UrlBuilder.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 38 | 39 | $this->parametersConverter = FF::getInstance( 40 | 'Core\ParametersConverter', 41 | $loggerClass, 42 | $configuration 43 | ); 44 | $this->requestParser = $requestParser; 45 | $this->encodingConverter = $encodingConverter; 46 | } 47 | 48 | /** 49 | * Generates a link to be used on the page that leads to the client from a 50 | * set of server parameters. Note that the link will still be UTF-8 encoded. 51 | * If the page uses a different encoding, conversion to that encoding has to 52 | * be done when actually rendering the string to the page. 53 | * 54 | * TODO: Should the signature be more similar to that of \Server\UrlBuilder? 55 | * 56 | * @param FACTFinder\Util\Parameters $parameters The server parameters that 57 | * should be retrieved when the link is followed. 58 | * @param string $target An optional request target. If omitted, the target 59 | * of the current request will be used. For instance, this parameter 60 | * can be used if a product detail page needs a different target. 61 | * 62 | * @return string 63 | */ 64 | public function generateUrl($parameters, $target = null) 65 | { 66 | $parameters = $this->parametersConverter 67 | ->convertServerToClientParameters($parameters); 68 | 69 | $parameters = $this->encodingConverter != null ? $this->encodingConverter->encodeClientUrlData($parameters) : $parameters; 70 | 71 | if (!is_string($target)) 72 | $target = $this->requestParser->getRequestTarget(); 73 | 74 | if ($parameters->offsetExists('seoPath')) { 75 | $seoPath = $parameters['seoPath']; 76 | $parameters->offsetUnset('seoPath'); 77 | $seoPathPosition = strrpos($target, "/s/"); 78 | if ($seoPathPosition > -1) { 79 | $target = substr($target, 0, $seoPathPosition); 80 | } 81 | $url = rtrim($target, '/') . '/s' . urldecode($seoPath) . '?' . $parameters->toPhpQueryString(); 82 | } else { 83 | $url = $target . '?' . $parameters->toPhpQueryString(); 84 | } 85 | return $url; 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/IConvEncodingConverter.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 15 | } 16 | 17 | protected function convertString($inCharset, $outCharset, $string) 18 | { 19 | if ($inCharset == $outCharset 20 | || empty($inCharset) 21 | || empty($outCharset) 22 | ) { 23 | return $string; 24 | } 25 | // See http://www.php.net/manual/en/function.iconv.php for more 26 | // information on '//TRANSLIT'. 27 | $result = iconv($inCharset, $outCharset.'//TRANSLIT', $string); 28 | 29 | if ($result === false) 30 | { 31 | $this->log->warn( 32 | "Conversion from $inCharset to $outCharset not possible. " 33 | . "The string is still encoded with $inCharset." 34 | ); 35 | $result = $string; 36 | } 37 | 38 | return $result; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/Page/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FACT-Finder/FACT-Finder-PHP-Library/5c795b94117fa7ac40f5e80d4edc93999a76fc90/src/FACTFinder/Core/Page/.gitignore -------------------------------------------------------------------------------- /src/FACTFinder/Core/Server/EasyCurlRequestFactory.php: -------------------------------------------------------------------------------- 1 | loggerClass = $loggerClass; 46 | $this->log = $loggerClass::getLogger(__CLASS__); 47 | $this->configuration = $configuration; 48 | 49 | $urlBuilder = FF::getInstance('Core\Server\UrlBuilder', 50 | $loggerClass, 51 | $configuration 52 | ); 53 | $this->dataProvider = FF::getInstance('Core\Server\EasyCurlDataProvider', 54 | $loggerClass, 55 | $configuration, 56 | is_null($curl) ? FF::getInstance('Util\Curl') : $curl, 57 | $urlBuilder 58 | ); 59 | 60 | $this->requestParameters = $requestParameters; 61 | } 62 | 63 | /** 64 | * Returns a request object all wired up and ready for use. 65 | * @return Request 66 | */ 67 | public function getRequest() 68 | { 69 | $connectionData = FF::getInstance( 70 | 'Core\Server\ConnectionData', 71 | clone $this->requestParameters 72 | ); 73 | return FF::getInstance('Core\Server\Request', 74 | $this->loggerClass, 75 | $connectionData, 76 | $this->dataProvider 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/Server/FileSystemRequestFactory.php: -------------------------------------------------------------------------------- 1 | loggerClass = $loggerClass; 38 | $this->log = $loggerClass::getLogger(__CLASS__); 39 | $this->configuration = $configuration; 40 | 41 | $this->dataProvider = FF::getInstance('Core\Server\FileSystemDataProvider', 42 | $loggerClass, 43 | $configuration 44 | ); 45 | 46 | $this->requestParameters = $requestParameters; 47 | } 48 | 49 | public function setFileLocation($path) 50 | { 51 | $this->dataProvider->setFileLocation($path); 52 | } 53 | 54 | /** 55 | * Returns a request object all wired up and ready for use. 56 | * @return Request 57 | */ 58 | public function getRequest() 59 | { 60 | $connectionData = FF::getInstance( 61 | 'Core\Server\ConnectionData', 62 | clone $this->requestParameters 63 | ); 64 | return FF::getInstance('Core\Server\Request', 65 | $this->loggerClass, 66 | $connectionData, 67 | $this->dataProvider 68 | ); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/Server/MultiCurlRequestFactory.php: -------------------------------------------------------------------------------- 1 | loggerClass = $loggerClass; 46 | $this->log = $loggerClass::getLogger(__CLASS__); 47 | $this->configuration = $configuration; 48 | 49 | $urlBuilder = FF::getInstance('Core\Server\UrlBuilder', 50 | $loggerClass, 51 | $configuration 52 | ); 53 | $this->dataProvider = FF::getInstance('Core\Server\MultiCurlDataProvider', 54 | $loggerClass, 55 | $configuration, 56 | is_null($curl) ? FF::getInstance('Util\Curl') : $curl, 57 | $urlBuilder 58 | ); 59 | 60 | $this->requestParameters = $requestParameters; 61 | } 62 | 63 | /** 64 | * Returns a request object all wired up and ready for use. 65 | * @return Request 66 | */ 67 | public function getRequest() 68 | { 69 | $connectionData = FF::getInstance( 70 | 'Core\Server\ConnectionData', 71 | clone $this->requestParameters 72 | ); 73 | return FF::getInstance('Core\Server\Request', 74 | $this->loggerClass, 75 | $connectionData, 76 | $this->dataProvider 77 | ); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/Server/NullResponse.php: -------------------------------------------------------------------------------- 1 | content = $content; 36 | $this->httpCode = $httpCode; 37 | $this->connectionErrorCode = $connectionErrorCode; 38 | $this->connectionError = $connectionError; 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | public function getContent() 45 | { 46 | return $this->content; 47 | } 48 | 49 | /** 50 | * @return int 51 | */ 52 | public function getHttpCode() 53 | { 54 | return $this->httpCode; 55 | } 56 | 57 | /** 58 | * @return int 59 | */ 60 | public function getConnectionErrorCode() 61 | { 62 | return $this->connectionErrorCode; 63 | } 64 | 65 | /** 66 | * @return string 67 | */ 68 | public function getConnectionError() 69 | { 70 | return $this->connectionError; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /src/FACTFinder/Core/Utf8EncodingConverter.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 16 | } 17 | 18 | protected function convertString($inCharset, $outCharset, $string) 19 | { 20 | if (strtolower($inCharset) != strtolower($outCharset) 21 | && !empty($inCharset) 22 | && !empty($outCharset) 23 | ) { 24 | if (strtolower($inCharset) == 'utf-8') 25 | { 26 | if (strtolower($outCharset) != 'iso-8859-1') 27 | $this->log->warn( 28 | "utf8_decode() does not support $outCharset. If $outCharset is not compatible with ISO-8859-1, " 29 | . "the resulting string may contain wrong or invalid characters." 30 | ); 31 | $string = utf8_decode($string); 32 | } 33 | else if (strtolower($outCharset) == 'utf-8') 34 | { 35 | if (strtolower($inCharset) != 'iso-8859-1') 36 | $this->log->warn( 37 | "utf8_encode() does not support $inCharset. If $inCharset is not compatible with ISO-8859-1, " 38 | . "the resulting string may contain wrong characters." 39 | ); 40 | $string = utf8_encode($string); 41 | } 42 | else 43 | { 44 | $this->log->error("Conversion between non-UTF-8 encodings not possible."); 45 | throw new \InvalidArgumentException("Cannot handle conversion from $inCharset to $outCharset!"); 46 | } 47 | } 48 | return $string; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/FACTFinder/Custom/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FACT-Finder/FACT-Finder-PHP-Library/5c795b94117fa7ac40f5e80d4edc93999a76fc90/src/FACTFinder/Custom/.gitignore -------------------------------------------------------------------------------- /src/FACTFinder/Data/AdvisorAnswer.php: -------------------------------------------------------------------------------- 1 | followUpQuestions = $followUpQuestions; 25 | } 26 | 27 | /** 28 | * This is just an alias. 29 | * @see Item::getLabel() 30 | */ 31 | public function getText() 32 | { 33 | return $this->getLabel(); 34 | } 35 | 36 | /** 37 | * @param AdvisorQuestion[] $followUpQuestions 38 | */ 39 | public function addFollowUpQuestions(array $followUpQuestions) 40 | { 41 | foreach ($followUpQuestions as $question) 42 | $this->followUpQuestions[] = $question; 43 | } 44 | 45 | /** 46 | * @return bool True, if at least one follow-up question exists. 47 | */ 48 | public function hasFollowUpQuestions() 49 | { 50 | return count($this->followUpQuestions) > 0; 51 | } 52 | 53 | /** 54 | * @return AdvisorQuestion[] 55 | */ 56 | public function getFollowUpQuestions() 57 | { 58 | return $this->followUpQuestions; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/AdvisorQuestion.php: -------------------------------------------------------------------------------- 1 | text = (string)$text; 25 | 26 | $this->answers = $answers; 27 | } 28 | 29 | /** 30 | * @return string 31 | */ 32 | public function getText() 33 | { 34 | return $this->text; 35 | } 36 | 37 | /** 38 | * @param AdvisorAnswer[] $answers 39 | */ 40 | public function addAnswers(array $answers) 41 | { 42 | foreach ($answers as $question) 43 | $this->answers[] = $question; 44 | } 45 | 46 | /** 47 | * @return bool True, if at least one answer exists. 48 | */ 49 | public function hasAnswers() 50 | { 51 | return count($this->answers) > 0; 52 | } 53 | 54 | /** 55 | * @return AdvisorAnswer[] 56 | */ 57 | public function getAnswers() 58 | { 59 | return $this->answers; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/AfterSearchNavigation.php: -------------------------------------------------------------------------------- 1 | hasPreviewImages()) 25 | return true; 26 | 27 | return false; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/ArticleNumberSearchStatus.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$isArticleNumberResultFound = new ArticleNumberSearchStatus(); 27 | self::$isNoArticleNumberResultFound = new ArticleNumberSearchStatus(); 28 | self::$isNoArticleNumberSearch = new ArticleNumberSearchStatus(); 29 | 30 | self::$initialized = true; 31 | } 32 | } 33 | 34 | static public function IsArticleNumberResultFound() { return self::$isArticleNumberResultFound; } 35 | static public function IsNoArticleNumberResultFound() { return self::$isNoArticleNumberResultFound; } 36 | static public function IsNoArticleNumberSearch() { return self::$isNoArticleNumberSearch; } 37 | } 38 | 39 | ArticleNumberSearchStatus::initialize(); 40 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/BreadCrumb.php: -------------------------------------------------------------------------------- 1 | type = $type ?: BreadCrumbType::Search(); 36 | $this->fieldName = (string)$fieldName; 37 | } 38 | 39 | /** 40 | * @return bool 41 | */ 42 | public function isSearchBreadCrumb() 43 | { 44 | $breadCrumbTypeEnum = FF::getClassName('Data\BreadCrumbType'); 45 | return $this->type == $breadCrumbTypeEnum::Search(); 46 | } 47 | 48 | /** 49 | * @return bool 50 | */ 51 | public function isFilterBreadCrumb() 52 | { 53 | $breadCrumbTypeEnum = FF::getClassName('Data\BreadCrumbType'); 54 | return $this->type == $breadCrumbTypeEnum::Filter(); 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getFieldName() 61 | { 62 | return $this->fieldName; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/BreadCrumbTrail.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$search = new BreadCrumbType(); 27 | self::$filter = new BreadCrumbType(); 28 | self::$advisor = new BreadCrumbType(); 29 | 30 | self::$initialized = true; 31 | } 32 | } 33 | 34 | static public function Search() { return self::$search; } 35 | static public function Filter() { return self::$filter; } 36 | static public function Advisor() { return self::$advisor; } 37 | } 38 | 39 | BreadCrumbType::initialize(); 40 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Filter.php: -------------------------------------------------------------------------------- 1 | fieldName = (string)$fieldName; 26 | $this->matchCount = (int)$matchCount; 27 | $this->clusterLevel = (int)$clusterLevel; 28 | $this->previewImage = (string)$previewImage; 29 | } 30 | 31 | /** 32 | * @return string 33 | */ 34 | public function getFieldName() 35 | { 36 | return $this->fieldName; 37 | } 38 | 39 | /** 40 | * @return int 41 | */ 42 | public function getMatchCount() 43 | { 44 | return $this->matchCount; 45 | } 46 | 47 | /** 48 | * @return int 49 | */ 50 | public function getClusterLevel() 51 | { 52 | return $this->clusterLevel; 53 | } 54 | 55 | /** 56 | * @return bool 57 | */ 58 | public function hasPreviewImage() 59 | { 60 | return !empty($this->previewImage); 61 | } 62 | 63 | /** 64 | * @return string 65 | */ 66 | public function getPreviewImage() 67 | { 68 | return $this->previewImage; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/FilterSelectionType.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 21 | } 22 | 23 | static private $initialized = false; 24 | static public function initialize() 25 | { 26 | if (!self::$initialized) 27 | { 28 | self::$singleHideUnselected = new FilterSelectionType(); 29 | self::$singleShowUnselected = new FilterSelectionType(); 30 | self::$multiSelectOr = new FilterSelectionType(); 31 | self::$multiSelectAnd = new FilterSelectionType(); 32 | 33 | self::$initialized = true; 34 | } 35 | } 36 | 37 | static public function SingleHideUnselected() { return self::$singleHideUnselected; } 38 | static public function SingleShowUnselected() { return self::$singleShowUnselected; } 39 | static public function MultiSelectOr() { return self::$multiSelectOr; } 40 | static public function MultiSelectAnd() { return self::$multiSelectAnd; } 41 | } 42 | 43 | FilterSelectionType::initialize(); 44 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/FilterStyle.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 27 | } 28 | 29 | // Another workaround! We need to initialize those private properties with 30 | // instances of the class, but PHP does not allow calling functions 31 | // (including constructors) when declaring properties. Hence, we need a 32 | // static class constructor to do that. But PHP does not have those either, 33 | // so we write our own and call it at the end of the file. At the same time, 34 | // we use a private flag to ensure that after this file has been loaded, 35 | // calling the initializer again will have no effect. 36 | // By the way, alternatively we could generate these instances lazily in all 37 | // the getters at the bottom. 38 | static private $initialized = false; 39 | static public function initialize() 40 | { 41 | if (!self::$initialized) 42 | { 43 | self::$regular = new FilterStyle(); 44 | self::$slider = new FilterStyle(); 45 | self::$tree = new FilterStyle(); 46 | self::$multiSelect = new FilterStyle(); 47 | 48 | self::$initialized = true; 49 | } 50 | } 51 | 52 | // Let's provide read-access to those instances. 53 | static public function Regular() { return self::$regular; } 54 | static public function Slider() { return self::$slider; } 55 | static public function Tree() { return self::$tree; } 56 | static public function MultiSelect() { return self::$multiSelect; } 57 | } 58 | 59 | // And finally we call the class initializer. 60 | FilterStyle::initialize(); 61 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/FilterType.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$text = new FilterType(); 27 | self::$number = new FilterType(); 28 | 29 | self::$initialized = true; 30 | } 31 | } 32 | 33 | static public function Text() { return self::$text; } 34 | static public function Number() { return self::$number; } 35 | } 36 | 37 | FilterType::initialize(); 38 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Item.php: -------------------------------------------------------------------------------- 1 | label = (string)$label; 39 | $this->url = (string)$url; 40 | $this->selected = (bool)$isSelected; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function getLabel() 47 | { 48 | return $this->label; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function getUrl() 55 | { 56 | return $this->url; 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function setUrl($url) 63 | { 64 | $this->url = $url; 65 | } 66 | 67 | /** 68 | * @return bool 69 | */ 70 | public function isSelected() 71 | { 72 | return $this->selected; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Page.php: -------------------------------------------------------------------------------- 1 | pageNumber = (int)$pageNumber; 26 | } 27 | 28 | /** 29 | * @return int 30 | */ 31 | public function getPageNumber() 32 | { 33 | return $this->pageNumber; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Paging.php: -------------------------------------------------------------------------------- 1 | pageCount = (int)$pageCount; 57 | $this->firstPage = $firstPage; 58 | $this->lastPage = $lastPage; 59 | $this->previousPage = $previousPage; 60 | $this->currentPage = $currentPage; 61 | $this->nextPage = $nextPage; 62 | } 63 | 64 | /** 65 | * @var int 66 | */ 67 | public function getPageCount() 68 | { 69 | return $this->pageCount; 70 | } 71 | 72 | /** 73 | * @return Page can be null 74 | */ 75 | public function getFirstPage() 76 | { 77 | return $this->firstPage; 78 | } 79 | 80 | /** 81 | * @return Page can be null 82 | */ 83 | public function getLastPage() 84 | { 85 | return $this->lastPage; 86 | } 87 | 88 | /** 89 | * @return Page can be null 90 | */ 91 | public function getPreviousPage() 92 | { 93 | return $this->previousPage; 94 | } 95 | 96 | /** 97 | * @return Page can be null 98 | */ 99 | public function getCurrentPage() 100 | { 101 | return $this->currentPage; 102 | } 103 | 104 | /** 105 | * @return Page can be null 106 | */ 107 | public function getNextPage() 108 | { 109 | return $this->nextPage; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Record.php: -------------------------------------------------------------------------------- 1 | id = trim($id); 59 | $this->fields = $fields; 60 | // Clamp similarity to interval [0,100] 61 | $this->similarity = max(0, min(100, (float)$similarity)); 62 | $this->position = (int)$position; 63 | $this->seoPath = (string)$seoPath; 64 | $this->keywords = $keywords; 65 | } 66 | 67 | /** 68 | * @return string 69 | */ 70 | public function getID() 71 | { 72 | return $this->id; 73 | } 74 | 75 | /** 76 | * @return float 77 | */ 78 | public function getSimilarity() 79 | { 80 | return $this->similarity; 81 | } 82 | 83 | /** 84 | * @return int 85 | */ 86 | public function getPosition() 87 | { 88 | return $this->position; 89 | } 90 | 91 | /** 92 | * @return string 93 | */ 94 | public function getSeoPath() 95 | { 96 | return $this->seoPath; 97 | } 98 | 99 | /** 100 | * @param string $name The name of the field to be retrieved. 101 | * @return string 102 | */ 103 | public function getField($name) 104 | { 105 | return isset($this->fields[$name]) ? $this->fields[$name] : null; 106 | } 107 | 108 | /** 109 | * @return string[] 110 | */ 111 | public function getKeywords() 112 | { 113 | return $this->keywords; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Result.php: -------------------------------------------------------------------------------- 1 | foundRecordsCount = (int)$foundRecordsCount; 29 | } 30 | 31 | /** 32 | * @return int 33 | */ 34 | public function getFoundRecordsCount() 35 | { 36 | return $this->foundRecordsCount; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/ResultsPerPageOptions.php: -------------------------------------------------------------------------------- 1 | defaultOption = $defaultOption; 25 | else if (count($options)) 26 | $this->defaultOption = $options[0]; 27 | 28 | if (!is_null($selectedOption)) 29 | $this->selectedOption = $selectedOption; 30 | else if (!is_null($this->defaultOption)) 31 | $this->selectedOption = $this->defaultOption; 32 | } 33 | 34 | /** 35 | * @return Item 36 | */ 37 | public function getDefaultOption() 38 | { 39 | return $this->defaultOption; 40 | } 41 | 42 | /** 43 | * @return Item 44 | */ 45 | public function getSelectedOption() 46 | { 47 | return $this->selectedOption; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/SearchStatus.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 20 | } 21 | 22 | static private $initialized = false; 23 | static public function initialize() 24 | { 25 | if (!self::$initialized) 26 | { 27 | self::$noQuery = new SearchStatus(); 28 | self::$noResult = new SearchStatus(); 29 | self::$emptyResult = new SearchStatus(); 30 | self::$recordsFound = new SearchStatus(); 31 | 32 | self::$initialized = true; 33 | } 34 | } 35 | 36 | static public function NoQuery() { return self::$noQuery; } 37 | static public function NoResult() { return self::$noResult; } 38 | static public function EmptyResult() { return self::$emptyResult; } 39 | static public function RecordsFound() { return self::$recordsFound; } 40 | } 41 | 42 | SearchStatus::initialize(); 43 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/SingleWordSearchItem.php: -------------------------------------------------------------------------------- 1 | previewRecords[] = $record; 18 | } 19 | 20 | /** 21 | * @param Record[] 22 | */ 23 | public function addPreviewRecords( 24 | array $records 25 | ) { 26 | foreach ($records as $record) 27 | $this->addPreviewRecord($record); 28 | } 29 | 30 | /** 31 | * @return Record[] 32 | */ 33 | public function getPreviewRecords() 34 | { 35 | return $this->previewRecords; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/Sorting.php: -------------------------------------------------------------------------------- 1 | id = self::$nextID++; 19 | } 20 | 21 | static private $initialized = false; 22 | static public function initialize() 23 | { 24 | if (!self::$initialized) 25 | { 26 | self::$asc = new SortingDirection(); 27 | self::$desc = new SortingDirection(); 28 | 29 | self::$initialized = true; 30 | } 31 | } 32 | 33 | static public function Ascending() { return self::$asc; } 34 | static public function Descending() { return self::$desc; } 35 | } 36 | 37 | SortingDirection::initialize(); 38 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/SortingItem.php: -------------------------------------------------------------------------------- 1 | name = (string)$name; 37 | $this->order = $order; 38 | } 39 | 40 | /** 41 | * @return string 42 | */ 43 | public function getName() 44 | { 45 | return $this->name; 46 | } 47 | 48 | /** 49 | * @return bool 50 | */ 51 | public function isAscending() 52 | { 53 | $orderEnum = FF::getClassName('Data\SortingDirection'); 54 | return $this->order == $orderEnum::Ascending(); 55 | } 56 | 57 | /** 58 | * @return bool 59 | */ 60 | public function isDescending() 61 | { 62 | $orderEnum = FF::getClassName('Data\SortingDirection'); 63 | return $this->order == $orderEnum::Descending(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/SortingItems.php: -------------------------------------------------------------------------------- 1 | hitCount = (int)$hitCount; 35 | $this->type = (string)$type; 36 | $this->imageUrl = (string)$imageUrl; 37 | $this->attributes = $attributes; 38 | } 39 | 40 | /** 41 | * @return int Indicates how many products this suggestions will lead to. 42 | */ 43 | public function getHitCount() { 44 | return $this->hitCount; 45 | } 46 | 47 | /** 48 | * @return string Indicates where this suggest query comes from (e.g. 49 | * product name, category, log file). 50 | */ 51 | public function getType() { 52 | return $this->type; 53 | } 54 | 55 | /** 56 | * @return string 57 | */ 58 | public function getImageUrl() { 59 | return $this->imageUrl; 60 | } 61 | 62 | /** 63 | * @return array Returns the additional return data fields 64 | */ 65 | public function getAttributes() { 66 | return $this->attributes; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/FACTFinder/Data/TagQuery.php: -------------------------------------------------------------------------------- 1 | weight = (float)$weight; 29 | $this->searchCount = (int)$searchCount; 30 | } 31 | 32 | /** 33 | * @return float 34 | */ 35 | public function getWeight() { 36 | return $this->weight; 37 | } 38 | 39 | /** 40 | * @return int 41 | */ 42 | public function getSearchCount() { 43 | return $this->searchCount; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/FACTFinder/Util/Curl.php: -------------------------------------------------------------------------------- 1 | log = \Logger::getLogger($name); 42 | } 43 | 44 | public function trace($message) 45 | { 46 | $this->log->trace($message); 47 | } 48 | 49 | public function debug($message) 50 | { 51 | $this->log->debug($message); 52 | } 53 | 54 | public function info($message) 55 | { 56 | $this->log->info($message); 57 | } 58 | 59 | public function warn($message) 60 | { 61 | $this->log->warn($message); 62 | } 63 | 64 | public function error($message) 65 | { 66 | $this->log->error($message); 67 | } 68 | 69 | public function fatal($message) 70 | { 71 | $this->log->fatal($message); 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/FACTFinder/Util/LoggerInterface.php: -------------------------------------------------------------------------------- 1 | getRenderedMessage(); 44 | } 45 | 46 | /** 47 | * Returns the content type output by this layout. 48 | * @return string 49 | */ 50 | public function getContentType() { 51 | return "text/plain"; 52 | } 53 | 54 | /** 55 | * Returns the footer for the layout format. 56 | * @return string 57 | */ 58 | public function getFooter() { 59 | return null; 60 | } 61 | 62 | /** 63 | * Returns the header for the layout format. 64 | * @return string 65 | */ 66 | public function getHeader() { 67 | return null; 68 | } 69 | 70 | /** Triggers a warning for this layout with the given message. */ 71 | protected function warn($message) { 72 | trigger_error("log4php: [" . get_class($this) . "]: $message", E_USER_WARNING); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/log4php/LoggerMDC.php: -------------------------------------------------------------------------------- 1 | setLevel($level); 41 | } 42 | 43 | /** 44 | * @return LoggerLevel the level 45 | */ 46 | public function getEffectiveLevel() { 47 | return $this->getLevel(); 48 | } 49 | 50 | /** 51 | * Override level setter to prevent setting the root logger's level to 52 | * null. Root logger must always have a level. 53 | * 54 | * @param LoggerLevel $level 55 | */ 56 | public function setLevel(LoggerLevel $level = null) { 57 | if (isset($level)) { 58 | parent::setLevel($level); 59 | } else { 60 | trigger_error("log4php: Cannot set LoggerRoot level to null.", E_USER_WARNING); 61 | } 62 | } 63 | 64 | /** 65 | * Override parent setter. Root logger cannot have a parent. 66 | * @param Logger $parent 67 | */ 68 | public function setParent(Logger $parent) { 69 | trigger_error("log4php: LoggerRoot cannot have a parent.", E_USER_WARNING); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/log4php/LoggerThrowableInformation.php: -------------------------------------------------------------------------------- 1 | throwable = $throwable; 43 | } 44 | 45 | /** 46 | * Return source exception 47 | * 48 | * @return Exception 49 | */ 50 | public function getThrowable() { 51 | return $this->throwable; 52 | } 53 | 54 | /** 55 | * @desc Returns string representation of throwable 56 | * 57 | * @return array 58 | */ 59 | public function getStringRepresentation() { 60 | if (!is_array($this->throwableArray)) { 61 | $renderer = new LoggerRendererException(); 62 | 63 | $this->throwableArray = explode("\n", $renderer->render($this->throwable)); 64 | } 65 | 66 | return $this->throwableArray; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/log4php/appenders/LoggerAppenderEcho.php: -------------------------------------------------------------------------------- 1 | element will be inserted 27 | * before each line break in the logged message. Default is false. 28 | * 29 | * @version $Revision: 1337820 $ 30 | * @package log4php 31 | * @subpackage appenders 32 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 33 | * @link http://logging.apache.org/log4php/docs/appenders/echo.html Appender documentation 34 | */ 35 | class LoggerAppenderEcho extends LoggerAppender { 36 | /** 37 | * Used to mark first append. Set to false after first append. 38 | * @var boolean 39 | */ 40 | protected $firstAppend = true; 41 | 42 | /** 43 | * If set to true, a
element will be inserted before each line 44 | * break in the logged message. Default value is false. @var boolean 45 | */ 46 | protected $htmlLineBreaks = false; 47 | 48 | public function close() { 49 | if($this->closed != true) { 50 | if(!$this->firstAppend) { 51 | echo $this->layout->getFooter(); 52 | } 53 | } 54 | $this->closed = true; 55 | } 56 | 57 | public function append(LoggerLoggingEvent $event) { 58 | if($this->layout !== null) { 59 | if($this->firstAppend) { 60 | echo $this->layout->getHeader(); 61 | $this->firstAppend = false; 62 | } 63 | $text = $this->layout->format($event); 64 | 65 | if ($this->htmlLineBreaks) { 66 | $text = nl2br($text); 67 | } 68 | echo $text; 69 | } 70 | } 71 | 72 | /** 73 | * Sets the 'htmlLineBreaks' parameter. 74 | * @param boolean $value 75 | */ 76 | public function setHtmlLineBreaks($value) { 77 | $this->setBoolean('htmlLineBreaks', $value); 78 | } 79 | 80 | /** 81 | * Returns the 'htmlLineBreaks' parameter. 82 | * @returns boolean 83 | */ 84 | public function getHtmlLineBreaks() { 85 | return $this->htmlLineBreaks; 86 | } 87 | } 88 | 89 | -------------------------------------------------------------------------------- /src/log4php/appenders/LoggerAppenderNull.php: -------------------------------------------------------------------------------- 1 | level < WARN mapped to E_USER_NOTICE 28 | * - WARN <= level < ERROR mapped to E_USER_WARNING 29 | * - level >= ERROR mapped to E_USER_ERROR 30 | * 31 | * @version $Revision: 1337820 $ 32 | * @package log4php 33 | * @subpackage appenders 34 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 35 | * @link http://logging.apache.org/log4php/docs/appenders/php.html Appender documentation 36 | */ 37 | class LoggerAppenderPhp extends LoggerAppender { 38 | 39 | public function append(LoggerLoggingEvent $event) { 40 | $level = $event->getLevel(); 41 | if($level->isGreaterOrEqual(LoggerLevel::getLevelError())) { 42 | trigger_error($this->layout->format($event), E_USER_ERROR); 43 | } else if ($level->isGreaterOrEqual(LoggerLevel::getLevelWarn())) { 44 | trigger_error($this->layout->format($event), E_USER_WARNING); 45 | } else { 46 | trigger_error($this->layout->format($event), E_USER_NOTICE); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/log4php/configurators/LoggerConfigurationAdapter.php: -------------------------------------------------------------------------------- 1 | 28 | * array( 31 | * 'level' => 'info', 32 | * 'appenders' => array('default') 33 | * ), 34 | * 'appenders' => array( 35 | * 'default' => array( 36 | * 'class' => 'LoggerAppenderEcho', 37 | * 'layout' => array( 38 | * 'class' => 'LoggerLayoutSimple' 39 | * ) 40 | * ) 41 | * ) 42 | * ) 43 | * ?> 44 | * 45 | * 46 | * @package log4php 47 | * @subpackage configurators 48 | * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 49 | * @version $Revision: 1343601 $ 50 | * @since 2.2 51 | */ 52 | class LoggerConfigurationAdapterPHP implements LoggerConfigurationAdapter 53 | { 54 | public function convert($url) { 55 | if (!file_exists($url)) { 56 | throw new LoggerException("File [$url] does not exist."); 57 | } 58 | 59 | // Load the config file 60 | $data = @file_get_contents($url); 61 | if ($data === false) { 62 | $error = error_get_last(); 63 | throw new LoggerException("Error loading config file: {$error['message']}"); 64 | } 65 | 66 | $config = @eval('?>' . $data); 67 | 68 | if ($config === false) { 69 | $error = error_get_last(); 70 | throw new LoggerException("Error parsing configuration: " . $error['message']); 71 | } 72 | 73 | if (empty($config)) { 74 | throw new LoggerException("Invalid configuration: empty configuration array."); 75 | } 76 | 77 | if (!is_array($config)) { 78 | throw new LoggerException("Invalid configuration: not an array."); 79 | } 80 | 81 | return $config; 82 | } 83 | } 84 | 85 | -------------------------------------------------------------------------------- /src/log4php/filters/LoggerFilterDenyAll.php: -------------------------------------------------------------------------------- 1 | 30 | * An example for this filter: 31 | * 32 | * {@example ../../examples/php/filter_denyall.php 19} 33 | * 34 | *

35 | * The corresponding XML file: 36 | * 37 | * {@example ../../examples/resources/filter_denyall.xml 18} 38 | * 39 | * @version $Revision: 883108 $ 40 | * @package log4php 41 | * @subpackage filters 42 | * @since 0.3 43 | */ 44 | class LoggerFilterDenyAll extends LoggerFilter { 45 | 46 | /** 47 | * Always returns the integer constant {@link LoggerFilter::DENY} 48 | * regardless of the {@link LoggerLoggingEvent} parameter. 49 | * 50 | * @param LoggerLoggingEvent $event The {@link LoggerLoggingEvent} to filter. 51 | * @return LoggerFilter::DENY Always returns {@link LoggerFilter::DENY} 52 | */ 53 | public function decide(LoggerLoggingEvent $event) { 54 | return LoggerFilter::DENY; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/log4php/filters/LoggerFilterStringMatch.php: -------------------------------------------------------------------------------- 1 | The filter admits two options {@link $stringToMatch} and 25 | * {@link $acceptOnMatch}. If there is a match (using {@link PHP_MANUAL#strpos} 26 | * between the value of the {@link $stringToMatch} option and the message 27 | * of the {@link LoggerLoggingEvent}, 28 | * then the {@link decide()} method returns {@link LoggerFilter::ACCEPT} if 29 | * the AcceptOnMatch option value is true, if it is false then 30 | * {@link LoggerFilter::DENY} is returned. If there is no match, {@link LoggerFilter::NEUTRAL} 31 | * is returned.

32 | * 33 | *

34 | * An example for this filter: 35 | * 36 | * {@example ../../examples/php/filter_stringmatch.php 19} 37 | * 38 | *

39 | * The corresponding XML file: 40 | * 41 | * {@example ../../examples/resources/filter_stringmatch.xml 18} 42 | * 43 | * @version $Revision: 1213283 $ 44 | * @package log4php 45 | * @subpackage filters 46 | * @since 0.3 47 | */ 48 | class LoggerFilterStringMatch extends LoggerFilter { 49 | 50 | /** 51 | * @var boolean 52 | */ 53 | protected $acceptOnMatch = true; 54 | 55 | /** 56 | * @var string 57 | */ 58 | protected $stringToMatch; 59 | 60 | /** 61 | * @param mixed $acceptOnMatch a boolean or a string ('true' or 'false') 62 | */ 63 | public function setAcceptOnMatch($acceptOnMatch) { 64 | $this->setBoolean('acceptOnMatch', $acceptOnMatch); 65 | } 66 | 67 | /** 68 | * @param string $s the string to match 69 | */ 70 | public function setStringToMatch($string) { 71 | $this->setString('stringToMatch', $string); 72 | } 73 | 74 | /** 75 | * @return integer a {@link LOGGER_FILTER_NEUTRAL} is there is no string match. 76 | */ 77 | public function decide(LoggerLoggingEvent $event) { 78 | $msg = $event->getRenderedMessage(); 79 | 80 | if($msg === null or $this->stringToMatch === null) { 81 | return LoggerFilter::NEUTRAL; 82 | } 83 | 84 | if(strpos($msg, $this->stringToMatch) !== false ) { 85 | return ($this->acceptOnMatch) ? LoggerFilter::ACCEPT : LoggerFilter::DENY; 86 | } 87 | return LoggerFilter::NEUTRAL; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /src/log4php/helpers/LoggerFormattingInfo.php: -------------------------------------------------------------------------------- 1 | setBoolean('locationInfo', $value); 41 | } 42 | 43 | /** Returns the location information flag. */ 44 | public function getLocationInfo() { 45 | return $this->locationInfo; 46 | } 47 | 48 | public function format(LoggerLoggingEvent $event) { 49 | // If required, initialize the location data 50 | if($this->locationInfo) { 51 | $event->getLocationInformation(); 52 | } 53 | return serialize($event) . PHP_EOL; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/log4php/layouts/LoggerLayoutSimple.php: -------------------------------------------------------------------------------- 1 | level, followed by " - " and then the message. 26 | * 27 | * For example the following php and properties files 28 | * 29 | * {@example ../../examples/php/layout_simple.php 19}
30 | * 31 | * {@example ../../examples/resources/layout_simple.properties 18}
32 | * 33 | * would result in: 34 | * 35 | * INFO - Hello World! 36 | * 37 | * @version $Revision: 1213283 $ 38 | * @package log4php 39 | * @subpackage layouts 40 | */ 41 | class LoggerLayoutSimple extends LoggerLayout { 42 | /** 43 | * Returns the log statement in a format consisting of the 44 | * level, followed by " - " and then the 45 | * message. For example, 46 | * INFO - "A message" 47 | * 48 | * @param LoggerLoggingEvent $event 49 | * @return string 50 | */ 51 | public function format(LoggerLoggingEvent $event) { 52 | $level = $event->getLevel(); 53 | $message = $event->getRenderedMessage(); 54 | return "$level - $message" . PHP_EOL; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterClass.php: -------------------------------------------------------------------------------- 1 | option) && is_numeric($this->option) && $this->option >= 0) { 41 | $this->length = (integer) $this->option; 42 | } 43 | } 44 | 45 | public function convert(LoggerLoggingEvent $event) { 46 | $name = $event->getLocationInformation()->getClassName(); 47 | 48 | if (!isset($this->cache[$name])) { 49 | 50 | // If length is set return shortened class name 51 | if (isset($this->length)) { 52 | $this->cache[$name] = LoggerUtils::shortenClassName($name, $this->length); 53 | } 54 | 55 | // If no length is specified return the full class name 56 | else { 57 | $this->cache[$name] = $name; 58 | } 59 | } 60 | 61 | return $this->cache[$name]; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterCookie.php: -------------------------------------------------------------------------------- 1 | getLocationInformation()->getFileName(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterLevel.php: -------------------------------------------------------------------------------- 1 | getLevel()->toString(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterLine.php: -------------------------------------------------------------------------------- 1 | getLocationInformation()->getLineNumber(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterLiteral.php: -------------------------------------------------------------------------------- 1 | literalValue = $literalValue; 35 | } 36 | 37 | public function convert(LoggerLoggingEvent $event) { 38 | return $this->literalValue; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterLocation.php: -------------------------------------------------------------------------------- 1 | getLocationInformation()->getClassName() . '.' . 35 | $event->getLocationInformation()->getMethodName() . '(' . 36 | $event->getLocationInformation()->getFileName() . ':' . 37 | $event->getLocationInformation()->getLineNumber() . ')'; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterLogger.php: -------------------------------------------------------------------------------- 1 | option) && is_numeric($this->option) && $this->option >= 0) { 43 | $this->length = (integer) $this->option; 44 | } 45 | } 46 | 47 | public function convert(LoggerLoggingEvent $event) { 48 | $name = $event->getLoggerName(); 49 | 50 | if (!isset($this->cache[$name])) { 51 | 52 | // If length is set return shortened logger name 53 | if (isset($this->length)) { 54 | $this->cache[$name] = LoggerUtils::shortenClassName($name, $this->length); 55 | } 56 | 57 | // If no length is specified return full logger name 58 | else { 59 | $this->cache[$name] = $name; 60 | } 61 | } 62 | 63 | return $this->cache[$name]; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterMDC.php: -------------------------------------------------------------------------------- 1 | option) && $this->option !== '') { 38 | $this->key = $this->option; 39 | } 40 | } 41 | 42 | public function convert(LoggerLoggingEvent $event) { 43 | if (isset($this->key)) { 44 | return $event->getMDC($this->key); 45 | } else { 46 | $buff = array(); 47 | $map = $event->getMDCMap(); 48 | foreach($map as $key => $value) { 49 | $buff []= "$key=$value"; 50 | } 51 | return implode(', ', $buff); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterMessage.php: -------------------------------------------------------------------------------- 1 | getRenderedMessage(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterMethod.php: -------------------------------------------------------------------------------- 1 | getLocationInformation()->getMethodName(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterNDC.php: -------------------------------------------------------------------------------- 1 | getNDC(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterNewLine.php: -------------------------------------------------------------------------------- 1 | getRelativeTime(); 34 | return number_format($ts, 4); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/log4php/pattern/LoggerPatternConverterRequest.php: -------------------------------------------------------------------------------- 1 | getThrowableInformation(); 33 | if (isset($info)) { 34 | $ex = $info->getThrowable(); 35 | return (string) $ex . PHP_EOL; 36 | } 37 | return ''; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/log4php/renderers/LoggerRenderer.php: -------------------------------------------------------------------------------- 1 | input to a string. 32 | * @param mixed $input The entity to render. 33 | * @return string The rendered string. 34 | */ 35 | public function render($input); 36 | } 37 | -------------------------------------------------------------------------------- /src/log4php/renderers/LoggerRendererDefault.php: -------------------------------------------------------------------------------- 1 | print_r. 25 | * 26 | * @package log4php 27 | * @subpackage renderers 28 | * @since 0.3 29 | */ 30 | class LoggerRendererDefault implements LoggerRenderer { 31 | 32 | /** @inheritdoc */ 33 | public function render($input) { 34 | return print_r($input, true); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/log4php/renderers/LoggerRendererException.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 24 | 25 | $this->adapter = FF::getInstance( 26 | 'Adapter\Compare', 27 | self::$dic['loggerClass'], 28 | self::$dic['configuration'], 29 | self::$dic['request'], 30 | self::$dic['clientUrlBuilder'] 31 | ); 32 | } 33 | 34 | public function testComparisonLoading() 35 | { 36 | $productIds = array(); 37 | $productIds[] = 123; 38 | $productIds[] = 456; 39 | $productIds[] = 789; 40 | $this->adapter->setProductIds($productIds); 41 | $comparedRecords = $this->adapter->getComparedRecords(); 42 | 43 | $this->assertEquals(3, count($comparedRecords), 'wrong number of records delivered'); 44 | $this->assertInstanceOf('FACTFinder\Data\Record', $comparedRecords[0], 'similar product is no record'); 45 | $this->assertNotEmpty($comparedRecords[0], 'first similar record is empty'); 46 | $this->assertEquals('123', $comparedRecords[0]->getId()); 47 | $this->assertEquals('..schwarz..', $comparedRecords[0]->getField('Farbe')); 48 | $this->assertEquals('KHE Root 540 schwarz', $comparedRecords[0]->getField('Name')); 49 | } 50 | 51 | public function tesComparableAttributesOnly() 52 | { 53 | $productIds = array(); 54 | $productIds[] = 123; 55 | $productIds[] = 456; 56 | $productIds[] = 789; 57 | $this->adapter->setProductIds($productIds); 58 | $this->adapter->setComparableAttributesOnly(true); 59 | $comparedRecords = $this->adapter->getComparedRecords(); 60 | 61 | $this->assertEquals(3, count($comparedRecords), 'wrong number of records delivered'); 62 | $this->assertInstanceOf('FACTFinder\Data\Record', $comparedRecords[0], 'similar product is no record'); 63 | $this->assertNotEmpty($comparedRecords[0], 'first similar record is empty'); 64 | $this->assertEquals('123', $comparedRecords[0]->getId()); 65 | $this->assertEquals('..schwarz..', $comparedRecords[0]->getField('Farbe')); 66 | } 67 | 68 | public function testAttributesLoading() 69 | { 70 | $productIds = array(); 71 | $productIds[] = 123; 72 | $productIds[] = 456; 73 | $productIds[] = 789; 74 | $this->adapter->setProductIds($productIds); 75 | $comparableAttributes = $this->adapter->getComparableAttributes(); 76 | 77 | $this->assertEquals(7, count($comparableAttributes)); 78 | $this->assertFalse($comparableAttributes['Hersteller']); 79 | $this->assertTrue($comparableAttributes['Farbe']); 80 | $this->assertTrue($comparableAttributes['Material']); 81 | $this->assertFalse($comparableAttributes['Modelljahr']); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /tests/Adapter/ImportTest.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 24 | 25 | $this->adapter = FF::getInstance( 26 | 'Adapter\Import', 27 | self::$dic['loggerClass'], 28 | self::$dic['configuration'], 29 | self::$dic['request'], 30 | self::$dic['clientUrlBuilder'] 31 | ); 32 | } 33 | 34 | public function testDataImport() 35 | { 36 | $this->adapter->triggerDataImport(); 37 | } 38 | 39 | public function testSuggestImport() 40 | { 41 | $this->adapter->triggerSuggestImport(); 42 | } 43 | 44 | public function testRecommendationImport() 45 | { 46 | $this->adapter->triggerRecommendationImport(); 47 | } 48 | 49 | public function testMultipleImports() 50 | { 51 | $oReport1 = $this->adapter->triggerDataImport(); 52 | $oReport2 = $this->adapter->triggerRecommendationImport(); 53 | $this->assertNotSame($oReport1, $oReport2); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tests/Adapter/TrackingTest.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 27 | 28 | $this->adapter = FF::getInstance( 29 | 'Adapter\Tracking', 30 | self::$dic['loggerClass'], 31 | self::$dic['configuration'], 32 | self::$dic['request'], 33 | self::$dic['clientUrlBuilder'] 34 | ); 35 | } 36 | 37 | public function testTrackingFromRequest() 38 | { 39 | $this->assertTrue($this->adapter->doTrackingFromRequest()); 40 | } 41 | 42 | public function testTrackClick() 43 | { 44 | $result = $this->adapter->trackClick( 45 | 1, 46 | 'query', 47 | 3, 48 | 4, 49 | 'mysid', 50 | 'mycid', 51 | 7, 52 | 8, 53 | 100, 54 | 'product', 55 | 9, 56 | 10, 57 | 11, 58 | 'adscampaign', 59 | true 60 | ); 61 | $this->assertTrue($result); 62 | } 63 | 64 | public function testTrackCart() 65 | { 66 | $result = $this->adapter->trackCart( 67 | 1, 68 | 2, 69 | 'product', 70 | 'query', 71 | 'mysid', 72 | 'mycid', 73 | 5, 74 | 6.00, 75 | 7, 76 | 'anycampaign' 77 | ); 78 | 79 | $this->assertTrue($result); 80 | } 81 | 82 | public function testTrackCheckout() 83 | { 84 | $result = $this->adapter->trackCheckout( 85 | 1, 86 | 2, 87 | 'product', 88 | 'query', 89 | 'mysid', 90 | 'mycid', 91 | 5, 92 | 6.00, 93 | 7, 94 | '', 95 | false 96 | ); 97 | 98 | $this->assertTrue($result); 99 | } 100 | 101 | public function testTrackRecommendationClick() 102 | { 103 | $result = $this->adapter->trackRecommendationClick( 104 | 1, 105 | 2, 106 | 3, 107 | 'mysid', 108 | 'mycid', 109 | 6 110 | ); 111 | 112 | $this->assertTrue($result); 113 | } 114 | 115 | public function testTrackLogin() 116 | { 117 | $result = $this->adapter->trackLogin( 118 | 'mysid', 119 | 'mycid', 120 | 3 121 | ); 122 | 123 | $this->assertTrue($result); 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /tests/Core/Server/EasyCurlDataProviderTest.php: -------------------------------------------------------------------------------- 1 | curlStub = FF::getInstance('Util\CurlStub'); 33 | $this->dataProvider = FF::getInstance( 34 | 'Core\Server\EasyCurlDataProvider', 35 | self::$dic['loggerClass'], 36 | self::$dic['configuration'], 37 | $this->curlStub, 38 | self::$dic['serverUrlBuilder'] 39 | ); 40 | 41 | $loggerClass = self::$dic['loggerClass']; 42 | $this->log = $loggerClass::getLogger(__CLASS__); 43 | 44 | $this->configuration = self::$dic['configuration']; 45 | } 46 | 47 | public function testLoadResponse() 48 | { 49 | $this->configuration->makeHttpAuthenticationType(); 50 | 51 | $requiredOptions = array( 52 | CURLOPT_URL => 'http://user:userpw@demoshop.fact-finder.de:80/FACT-Finder/TagCloud.ff?format=json&do=getTagCloud&verbose=true&channel=de' 53 | ); 54 | $responseContent = 'test response'; 55 | $info = array( 56 | CURLINFO_HTTP_CODE => '200' 57 | ); 58 | 59 | $this->curlStub->setResponse($responseContent, $requiredOptions); 60 | $this->curlStub->setInformation($info, $requiredOptions); 61 | 62 | $connectionData = FF::getInstance('Core\Server\ConnectionData'); 63 | $id = $this->dataProvider->register($connectionData); 64 | 65 | $parameters = $connectionData->getParameters(); 66 | 67 | $parameters['format'] = 'json'; 68 | $parameters['do'] = 'getTagCloud'; 69 | 70 | $connectionData->setAction('TagCloud.ff'); 71 | 72 | $this->dataProvider->loadResponse($id); 73 | 74 | $response = $connectionData->getResponse(); 75 | $this->assertEquals(0, $response->getConnectionErrorCode()); 76 | $this->assertEquals('CURLE_OK', $response->getConnectionError()); 77 | $this->assertEquals(200, $response->getHttpCode()); 78 | $this->assertEquals($responseContent, $response->getContent()); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /tests/Core/Server/EasyCurlRequestFactoryTest.php: -------------------------------------------------------------------------------- 1 | curlStub = self::$dic['curlStub']; 33 | $this->factory = FF::getInstance( 34 | 'Core\Server\EasyCurlRequestFactory', 35 | self::$dic['loggerClass'], 36 | self::$dic['configuration'], 37 | FF::getInstance('Util\Parameters', array('query' => 'bmx')), 38 | self::$dic['curlStub'] 39 | ); 40 | 41 | $loggerClass = self::$dic['loggerClass']; 42 | $this->log = $loggerClass::getLogger(__CLASS__); 43 | 44 | $this->configuration = self::$dic['configuration']; 45 | } 46 | 47 | public function testGetWorkingRequest() 48 | { 49 | $this->configuration->makeHttpAuthenticationType(); 50 | 51 | $requiredOptions = array( 52 | CURLOPT_URL => 'http://user:userpw@demoshop.fact-finder.de:80/FACT-Finder/TagCloud.ff?query=bmx&format=json&do=getTagCloud&verbose=true&channel=de' 53 | ); 54 | $responseContent = 'test response'; 55 | $info = array( 56 | CURLINFO_HTTP_CODE => '200' 57 | ); 58 | 59 | $this->curlStub->setResponse($responseContent, $requiredOptions); 60 | $this->curlStub->setInformation($info, $requiredOptions); 61 | 62 | $request = $this->factory->getRequest(); 63 | 64 | $parameters = $request->getParameters(); 65 | 66 | $parameters['format'] = 'json'; 67 | $parameters['do'] = 'getTagCloud'; 68 | 69 | $request->setAction('TagCloud.ff'); 70 | 71 | $response = $request->getResponse(); 72 | $this->assertEquals(0, $response->getConnectionErrorCode()); 73 | $this->assertEquals('CURLE_OK', $response->getConnectionError()); 74 | $this->assertEquals(200, $response->getHttpCode()); 75 | $this->assertEquals($responseContent, $response->getContent()); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /tests/Core/Server/FileSystemDataProviderTest.php: -------------------------------------------------------------------------------- 1 | dataProvider = FF::getInstance( 28 | 'Core\Server\FileSystemDataProvider', 29 | self::$dic['loggerClass'], 30 | self::$dic['configuration'] 31 | ); 32 | 33 | $loggerClass = self::$dic['loggerClass']; 34 | $this->log = $loggerClass::getLogger(__CLASS__); 35 | 36 | $this->configuration = self::$dic['configuration']; 37 | } 38 | 39 | public function testLoadResponse() 40 | { 41 | $this->dataProvider->setFileLocation(RESOURCES_DIR . DS . 'responses'); 42 | $this->configuration->makeHttpAuthenticationType(); 43 | 44 | $connectionData = FF::getInstance('Core\Server\ConnectionData'); 45 | $id = $this->dataProvider->register($connectionData); 46 | 47 | $parameters = $connectionData->getParameters(); 48 | 49 | $parameters['format'] = 'json'; 50 | $parameters['do'] = 'getTagCloud'; 51 | 52 | $connectionData->setAction('TagCloud.ff'); 53 | 54 | $this->dataProvider->loadResponse($id); 55 | 56 | $response = $connectionData->getResponse(); 57 | $expectedContent = file_get_contents(RESOURCES_DIR . DS 58 | . 'responses' . DS 59 | . 'TagCloud.86b6b33590e092674009abfe3d7fc170.json'); 60 | $this->assertEquals(0, $response->getConnectionErrorCode()); 61 | $this->assertEquals('', $response->getConnectionError()); 62 | $this->assertEquals(200, $response->getHttpCode()); 63 | $this->assertEquals($expectedContent, $response->getContent()); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /tests/Core/Server/FileSystemRequestFactoryTest.php: -------------------------------------------------------------------------------- 1 | factory = FF::getInstance( 28 | 'Core\Server\FileSystemRequestFactory', 29 | self::$dic['loggerClass'], 30 | self::$dic['configuration'], 31 | FF::getInstance('Util\Parameters') 32 | ); 33 | 34 | $loggerClass = self::$dic['loggerClass']; 35 | $this->log = $loggerClass::getLogger(__CLASS__); 36 | 37 | $this->configuration = self::$dic['configuration']; 38 | } 39 | 40 | public function testGetWorkingRequest() 41 | { 42 | $this->factory->setFileLocation(RESOURCES_DIR . DS . 'responses'); 43 | $this->configuration->makeHttpAuthenticationType(); 44 | 45 | $request = $this->factory->getRequest(); 46 | 47 | $parameters = $request->getParameters(); 48 | 49 | $parameters['format'] = 'json'; 50 | $parameters['do'] = 'getTagCloud'; 51 | 52 | $request->setAction('TagCloud.ff'); 53 | 54 | $response = $request->getResponse(); 55 | $expectedContent = file_get_contents(RESOURCES_DIR . DS 56 | . 'responses' . DS 57 | . 'TagCloud.86b6b33590e092674009abfe3d7fc170.json'); 58 | $this->assertEquals(0, $response->getConnectionErrorCode()); 59 | $this->assertEquals('', $response->getConnectionError()); 60 | $this->assertEquals(200, $response->getHttpCode()); 61 | $this->assertEquals($expectedContent, $response->getContent()); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /tests/Core/Server/NullResponseTest.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 19 | } 20 | 21 | public function testResponse() 22 | { 23 | $response = FF::getInstance('Core\Server\NullResponse'); 24 | 25 | $this->assertEquals('', $response->getContent()); 26 | $this->assertEquals(0, $response->getHttpCode()); 27 | $this->assertEquals(0, $response->getConnectionErrorCode()); 28 | $this->assertEquals('', $response->getConnectionError()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /tests/Core/Server/ResponseTest.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 19 | } 20 | 21 | public function testResponse() 22 | { 23 | $response = FF::getInstance( 24 | 'Core\Server\Response', 25 | 'response content', 26 | 200, 27 | CURLE_OK, 28 | 'CURLE_OK' 29 | ); 30 | 31 | $this->assertEquals('response content', $response->getContent()); 32 | $this->assertEquals(200, $response->getHttpCode()); 33 | $this->assertEquals(CURLE_OK, $response->getConnectionErrorCode()); 34 | $this->assertEquals('CURLE_OK', $response->getConnectionError()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/Core/Utf8EncodingConverterTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped( 24 | 'The built-in utf8 conversion functions are not available.' 25 | ); 26 | } 27 | 28 | parent::setUp(); 29 | 30 | $configuration = FF::getInstance( 31 | 'Core\ManualConfiguration', 32 | array( 33 | 'pageContentEncoding' => 'ISO-8859-1', 34 | 'clientUrlEncoding' => 'ISO-8859-1' 35 | ) 36 | ); 37 | 38 | $this->encodingConverter = FF::getInstance( 39 | 'Core\Utf8EncodingConverter', 40 | self::$dic['loggerClass'], 41 | $configuration 42 | ); 43 | 44 | $loggerClass = self::$dic['loggerClass']; 45 | $this->log = $loggerClass::getLogger(__CLASS__); 46 | } 47 | 48 | public function testEncodeContentForPage() 49 | { 50 | // Input is "ä" in UTF-8 51 | $utf8Content = "\xC3\xA4"; 52 | 53 | // Page content is configured to be ISO-8859-1 encoded. 54 | $expectedPageContent = "\xE4"; 55 | 56 | $this->assertEquals( 57 | $expectedPageContent, 58 | $this->encodingConverter->encodeContentForPage($utf8Content) 59 | ); 60 | } 61 | 62 | public function testDecodeClientUrlData() 63 | { 64 | // Client "URL" is "ä" in ISO-8859-1 65 | $utf16LEstring = "\xE4"; 66 | 67 | // Output is expected to be UTF-8 68 | $expectedUtf8string = "\xC3\xA4"; 69 | 70 | $this->assertEquals( 71 | $expectedUtf8string, 72 | $this->encodingConverter->decodeClientUrlData($utf16LEstring) 73 | ); 74 | } 75 | 76 | public function testEncodeClientUrlData() 77 | { 78 | // Input is "ä" in UTF-8 79 | $utf8string = "\xC3\xA4"; 80 | 81 | // Client URL is configured to be ISO-8859-1 encoded. 82 | $expectedUtf16LEstring = "\xE4"; 83 | 84 | $this->assertEquals( 85 | $expectedUtf16LEstring, 86 | $this->encodingConverter->encodeClientUrlData($utf8string) 87 | ); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /tests/Data/ArticleNumberSearchStatusTest.php: -------------------------------------------------------------------------------- 1 | statusClass = FF::getClassName('Data\ArticleNumberSearchStatus'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $statusClass = $this->statusClass; 30 | $this->assertInstanceOf($statusClass, $statusClass::IsArticleNumberResultFound()); 31 | $this->assertInstanceOf($statusClass, $statusClass::IsNoArticleNumberResultFound()); 32 | $this->assertInstanceOf($statusClass, $statusClass::IsNoArticleNumberSearch()); 33 | } 34 | 35 | public function testEquality() 36 | { 37 | $statusClass = $this->statusClass; 38 | $this->assertTrue($statusClass::IsArticleNumberResultFound() == $statusClass::IsArticleNumberResultFound()); 39 | $this->assertTrue($statusClass::IsNoArticleNumberResultFound() == $statusClass::IsNoArticleNumberResultFound()); 40 | $this->assertTrue($statusClass::IsNoArticleNumberSearch() == $statusClass::IsNoArticleNumberSearch()); 41 | $this->assertFalse($statusClass::IsArticleNumberResultFound() == $statusClass::IsNoArticleNumberResultFound()); 42 | $this->assertFalse($statusClass::IsNoArticleNumberResultFound() == $statusClass::IsNoArticleNumberSearch()); 43 | $this->assertFalse($statusClass::IsArticleNumberResultFound() == $statusClass::IsNoArticleNumberSearch()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/Data/BreadCrumbTypeTest.php: -------------------------------------------------------------------------------- 1 | typeClass = FF::getClassName('Data\BreadCrumbType'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $typeClass = $this->typeClass; 30 | $this->assertInstanceOf($typeClass, $typeClass::Search()); 31 | $this->assertInstanceOf($typeClass, $typeClass::Filter()); 32 | $this->assertInstanceOf($typeClass, $typeClass::Advisor()); 33 | } 34 | 35 | public function testEquality() 36 | { 37 | $typeClass = $this->typeClass; 38 | $this->assertTrue($typeClass::Search() == $typeClass::Search()); 39 | $this->assertTrue($typeClass::Filter() == $typeClass::Filter()); 40 | $this->assertTrue($typeClass::Advisor() == $typeClass::Advisor()); 41 | $this->assertFalse($typeClass::Search() == $typeClass::Filter()); 42 | $this->assertFalse($typeClass::Search() == $typeClass::Advisor()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/Data/FilterSelectionTypeTest.php: -------------------------------------------------------------------------------- 1 | selectionTypeClass = FF::getClassName('Data\FilterSelectionType'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $selectionTypeClass = $this->selectionTypeClass; 30 | $this->assertInstanceOf($selectionTypeClass, $selectionTypeClass::SingleHideUnselected()); 31 | $this->assertInstanceOf($selectionTypeClass, $selectionTypeClass::SingleShowUnselected()); 32 | $this->assertInstanceOf($selectionTypeClass, $selectionTypeClass::MultiSelectOr()); 33 | $this->assertInstanceOf($selectionTypeClass, $selectionTypeClass::MultiSelectAnd()); 34 | } 35 | 36 | public function testEquality() 37 | { 38 | $selectionTypeClass = $this->selectionTypeClass; 39 | $this->assertTrue($selectionTypeClass::SingleHideUnselected() == $selectionTypeClass::SingleHideUnselected()); 40 | $this->assertTrue($selectionTypeClass::SingleShowUnselected() == $selectionTypeClass::SingleShowUnselected()); 41 | $this->assertTrue($selectionTypeClass::MultiSelectOr() == $selectionTypeClass::MultiSelectOr()); 42 | $this->assertTrue($selectionTypeClass::MultiSelectAnd() == $selectionTypeClass::MultiSelectAnd()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/Data/FilterStyleTest.php: -------------------------------------------------------------------------------- 1 | styleClass = FF::getClassName('Data\FilterStyle'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $styleClass = $this->styleClass; 30 | $this->assertInstanceOf($styleClass, $styleClass::Regular()); 31 | $this->assertInstanceOf($styleClass, $styleClass::Slider()); 32 | $this->assertInstanceOf($styleClass, $styleClass::Tree()); 33 | $this->assertInstanceOf($styleClass, $styleClass::MultiSelect()); 34 | } 35 | 36 | public function testEquality() 37 | { 38 | $styleClass = $this->styleClass; 39 | $this->assertTrue($styleClass::Regular() == $styleClass::Regular()); 40 | $this->assertTrue($styleClass::Slider() == $styleClass::Slider()); 41 | $this->assertFalse($styleClass::Regular() == $styleClass::Slider()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /tests/Data/FilterTypeTest.php: -------------------------------------------------------------------------------- 1 | typeClass = FF::getClassName('Data\FilterType'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $typeClass = $this->typeClass; 30 | $this->assertInstanceOf($typeClass, $typeClass::Text()); 31 | $this->assertInstanceOf($typeClass, $typeClass::Number()); 32 | } 33 | 34 | public function testEquality() 35 | { 36 | $typeClass = $this->typeClass; 37 | $this->assertTrue($typeClass::Text() == $typeClass::Text()); 38 | $this->assertTrue($typeClass::Number() == $typeClass::Number()); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/Data/SearchParametersTest.php: -------------------------------------------------------------------------------- 1 | log = $loggerClass::getLogger(__CLASS__); 18 | } 19 | 20 | public function testConstructionFromParameters() 21 | { 22 | $parameters = FF::getInstance('Util\Parameters'); 23 | $parameters['query'] = 'bmx'; 24 | $parameters['seoPath'] = '/bmx-bike/q'; 25 | $parameters['channel'] = 'de'; 26 | $parameters['advisorStatus'] = '2-_0_0'; 27 | $parameters['productsPerPage'] = 12; 28 | $parameters['filterBrand'] = 'KHE'; 29 | $parameters['filterColor'] = 'green'; 30 | $parameters['sortPrice'] = 'asc'; 31 | $parameters['catalog'] = 'true'; 32 | $parameters['followSearch'] = '9832'; 33 | 34 | $searchParameters = FF::getInstance( 35 | 'Data\SearchParameters', 36 | $parameters 37 | ); 38 | 39 | $this->assertEquals('bmx', $searchParameters->getQuery()); 40 | $this->assertEquals('/bmx-bike/q', $searchParameters->getSeoPath()); 41 | $this->assertEquals('de', $searchParameters->getChannel()); 42 | $this->assertEquals('2-_0_0', $searchParameters->getAdvisorStatus()); 43 | $this->assertEquals(12, $searchParameters->getProductsPerPage()); 44 | $this->assertEquals(1, $searchParameters->getCurrentPage()); 45 | $this->assertEquals(9832, $searchParameters->getFollowSearch()); 46 | 47 | $this->assertEquals(array('Brand' => 'KHE', 'Color' => 'green'), 48 | $searchParameters->getFilters()); 49 | $this->assertEquals(array('Price' => 'asc'), 50 | $searchParameters->getSortings()); 51 | 52 | $this->assertTrue($searchParameters->isNavigationEnabled()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /tests/Data/SearchStatusTest.php: -------------------------------------------------------------------------------- 1 | statusClass = FF::getClassName('Data\SearchStatus'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $statusClass = $this->statusClass; 30 | $this->assertInstanceOf($statusClass, $statusClass::NoQuery()); 31 | $this->assertInstanceOf($statusClass, $statusClass::NoResult()); 32 | $this->assertInstanceOf($statusClass, $statusClass::EmptyResult()); 33 | $this->assertInstanceOf($statusClass, $statusClass::RecordsFound()); 34 | } 35 | 36 | public function testEquality() 37 | { 38 | $statusClass = $this->statusClass; 39 | $this->assertTrue($statusClass::RecordsFound() == $statusClass::RecordsFound()); 40 | $this->assertTrue($statusClass::EmptyResult() == $statusClass::EmptyResult()); 41 | $this->assertFalse($statusClass::NoQuery() == $statusClass::NoResult()); 42 | $this->assertFalse($statusClass::NoQuery() == $statusClass::EmptyResult()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/Data/SortingDirectionTest.php: -------------------------------------------------------------------------------- 1 | directionClass = FF::getClassName('Data\SortingDirection'); 23 | $loggerClass = self::$dic['loggerClass']; 24 | $this->log = $loggerClass::getLogger(__CLASS__); 25 | } 26 | 27 | public function testTypeSafety() 28 | { 29 | $directionClass = $this->directionClass; 30 | $this->assertInstanceOf($directionClass, $directionClass::Ascending()); 31 | $this->assertInstanceOf($directionClass, $directionClass::Descending()); 32 | } 33 | 34 | public function testEquality() 35 | { 36 | $directionClass = $this->directionClass; 37 | $this->assertTrue($directionClass::Ascending() == $directionClass::Ascending()); 38 | $this->assertTrue($directionClass::Descending() == $directionClass::Descending()); 39 | $this->assertFalse($directionClass::Ascending() == $directionClass::Descending()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | ./ 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | ../src/FACTFinder 27 | 28 | ../src/FACTFinder/Util/Pimple.php 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | ./ 16 | 17 | 18 | 19 | 20 | 21 | ../src/FACTFinder 22 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/resources/log4php.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/resources/responses/Import.844a5c89c89bea171adf1c3c9a1729b8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 6 | 7 | false 8 | 9 | 10 | Import of 37 fields for channel 'de'. 11 | Start time: 03-Nov-2013 17:13:43 12 | 17,760 records imported for channel 'de' in 15 seconds. 13 | A total of 17,760 records imported in 15 seconds. 14 | 1,184 records per second. 15 | Finished: 03-Nov-2013 17:13:58 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tests/resources/responses/Import.a4bc62d5d9902c5541c5185afebfe648.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0 5 | 6 | 7 | false 8 | 9 | 10 | Import of 37 fields for channel 'de'. 11 | Start time: 03-Nov-2013 17:16:06 12 | 489 records from 'Brand name' (channel 'de') 13 | 1,174 records from 'Category' (channel 'de') 14 | 1 records from 'Hilfe' (channel 'de') 15 | 17,641 records from 'Product name' (channel 'de') 16 | 19,305 records imported for channel 'de' in 6 seconds. 17 | A total of 19,305 records imported in 6 seconds. 18 | 3,217.5 records per second. 19 | Finished: 03-Nov-2013 17:16:13 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/resources/responses/ProductCampaign.38137e7aaeeb7adc088f04950c6b8c12.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "activeQuestions": [], 4 | "advisorTree": [], 5 | "category": "", 6 | "feedbackTexts": [], 7 | "flavour": "REDIRECT", 8 | "id": "20", 9 | "name": "Product Detail Test", 10 | "pushedProductsRecords": [], 11 | "refKey": "DscqZRYRZ", 12 | "target": { 13 | "destination": "http://www.fact-finder.de", 14 | "name": "" 15 | } 16 | }, 17 | { 18 | "activeQuestions": [], 19 | "advisorTree": [], 20 | "category": "", 21 | "feedbackTexts": [ 22 | { 23 | "html": true, 24 | "id": 9, 25 | "label": "html header", 26 | "text": "test feedback" 27 | } 28 | ], 29 | "flavour": "FEEDBACK", 30 | "id": "21", 31 | "name": "Product Detail Test", 32 | "pushedProductsRecords": [ 33 | { 34 | "foundWords": [], 35 | "id": "221910", 36 | "keywords": null, 37 | "position": 0, 38 | "record": {}, 39 | "refKey": "5goq2P_Ob", 40 | "searchSimilarity": 0, 41 | "seoPath": "", 42 | "simiMalusAdd": 0, 43 | "simiMalusMul": 1 44 | } 45 | ], 46 | "refKey": "qSuMGu7aP", 47 | "target": { 48 | "destination": "", 49 | "name": "" 50 | } 51 | } 52 | ] -------------------------------------------------------------------------------- /tests/resources/responses/Recommender.19bf53a3da240560cc52d8d64afd7738.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "fieldNames": [], 4 | "id": "274035", 5 | "record": {} 6 | } 7 | ] -------------------------------------------------------------------------------- /tests/resources/responses/Recommender.5346e6860c6dc90638bdabcfdeba1409.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | RecommendationEngine import for channel 'de' started. 11 | 14383 purchasing items were read from the tracking logs (channel 'de) 12 | RecommendationEngine import for channel 'de' finished. 13 | Recommendation import finished at 10-Nov-2013 17:25:11 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/resources/responses/SimilarRecords.23f77c8e44aca8b6aa88d706ac218192.json: -------------------------------------------------------------------------------- 1 | { 2 | "attributes": [ 3 | { 4 | "name": "Category3", 5 | "value": "..BMX Bikes.." 6 | }, 7 | { 8 | "name": "Category2", 9 | "value": "..BMX..|..Fahrräder.." 10 | }, 11 | { 12 | "name": "Category1", 13 | "value": "..Fahrräder..|..SALE.." 14 | } 15 | ], 16 | "records": [ 17 | { 18 | "fieldNames": [], 19 | "id": "278006", 20 | "record": {}, 21 | "simiMalusMul": 1 22 | }, 23 | { 24 | "fieldNames": [], 25 | "id": "278024", 26 | "record": {}, 27 | "simiMalusMul": 1 28 | }, 29 | { 30 | "fieldNames": [], 31 | "id": "355436", 32 | "record": {}, 33 | "simiMalusMul": 1 34 | } 35 | ] 36 | } -------------------------------------------------------------------------------- /tests/resources/responses/SimilarRecords.651f51fe3a2a8afafd7c8864b664db60.json: -------------------------------------------------------------------------------- 1 | { 2 | "attributes": [ 3 | { 4 | "name": "Category3", 5 | "value": "..BMX Bikes.." 6 | }, 7 | { 8 | "name": "Category2", 9 | "value": "..BMX..|..Fahrräder.." 10 | }, 11 | { 12 | "name": "Category1", 13 | "value": "..Fahrräder..|..SALE.." 14 | } 15 | ], 16 | "records": [ 17 | { 18 | "fieldNames": [], 19 | "id": "278006", 20 | "record": {}, 21 | "simiMalusMul": 1 22 | }, 23 | { 24 | "fieldNames": [], 25 | "id": "232670", 26 | "record": {}, 27 | "simiMalusMul": 1 28 | }, 29 | { 30 | "fieldNames": [], 31 | "id": "221911", 32 | "record": {}, 33 | "simiMalusMul": 1 34 | }, 35 | { 36 | "fieldNames": [], 37 | "id": "317222", 38 | "record": {}, 39 | "simiMalusMul": 1 40 | }, 41 | { 42 | "fieldNames": [], 43 | "id": "278024", 44 | "record": {}, 45 | "simiMalusMul": 1 46 | }, 47 | { 48 | "fieldNames": [], 49 | "id": "355436", 50 | "record": {}, 51 | "simiMalusMul": 1 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /tests/resources/responses/Suggest.6a04ee7d32f09b252b21e4f2781ff14f.jsonp: -------------------------------------------------------------------------------- 1 | suggest_callbackfunc( 2 | [ 3 | { 4 | "attributes": { 5 | "sourceField": "Brand" 6 | }, 7 | "hitCount": 0, 8 | "image": "", 9 | "name": "Verde BMX", 10 | "refKey": "8blKVw-P5", 11 | "searchParams": "/FACT-Finder/Search.ff?query=Verde+BMX+*&filterBrand=Verde+BMX&channel=de&ignoreForCache=queryFromSuggest&queryFromSuggest=true&ignoreForCache=userInput&userInput=bmx", 12 | "type": "brand" 13 | }, 14 | { 15 | "attributes": { 16 | "parentCategory": "SALE/Fahrräder", 17 | "sourceField": "Category3" 18 | }, 19 | "hitCount": 0, 20 | "image": "", 21 | "name": "BMX Bikes", 22 | "refKey": "XIXaEHUSD", 23 | "searchParams": "/FACT-Finder/Search.ff?query=*&filterCategory3=BMX+Bikes&filterCategory2=Fahrr%C3%A4der&filterCategory1=SALE&channel=de&ignoreForCache=queryFromSuggest&queryFromSuggest=true&ignoreForCache=userInput&userInput=bmx", 24 | "type": "category" 25 | }, 26 | { 27 | "attributes": { 28 | "id": "347231", 29 | "deeplink": "Detail.ff?id=347231&channel=de" 30 | }, 31 | "hitCount": 0, 32 | "image": "http://images.internetstores.de/products/Eastern_Bikes_BMX_2013_cobra_red[219x140].jpg?forceSize=true&forceAspectRatio=true", 33 | "name": "Eastern NTS 500 schwarz/rot", 34 | "refKey": "hSMj0A3pp", 35 | "searchParams": "/FACT-Finder/Search.ff?query=Eastern+NTS+500+schwarz%2Frot&channel=de&ignoreForCache=queryFromSuggest&queryFromSuggest=true&ignoreForCache=userInput&userInput=bmx", 36 | "type": "productName" 37 | } 38 | ] 39 | ); 40 | -------------------------------------------------------------------------------- /tests/resources/responses/Suggest.83a57102ce8aa0ff3816a8db5742d1bf.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "attributes": { 4 | "sourceField": "Brand" 5 | }, 6 | "hitCount": 0, 7 | "image": "", 8 | "name": "Verde BMX", 9 | "refKey": "8blKVw-P5", 10 | "searchParams": "/FACT-Finder/Search.ff?query=Verde+BMX+*&filterBrand=Verde+BMX&channel=de&ignoreForCache=queryFromSuggest&queryFromSuggest=true&ignoreForCache=userInput&userInput=bmx", 11 | "type": "brand" 12 | }, 13 | { 14 | "attributes": { 15 | "parentCategory": "SALE/Fahrräder", 16 | "sourceField": "Category3" 17 | }, 18 | "hitCount": 0, 19 | "image": "", 20 | "name": "BMX Bikes", 21 | "refKey": "XIXaEHUSD", 22 | "searchParams": "/FACT-Finder/Search.ff?query=*&filterCategory3=BMX+Bikes&filterCategory2=Fahrr%C3%A4der&filterCategory1=SALE&channel=de&ignoreForCache=queryFromSuggest&queryFromSuggest=true&ignoreForCache=userInput&userInput=bmx", 23 | "type": "category" 24 | }, 25 | { 26 | "attributes": { 27 | "id": "347231", 28 | "deeplink": "Detail.ff?id=347231&channel=de" 29 | }, 30 | "hitCount": 0, 31 | "image": "http://images.internetstores.de/products/Eastern_Bikes_BMX_2013_cobra_red[219x140].jpg?forceSize=true&forceAspectRatio=true", 32 | "name": "Eastern NTS 500 schwarz/rot", 33 | "refKey": "hSMj0A3pp", 34 | "searchParams": "/FACT-Finder/Search.ff?query=Eastern+NTS+500+schwarz%2Frot&channel=de&ignoreForCache=queryFromSuggest&queryFromSuggest=true&ignoreForCache=userInput&userInput=bmx", 35 | "type": "productName" 36 | } 37 | ] -------------------------------------------------------------------------------- /tests/resources/responses/Suggest.83a57102ce8aa0ff3816a8db5742d1bf.raw: -------------------------------------------------------------------------------- 1 | Verde BMX######brand### 2 | Total BMX######brand### 3 | BMX Bikes######category### 4 | BMX Rahmen######category### 5 | BMX Rahmen######category### 6 | Serious fiftyfour 54######productName###http://images.internetstores.de/products/Serious_Fiftyfour_45[219x140].jpg?forceSize=true&forceAspectRatio=true 7 | RCP UV Sunny Pedal######productName###http://images.internetstores.de/products/Sunny_Pedal__neu_01[219x140].jpg?forceSize=true&forceAspectRatio=true 8 | RCP DDD Comp Pedal black######productName###http://images.internetstores.de/products/RCP_DDD_Comp_black_1[219x140].jpg?forceSize=true&forceAspectRatio=true 9 | KHE 25th bright white######productName###http://images.internetstores.de/products/KHEbikes_25th_1[219x140].JPG?forceSize=true&forceAspectRatio=true 10 | -------------------------------------------------------------------------------- /tests/resources/responses/TagCloud.86b6b33590e092674009abfe3d7fc170.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2F28%2Bzoll%2Bdamen%2Fq&channel=de", 4 | "query": "28+zoll+damen", 5 | "searchCount": 1266, 6 | "weight": 0.5610195336122503 7 | }, 8 | { 9 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2Fbike%2Fq&channel=de", 10 | "query": "bike", 11 | "searchCount": 471, 12 | "weight": 0.10609844619397336 13 | }, 14 | { 15 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2Fbikes%2Fq&channel=de", 16 | "query": "bikes", 17 | "searchCount": 1512, 18 | "weight": 0.6427186432479985 19 | }, 20 | { 21 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2Fbmx%2Fq&channel=de", 22 | "query": "bmx", 23 | "searchCount": 1029, 24 | "weight": 0.46565386885504384 25 | }, 26 | { 27 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2Fbmx+teile%2Fq&channel=de", 28 | "query": "bmx teile", 29 | "searchCount": 746, 30 | "weight": 0.317680154531459 31 | } 32 | ] 33 | -------------------------------------------------------------------------------- /tests/resources/responses/TagCloud.897e35880b61d7aa8b4f7efb05f80543.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2F28%2Bzoll%2Bdamen%2Fq&channel=de", 4 | "query": "28+zoll+damen", 5 | "searchCount": 1266, 6 | "weight": 0.5610195336122503 7 | }, 8 | { 9 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2Fbike%2Fq&channel=de", 10 | "query": "bike", 11 | "searchCount": 471, 12 | "weight": 0.10609844619397336 13 | }, 14 | { 15 | "params": "/FACT-Finder/TagCloud.ff?seoPath=%2Fbikes%2Fq&channel=de", 16 | "query": "bikes", 17 | "searchCount": 1512, 18 | "weight": 0.6427186432479985 19 | } 20 | ] 21 | -------------------------------------------------------------------------------- /tests/resources/responses/Tracking.4446d2c43f9ba331b67de05285465e05.raw: -------------------------------------------------------------------------------- 1 | 2 | true 3 | -------------------------------------------------------------------------------- /tests/resources/responses/Tracking.8a9e67e07ad8e3cbc23f7892a7d78a39.raw: -------------------------------------------------------------------------------- 1 | 2 | true -------------------------------------------------------------------------------- /tests/resources/responses/Tracking.a06e15af39100870e12137d1d4e741c2.raw: -------------------------------------------------------------------------------- 1 | 2 | true 3 | -------------------------------------------------------------------------------- /tests/resources/responses/Tracking.b34f64c0aa7da15837309840708db491.raw: -------------------------------------------------------------------------------- 1 | 2 | true 3 | -------------------------------------------------------------------------------- /tests/resources/responses/Tracking.e7ddc998961b8255e53556c7a6605070.raw: -------------------------------------------------------------------------------- 1 | 2 | true 3 | -------------------------------------------------------------------------------- /tests/resources/responses/Tracking.f187577ce93dd3fb117cbd07211fe412.raw: -------------------------------------------------------------------------------- 1 | 2 | true 3 | --------------------------------------------------------------------------------