From 004fcbbcc7609ca83807f2e38967ef54f469bf72 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Sat, 23 Jul 2016 21:24:54 +0200 Subject: Move to new directory structure --- .travis.yml | 2 +- README.md | 1 - appinfo/application.php | 246 ----- appinfo/preupdate.php | 17 - command/updater/afterupdate.php | 40 - command/updater/allfeeds.php | 53 - command/updater/beforeupdate.php | 41 - command/updater/updatefeed.php | 59 -- config/appconfig.php | 137 --- config/config.php | 181 ---- config/dependencyexception.php | 28 - config/schema.json | 182 ---- controller/admincontroller.php | 88 -- controller/apicontroller.php | 37 - controller/entityapiserializer.php | 68 -- controller/exportcontroller.php | 91 -- controller/feedapicontroller.php | 224 ----- controller/feedcontroller.php | 301 ------ controller/folderapicontroller.php | 139 --- controller/foldercontroller.php | 176 ---- controller/itemapicontroller.php | 245 ----- controller/itemcontroller.php | 218 ---- controller/jsonhttperror.php | 31 - controller/pagecontroller.php | 224 ----- controller/userapicontroller.php | 72 -- controller/utilityapicontroller.php | 83 -- cron/updater.php | 39 - db/entityjsonserializer.php | 28 - db/feed.php | 189 ---- db/feedmapper.php | 166 --- db/feedtype.php | 24 - db/folder.php | 73 -- db/foldermapper.php | 110 -- db/iapi.php | 18 - db/item.php | 256 ----- db/itemmapper.php | 403 -------- db/mapperfactory.php | 47 - db/mysql/itemmapper.php | 88 -- db/newsmapper.php | 93 -- db/statusflag.php | 47 - dependencyinjection/ifactory.php | 24 - explore/feeds/feeds.de.json | 65 -- explore/feeds/feeds.en.json | 166 --- explore/recommendedsitenotfoundexception.php | 20 - explore/recommendedsites.php | 42 - fetcher/feedfetcher.php | 302 ------ fetcher/fetcher.php | 69 -- fetcher/fetcherexception.php | 26 - fetcher/ifeedfetcher.php | 48 - fetcher/youtubefetcher.php | 82 -- hooks/user.php | 35 - http/textdownloadresponse.php | 49 - http/textresponse.php | 46 - lib/AppInfo/Application.php | 246 +++++ lib/Command/Updater/AfterUpdate.php | 40 + lib/Command/Updater/AllFeeds.php | 53 + lib/Command/Updater/BeforeUpdate.php | 41 + lib/Command/Updater/UpdateFeed.php | 59 ++ lib/Config/AppConfig.php | 137 +++ lib/Config/Config.php | 181 ++++ lib/Config/DependencyException.php | 28 + lib/Controller/AdminController.php | 88 ++ lib/Controller/ApiController.php | 37 + lib/Controller/EntityApiSerializer.php | 68 ++ lib/Controller/ExportController.php | 91 ++ lib/Controller/FeedApiController.php | 224 +++++ lib/Controller/FeedController.php | 301 ++++++ lib/Controller/FolderApiController.php | 139 +++ lib/Controller/FolderController.php | 176 ++++ lib/Controller/ItemApiController.php | 245 +++++ lib/Controller/ItemController.php | 218 ++++ lib/Controller/JSONHttpError.php | 31 + lib/Controller/PageController.php | 224 +++++ lib/Controller/UserApiController.php | 72 ++ lib/Controller/UtilityApiController.php | 83 ++ lib/Cron/Updater.php | 39 + lib/Db/EntityJSONSerializer.php | 28 + lib/Db/Feed.php | 189 ++++ lib/Db/FeedMapper.php | 166 +++ lib/Db/FeedType.php | 24 + lib/Db/Folder.php | 73 ++ lib/Db/FolderMapper.php | 110 ++ lib/Db/IAPI.php | 18 + lib/Db/Item.php | 256 +++++ lib/Db/ItemMapper.php | 403 ++++++++ lib/Db/MapperFactory.php | 47 + lib/Db/Mysql/ItemMapper.php | 88 ++ lib/Db/NewsMapper.php | 93 ++ lib/Db/StatusFlag.php | 47 + lib/DependencyInjection/IFactory.php | 24 + lib/Explore/RecommendedSiteNotFoundException.php | 20 + lib/Explore/RecommendedSites.php | 42 + lib/Explore/feeds/feeds.de.json | 65 ++ lib/Explore/feeds/feeds.en.json | 166 +++ lib/Fetcher/FeedFetcher.php | 302 ++++++ lib/Fetcher/Fetcher.php | 69 ++ lib/Fetcher/FetcherException.php | 26 + lib/Fetcher/IFeedFetcher.php | 48 + lib/Fetcher/YoutubeFetcher.php | 82 ++ lib/Hooks/User.php | 35 + lib/Http/TextDownloadResponse.php | 49 + lib/Http/TextResponse.php | 46 + lib/Plugin/Client/Plugin.php | 44 + lib/Service/FeedService.php | 454 +++++++++ lib/Service/FolderService.php | 178 ++++ lib/Service/ItemService.php | 259 +++++ lib/Service/Service.php | 62 ++ lib/Service/ServiceConflictException.php | 27 + lib/Service/ServiceException.php | 27 + lib/Service/ServiceNotFoundException.php | 27 + lib/Service/ServiceValidationException.php | 27 + lib/Service/StatusService.php | 57 ++ lib/Upgrade/Upgrade.php | 71 ++ lib/Utility/OPMLExporter.php | 91 ++ lib/Utility/PicoFeedClientFactory.php | 40 + lib/Utility/PicoFeedFaviconFactory.php | 38 + lib/Utility/ProxyConfigParser.php | 65 ++ lib/Utility/Time.php | 30 + lib/Utility/Updater.php | 54 + phpunit.integration.xml | 2 +- phpunit.xml | 2 +- plugin/client/plugin.php | 44 - service/feedservice.php | 454 --------- service/folderservice.php | 178 ---- service/itemservice.php | 259 ----- service/service.php | 62 -- service/serviceconflictexception.php | 27 - service/serviceexception.php | 27 - service/servicenotfoundexception.php | 27 - service/servicevalidationexception.php | 27 - service/statusservice.php | 57 -- tests/Integration/Db/FeedMapperTest.php | 54 + tests/Integration/Db/FolderMapperTest.php | 51 + tests/Integration/Db/ItemMapperTest.php | 297 ++++++ tests/Integration/Fixtures/FeedFixture.php | 50 + tests/Integration/Fixtures/Fixture.php | 25 + tests/Integration/Fixtures/FolderFixture.php | 35 + tests/Integration/Fixtures/ItemFixture.php | 49 + tests/Integration/Fixtures/data/default.php | 76 ++ tests/Integration/Fixtures/data/readitem.php | 33 + tests/Integration/IntegrationTest.php | 206 ++++ tests/Unit/Config/ConfigTest.php | 230 +++++ tests/Unit/Controller/AdminControllerTest.php | 161 +++ tests/Unit/Controller/EntityApiSerializerTest.php | 116 +++ tests/Unit/Controller/ExportControllerTest.php | 131 +++ tests/Unit/Controller/FeedApiControllerTest.php | 353 +++++++ tests/Unit/Controller/FeedControllerTest.php | 484 +++++++++ tests/Unit/Controller/FolderApiControllerTest.php | 255 +++++ tests/Unit/Controller/FolderControllerTest.php | 306 ++++++ tests/Unit/Controller/ItemApiControllerTest.php | 372 +++++++ tests/Unit/Controller/ItemControllerTest.php | 384 +++++++ tests/Unit/Controller/JSONHttpErrorTest.php | 34 + tests/Unit/Controller/PageControllerTest.php | 322 ++++++ tests/Unit/Controller/UserApiControllerTest.php | 141 +++ tests/Unit/Controller/UtilityApiControllerTest.php | 90 ++ tests/Unit/Db/FeedMapperTest.php | 306 ++++++ tests/Unit/Db/FeedTest.php | 116 +++ tests/Unit/Db/FolderMapperTest.php | 196 ++++ tests/Unit/Db/FolderTest.php | 50 + tests/Unit/Db/ItemMapperTest.php | 550 ++++++++++ tests/Unit/Db/ItemTest.php | 316 ++++++ tests/Unit/Db/MapperFactoryTest.php | 50 + tests/Unit/Db/MapperTestUtility.php | 208 ++++ tests/Unit/Db/Mysql/ItemMapperTest.php | 119 +++ tests/Unit/Fetcher/FeedFetcherTest.php | 386 +++++++ tests/Unit/Fetcher/FetcherTest.php | 137 +++ tests/Unit/Fetcher/YoutubeFetcherTest.php | 68 ++ tests/Unit/Http/TextDownloadResponseTest.php | 32 + tests/Unit/Http/TextResponseTest.php | 44 + tests/Unit/Service/FeedServiceTest.php | 1060 ++++++++++++++++++++ tests/Unit/Service/FolderServiceTest.php | 282 ++++++ tests/Unit/Service/ItemServiceTest.php | 443 ++++++++ tests/Unit/Service/ServiceTest.php | 98 ++ tests/Unit/Service/StatusFlagTest.php | 57 ++ tests/Unit/Service/StatusServiceTest.php | 89 ++ tests/Unit/Upgrade/UpgradeTest.php | 72 ++ tests/Unit/Utility/OPMLExporterTest.php | 123 +++ tests/Unit/Utility/ProxyConfigParserTest.php | 93 ++ tests/Unit/Utility/UpdaterTest.php | 62 ++ tests/integration/db/FeedMapperTest.php | 54 - tests/integration/db/FolderMapperTest.php | 51 - tests/integration/db/ItemMapperTest.php | 297 ------ tests/integration/fixtures/data/default.php | 76 -- tests/integration/fixtures/data/readitem.php | 33 - tests/integration/fixtures/feedfixture.php | 50 - tests/integration/fixtures/fixture.php | 25 - tests/integration/fixtures/folderfixture.php | 35 - tests/integration/fixtures/itemfixture.php | 49 - tests/integration/integrationtest.php | 206 ---- tests/unit/config/ConfigTest.php | 230 ----- tests/unit/controller/AdminControllerTest.php | 161 --- tests/unit/controller/EntityApiSerializerTest.php | 116 --- tests/unit/controller/ExportControllerTest.php | 131 --- tests/unit/controller/FeedApiControllerTest.php | 353 ------- tests/unit/controller/FeedControllerTest.php | 484 --------- tests/unit/controller/FolderApiControllerTest.php | 255 ----- tests/unit/controller/FolderControllerTest.php | 306 ------ tests/unit/controller/ItemApiControllerTest.php | 372 ------- tests/unit/controller/ItemControllerTest.php | 384 ------- tests/unit/controller/JSONHttpErrorTest.php | 34 - tests/unit/controller/PageControllerTest.php | 322 ------ tests/unit/controller/UserApiControllerTest.php | 141 --- tests/unit/controller/UtilityApiControllerTest.php | 90 -- tests/unit/db/FeedMapperTest.php | 306 ------ tests/unit/db/FeedTest.php | 116 --- tests/unit/db/FolderMapperTest.php | 196 ---- tests/unit/db/FolderTest.php | 50 - tests/unit/db/ItemMapperTest.php | 550 ---------- tests/unit/db/ItemTest.php | 316 ------ tests/unit/db/MapperFactoryTest.php | 50 - tests/unit/db/mappertestutility.php | 208 ---- tests/unit/db/mysql/ItemMapperTest.php | 119 --- tests/unit/fetcher/FeedFetcherTest.php | 386 ------- tests/unit/fetcher/FetcherTest.php | 137 --- tests/unit/fetcher/YoutubeFetcherTest.php | 68 -- tests/unit/http/TextDownloadResponseTest.php | 32 - tests/unit/http/TextResponseTest.php | 44 - tests/unit/service/FeedServiceTest.php | 1060 -------------------- tests/unit/service/FolderServiceTest.php | 282 ------ tests/unit/service/ItemServiceTest.php | 443 -------- tests/unit/service/ServiceTest.php | 98 -- tests/unit/service/StatusFlagTest.php | 57 -- tests/unit/service/StatusServiceTest.php | 89 -- tests/unit/upgrade/UpgradeTest.php | 72 -- tests/unit/utility/OPMLExporterTest.php | 123 --- tests/unit/utility/ProxyConfigParserTest.php | 93 -- tests/unit/utility/UpdaterTest.php | 62 -- upgrade/upgrade.php | 71 -- utility/opmlexporter.php | 91 -- utility/picofeedclientfactory.php | 40 - utility/picofeedfaviconfactory.php | 38 - utility/proxyconfigparser.php | 65 -- utility/time.php | 30 - utility/updater.php | 54 - 234 files changed, 16103 insertions(+), 16303 deletions(-) delete mode 100644 appinfo/application.php delete mode 100644 appinfo/preupdate.php delete mode 100644 command/updater/afterupdate.php delete mode 100644 command/updater/allfeeds.php delete mode 100644 command/updater/beforeupdate.php delete mode 100644 command/updater/updatefeed.php delete mode 100644 config/appconfig.php delete mode 100644 config/config.php delete mode 100644 config/dependencyexception.php delete mode 100644 config/schema.json delete mode 100644 controller/admincontroller.php delete mode 100644 controller/apicontroller.php delete mode 100644 controller/entityapiserializer.php delete mode 100644 controller/exportcontroller.php delete mode 100644 controller/feedapicontroller.php delete mode 100644 controller/feedcontroller.php delete mode 100644 controller/folderapicontroller.php delete mode 100644 controller/foldercontroller.php delete mode 100644 controller/itemapicontroller.php delete mode 100644 controller/itemcontroller.php delete mode 100644 controller/jsonhttperror.php delete mode 100644 controller/pagecontroller.php delete mode 100644 controller/userapicontroller.php delete mode 100644 controller/utilityapicontroller.php delete mode 100644 cron/updater.php delete mode 100644 db/entityjsonserializer.php delete mode 100644 db/feed.php delete mode 100644 db/feedmapper.php delete mode 100644 db/feedtype.php delete mode 100644 db/folder.php delete mode 100644 db/foldermapper.php delete mode 100644 db/iapi.php delete mode 100644 db/item.php delete mode 100644 db/itemmapper.php delete mode 100644 db/mapperfactory.php delete mode 100644 db/mysql/itemmapper.php delete mode 100644 db/newsmapper.php delete mode 100644 db/statusflag.php delete mode 100644 dependencyinjection/ifactory.php delete mode 100644 explore/feeds/feeds.de.json delete mode 100644 explore/feeds/feeds.en.json delete mode 100644 explore/recommendedsitenotfoundexception.php delete mode 100644 explore/recommendedsites.php delete mode 100644 fetcher/feedfetcher.php delete mode 100644 fetcher/fetcher.php delete mode 100644 fetcher/fetcherexception.php delete mode 100644 fetcher/ifeedfetcher.php delete mode 100644 fetcher/youtubefetcher.php delete mode 100644 hooks/user.php delete mode 100644 http/textdownloadresponse.php delete mode 100644 http/textresponse.php create mode 100644 lib/AppInfo/Application.php create mode 100644 lib/Command/Updater/AfterUpdate.php create mode 100644 lib/Command/Updater/AllFeeds.php create mode 100644 lib/Command/Updater/BeforeUpdate.php create mode 100644 lib/Command/Updater/UpdateFeed.php create mode 100644 lib/Config/AppConfig.php create mode 100644 lib/Config/Config.php create mode 100644 lib/Config/DependencyException.php create mode 100644 lib/Controller/AdminController.php create mode 100644 lib/Controller/ApiController.php create mode 100644 lib/Controller/EntityApiSerializer.php create mode 100644 lib/Controller/ExportController.php create mode 100644 lib/Controller/FeedApiController.php create mode 100644 lib/Controller/FeedController.php create mode 100644 lib/Controller/FolderApiController.php create mode 100644 lib/Controller/FolderController.php create mode 100644 lib/Controller/ItemApiController.php create mode 100644 lib/Controller/ItemController.php create mode 100644 lib/Controller/JSONHttpError.php create mode 100644 lib/Controller/PageController.php create mode 100644 lib/Controller/UserApiController.php create mode 100644 lib/Controller/UtilityApiController.php create mode 100644 lib/Cron/Updater.php create mode 100644 lib/Db/EntityJSONSerializer.php create mode 100644 lib/Db/Feed.php create mode 100644 lib/Db/FeedMapper.php create mode 100644 lib/Db/FeedType.php create mode 100644 lib/Db/Folder.php create mode 100644 lib/Db/FolderMapper.php create mode 100644 lib/Db/IAPI.php create mode 100644 lib/Db/Item.php create mode 100644 lib/Db/ItemMapper.php create mode 100644 lib/Db/MapperFactory.php create mode 100644 lib/Db/Mysql/ItemMapper.php create mode 100644 lib/Db/NewsMapper.php create mode 100644 lib/Db/StatusFlag.php create mode 100644 lib/DependencyInjection/IFactory.php create mode 100644 lib/Explore/RecommendedSiteNotFoundException.php create mode 100644 lib/Explore/RecommendedSites.php create mode 100644 lib/Explore/feeds/feeds.de.json create mode 100644 lib/Explore/feeds/feeds.en.json create mode 100644 lib/Fetcher/FeedFetcher.php create mode 100644 lib/Fetcher/Fetcher.php create mode 100644 lib/Fetcher/FetcherException.php create mode 100644 lib/Fetcher/IFeedFetcher.php create mode 100644 lib/Fetcher/YoutubeFetcher.php create mode 100644 lib/Hooks/User.php create mode 100644 lib/Http/TextDownloadResponse.php create mode 100644 lib/Http/TextResponse.php create mode 100644 lib/Plugin/Client/Plugin.php create mode 100644 lib/Service/FeedService.php create mode 100644 lib/Service/FolderService.php create mode 100644 lib/Service/ItemService.php create mode 100644 lib/Service/Service.php create mode 100644 lib/Service/ServiceConflictException.php create mode 100644 lib/Service/ServiceException.php create mode 100644 lib/Service/ServiceNotFoundException.php create mode 100644 lib/Service/ServiceValidationException.php create mode 100644 lib/Service/StatusService.php create mode 100644 lib/Upgrade/Upgrade.php create mode 100644 lib/Utility/OPMLExporter.php create mode 100644 lib/Utility/PicoFeedClientFactory.php create mode 100644 lib/Utility/PicoFeedFaviconFactory.php create mode 100644 lib/Utility/ProxyConfigParser.php create mode 100644 lib/Utility/Time.php create mode 100644 lib/Utility/Updater.php delete mode 100644 plugin/client/plugin.php delete mode 100644 service/feedservice.php delete mode 100644 service/folderservice.php delete mode 100644 service/itemservice.php delete mode 100644 service/service.php delete mode 100644 service/serviceconflictexception.php delete mode 100644 service/serviceexception.php delete mode 100644 service/servicenotfoundexception.php delete mode 100644 service/servicevalidationexception.php delete mode 100644 service/statusservice.php create mode 100644 tests/Integration/Db/FeedMapperTest.php create mode 100644 tests/Integration/Db/FolderMapperTest.php create mode 100644 tests/Integration/Db/ItemMapperTest.php create mode 100644 tests/Integration/Fixtures/FeedFixture.php create mode 100644 tests/Integration/Fixtures/Fixture.php create mode 100644 tests/Integration/Fixtures/FolderFixture.php create mode 100644 tests/Integration/Fixtures/ItemFixture.php create mode 100644 tests/Integration/Fixtures/data/default.php create mode 100644 tests/Integration/Fixtures/data/readitem.php create mode 100644 tests/Integration/IntegrationTest.php create mode 100644 tests/Unit/Config/ConfigTest.php create mode 100644 tests/Unit/Controller/AdminControllerTest.php create mode 100644 tests/Unit/Controller/EntityApiSerializerTest.php create mode 100644 tests/Unit/Controller/ExportControllerTest.php create mode 100644 tests/Unit/Controller/FeedApiControllerTest.php create mode 100644 tests/Unit/Controller/FeedControllerTest.php create mode 100644 tests/Unit/Controller/FolderApiControllerTest.php create mode 100644 tests/Unit/Controller/FolderControllerTest.php create mode 100644 tests/Unit/Controller/ItemApiControllerTest.php create mode 100644 tests/Unit/Controller/ItemControllerTest.php create mode 100644 tests/Unit/Controller/JSONHttpErrorTest.php create mode 100644 tests/Unit/Controller/PageControllerTest.php create mode 100644 tests/Unit/Controller/UserApiControllerTest.php create mode 100644 tests/Unit/Controller/UtilityApiControllerTest.php create mode 100644 tests/Unit/Db/FeedMapperTest.php create mode 100644 tests/Unit/Db/FeedTest.php create mode 100644 tests/Unit/Db/FolderMapperTest.php create mode 100644 tests/Unit/Db/FolderTest.php create mode 100644 tests/Unit/Db/ItemMapperTest.php create mode 100644 tests/Unit/Db/ItemTest.php create mode 100644 tests/Unit/Db/MapperFactoryTest.php create mode 100644 tests/Unit/Db/MapperTestUtility.php create mode 100644 tests/Unit/Db/Mysql/ItemMapperTest.php create mode 100644 tests/Unit/Fetcher/FeedFetcherTest.php create mode 100644 tests/Unit/Fetcher/FetcherTest.php create mode 100644 tests/Unit/Fetcher/YoutubeFetcherTest.php create mode 100644 tests/Unit/Http/TextDownloadResponseTest.php create mode 100644 tests/Unit/Http/TextResponseTest.php create mode 100644 tests/Unit/Service/FeedServiceTest.php create mode 100644 tests/Unit/Service/FolderServiceTest.php create mode 100644 tests/Unit/Service/ItemServiceTest.php create mode 100644 tests/Unit/Service/ServiceTest.php create mode 100644 tests/Unit/Service/StatusFlagTest.php create mode 100644 tests/Unit/Service/StatusServiceTest.php create mode 100644 tests/Unit/Upgrade/UpgradeTest.php create mode 100644 tests/Unit/Utility/OPMLExporterTest.php create mode 100644 tests/Unit/Utility/ProxyConfigParserTest.php create mode 100644 tests/Unit/Utility/UpdaterTest.php delete mode 100644 tests/integration/db/FeedMapperTest.php delete mode 100644 tests/integration/db/FolderMapperTest.php delete mode 100644 tests/integration/db/ItemMapperTest.php delete mode 100644 tests/integration/fixtures/data/default.php delete mode 100644 tests/integration/fixtures/data/readitem.php delete mode 100644 tests/integration/fixtures/feedfixture.php delete mode 100644 tests/integration/fixtures/fixture.php delete mode 100644 tests/integration/fixtures/folderfixture.php delete mode 100644 tests/integration/fixtures/itemfixture.php delete mode 100644 tests/integration/integrationtest.php delete mode 100644 tests/unit/config/ConfigTest.php delete mode 100644 tests/unit/controller/AdminControllerTest.php delete mode 100644 tests/unit/controller/EntityApiSerializerTest.php delete mode 100644 tests/unit/controller/ExportControllerTest.php delete mode 100644 tests/unit/controller/FeedApiControllerTest.php delete mode 100644 tests/unit/controller/FeedControllerTest.php delete mode 100644 tests/unit/controller/FolderApiControllerTest.php delete mode 100644 tests/unit/controller/FolderControllerTest.php delete mode 100644 tests/unit/controller/ItemApiControllerTest.php delete mode 100644 tests/unit/controller/ItemControllerTest.php delete mode 100644 tests/unit/controller/JSONHttpErrorTest.php delete mode 100644 tests/unit/controller/PageControllerTest.php delete mode 100644 tests/unit/controller/UserApiControllerTest.php delete mode 100644 tests/unit/controller/UtilityApiControllerTest.php delete mode 100644 tests/unit/db/FeedMapperTest.php delete mode 100644 tests/unit/db/FeedTest.php delete mode 100644 tests/unit/db/FolderMapperTest.php delete mode 100644 tests/unit/db/FolderTest.php delete mode 100644 tests/unit/db/ItemMapperTest.php delete mode 100644 tests/unit/db/ItemTest.php delete mode 100644 tests/unit/db/MapperFactoryTest.php delete mode 100644 tests/unit/db/mappertestutility.php delete mode 100644 tests/unit/db/mysql/ItemMapperTest.php delete mode 100644 tests/unit/fetcher/FeedFetcherTest.php delete mode 100644 tests/unit/fetcher/FetcherTest.php delete mode 100644 tests/unit/fetcher/YoutubeFetcherTest.php delete mode 100644 tests/unit/http/TextDownloadResponseTest.php delete mode 100644 tests/unit/http/TextResponseTest.php delete mode 100644 tests/unit/service/FeedServiceTest.php delete mode 100644 tests/unit/service/FolderServiceTest.php delete mode 100644 tests/unit/service/ItemServiceTest.php delete mode 100644 tests/unit/service/ServiceTest.php delete mode 100644 tests/unit/service/StatusFlagTest.php delete mode 100644 tests/unit/service/StatusServiceTest.php delete mode 100644 tests/unit/upgrade/UpgradeTest.php delete mode 100644 tests/unit/utility/OPMLExporterTest.php delete mode 100644 tests/unit/utility/ProxyConfigParserTest.php delete mode 100644 tests/unit/utility/UpdaterTest.php delete mode 100644 upgrade/upgrade.php delete mode 100644 utility/opmlexporter.php delete mode 100644 utility/picofeedclientfactory.php delete mode 100644 utility/picofeedfaviconfactory.php delete mode 100644 utility/proxyconfigparser.php delete mode 100644 utility/time.php delete mode 100644 utility/updater.php diff --git a/.travis.yml b/.travis.yml index 8604d21d7..d2a7ac3aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7 env: global: - - CORE_BRANCH=stable9 + - CORE_BRANCH=stable10 matrix: - DB=pgsql diff --git a/README.md b/README.md index 8b9b1db75..c77c26fe2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![irc](https://img.shields.io/badge/irc%20channel-%23nextcloud--news%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=nextcloud-news) [![Build Status](https://travis-ci.org/nextcloud/news.svg?branch=master)](https://travis-ci.org/nextcloud/news) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nextcloud/news/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nextcloud/news/?branch=master) The News app is an RSS/Atom feed aggregator. It offers a [RESTful API](https://github.com/nextcloud/news/tree/master/docs/externalapi) for app developers. The source code is [available on GitHub](https://github.com/nextcloud/news) diff --git a/appinfo/application.php b/appinfo/application.php deleted file mode 100644 index 4c8a3769a..000000000 --- a/appinfo/application.php +++ /dev/null @@ -1,246 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\AppInfo; - -use HTMLPurifier; -use HTMLPurifier_Config; - -use PicoFeed\Config\Config as PicoFeedConfig; -use PicoFeed\Reader\Reader as PicoFeedReader; - -use OCP\ILogger; -use OCP\INavigationManager; -use OCP\IURLGenerator; -use OCP\IConfig; -use OCP\IDBConnection; -use OCP\AppFramework\App; -use OCP\Files\IRootFolder; - -use OCA\News\Config\AppConfig; -use OCA\News\Config\Config; -use OCA\News\Service\FeedService; -use OCA\News\Db\MapperFactory; -use OCA\News\Db\ItemMapper; -use OCA\News\Fetcher\Fetcher; -use OCA\News\Fetcher\FeedFetcher; -use OCA\News\Fetcher\YoutubeFetcher; -use OCA\News\Explore\RecommendedSites; -use OCA\News\Utility\ProxyConfigParser; - - -class Application extends App { - - public function __construct(array $urlParams=[]) { - parent::__construct('news', $urlParams); - - // files - $this->registerFileContents('checksums', 'checksum.json'); - $this->registerFileContents('info', 'info.xml'); - - // parameters - $this->registerParameter('exploreDir', __DIR__ . '/../explore/feeds'); - $this->registerParameter('configFile', 'config.ini'); - - // factories - $this->registerFactory(ItemMapper::class, MapperFactory::class); - - - /** - * App config parser - */ - /** @noinspection PhpParamsInspection */ - $this->registerService(AppConfig::class, function($c) { - $config = new AppConfig( - $c->query(INavigationManager::class), - $c->query(IURLGenerator::class) - ); - - $config->loadConfig($c->query('info')); - - return $config; - }); - - /** - * Core - */ - /** @noinspection PhpParamsInspection */ - $this->registerService('LoggerParameters', function($c) { - return ['app' => $c->query('AppName')]; - }); - - /** @noinspection PhpParamsInspection */ - $this->registerService('databaseType', function($c) { - return $c->query(IConfig::class)->getSystemValue('dbtype'); - }); - - /** @noinspection PhpParamsInspection */ - $this->registerService('ConfigView', function($c) { - $fs = $c->query(IRootFolder::class); - $path = 'news/config'; - if ($fs->nodeExists($path)) { - return $fs->get($path); - } else { - return $fs->newFolder($path); - } - }); - - - /** @noinspection PhpParamsInspection */ - $this->registerService(Config::class, function($c) { - $config = new Config( - $c->query('ConfigView'), - $c->query(ILogger::class), - $c->query('LoggerParameters') - ); - $config->read($c->query('configFile'), true); - return $config; - }); - - /** @noinspection PhpParamsInspection */ - $this->registerService(HTMLPurifier::class, function($c) { - $directory = $c->query(IConfig::class) - ->getSystemValue('datadirectory') . '/news/cache/purifier'; - - if(!is_dir($directory)) { - mkdir($directory, 0770, true); - } - - $config = HTMLPurifier_Config::createDefault(); - $config->set('HTML.ForbiddenAttributes', 'class'); - $config->set('Cache.SerializerPath', $directory); - $config->set('HTML.SafeIframe', true); - $config->set('URI.SafeIframeRegexp', - '%^https://(?:www\.)?(' . - 'youtube(?:-nocookie)?.com/embed/|' . - 'player.vimeo.com/video/|' . - 'vk.com/video_ext.php)%'); //allow YouTube and Vimeo - $def = $config->getHTMLDefinition(true); - $def->addAttribute('iframe', 'allowfullscreen', 'Bool'); - return new HTMLPurifier($config); - }); - - /** - * Fetchers - */ - /** @noinspection PhpParamsInspection */ - $this->registerService(PicoFeedConfig::class, function($c) { - // FIXME: move this into a separate class for testing? - $config = $c->query(Config::class); - $proxy = $c->query(ProxyConfigParser::class); - - // use chrome's user agent string since mod_security rules - // assume that only browsers can send user agent strings. This - // can lead to blocked feed updates like joomla.org - // For more information see - // https://www.atomicorp.com/wiki/index.php/WAF_309925 - $userAgent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36' . - '(KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36'; - - $pico = new PicoFeedConfig(); - $pico->setClientUserAgent($userAgent) - ->setClientTimeout($config->getFeedFetcherTimeout()) - ->setMaxRedirections($config->getMaxRedirects()) - ->setMaxBodySize($config->getMaxSize()) - ->setParserHashAlgo('md5'); - - // proxy settings - $proxySettings = $proxy->parse(); - $host = $proxySettings['host']; - $port = $proxySettings['port']; - $user = $proxySettings['user']; - $password = $proxySettings['password']; - - if ($host) { - $pico->setProxyHostname($host); - - if ($port) { - $pico->setProxyPort($port); - } - } - - if ($user) { - $pico->setProxyUsername($user) - ->setProxyPassword($password); - } - - return $pico; - }); - - /** @noinspection PhpParamsInspection */ - $this->registerService(Fetcher::class, function($c) { - $fetcher = new Fetcher(); - - // register fetchers in order, the most generic fetcher should be - // the last one - $fetcher->registerFetcher($c->query(YoutubeFetcher::class)); - $fetcher->registerFetcher($c->query(FeedFetcher::class)); - - return $fetcher; - }); - - - } - - /** - * Registers the content of a file under a key - * @param string $key - * @param string $file path relative to this file, __DIR__ will be prepended - */ - private function registerFileContents($key, $file) { - /** @noinspection PhpParamsInspection */ - $this->registerService($key, function () use ($file) { - return file_get_contents(__DIR__ . '/' . $file); - }); - } - - /** - * Shortcut for registering a service - * @param string $key - * @param closure $factory - * @param boolean $shared - */ - private function registerService($key, $factory, $shared=true) { - $this->getContainer()->registerService($key, $factory, $shared); - } - - /** - * Shortcut for registering a parameter - * @param string $key - * @param mixed $value - */ - private function registerParameter($key, $value) { - $this->getContainer()->registerParameter($key, $value); - } - - /** - * Register a class containing the app construction logic instead of the - * inlining everything in this class to enhance testability - * @param string $key fully qualified class name - * @param string $factory fully qualified factory class name - */ - private function registerFactory($key, $factory) { - /** @noinspection PhpParamsInspection */ - $this->registerService($key, function ($c) use ($factory) { - return $c->query($factory)->build(); - }); - } - - /** - * Register the additional config parameters found in the info.xml - */ - public function registerConfig() { - $this->getContainer()->query(AppConfig::class)->registerAll(); - } - -} diff --git a/appinfo/preupdate.php b/appinfo/preupdate.php deleted file mode 100644 index f356ae0ce..000000000 --- a/appinfo/preupdate.php +++ /dev/null @@ -1,17 +0,0 @@ - - * @copyright Bernhard Posselt 2015 - */ - -namespace OCA\News\AppInfo; - -use OCA\News\Upgrade\Upgrade; - -$app = new Application(); -$app->getContainer()->query(Upgrade::class)->preUpgrade(); diff --git a/command/updater/afterupdate.php b/command/updater/afterupdate.php deleted file mode 100644 index 36e23b477..000000000 --- a/command/updater/afterupdate.php +++ /dev/null @@ -1,40 +0,0 @@ - - * @copyright Bernhard Posselt 2016 - */ - -namespace OCA\News\Command\Updater; - -use Exception; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -use \OCA\News\Utility\Updater; - -class AfterUpdate extends Command { - private $updater; - - public function __construct(Updater $updater) { - parent::__construct(); - $this->updater = $updater; - } - - protected function configure() { - $this->setName('news:updater:after-update') - ->setDescription('This is used to clean up the database. It ' . - 'removes old read articles which are not starred'); - } - - protected function execute(InputInterface $input, OutputInterface $output) { - $this->updater->afterUpdate(); - } - -} diff --git a/command/updater/allfeeds.php b/command/updater/allfeeds.php deleted file mode 100644 index 05330ac01..000000000 --- a/command/updater/allfeeds.php +++ /dev/null @@ -1,53 +0,0 @@ - - * @copyright Bernhard Posselt 2016 - */ - -namespace OCA\News\Command\Updater; - -use Exception; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -use OCA\News\Service\FeedService; - - -class AllFeeds extends Command { - private $feedService; - - public function __construct(FeedService $feedService) { - parent::__construct(); - $this->feedService = $feedService; - } - - protected function configure() { - $json = '{"feeds": [{"id": 39, "userId": "john"}, // etc ]}'; - - $this->setName('news:updater:all-feeds') - ->setDescription('Prints a JSON string which contains all feed ' . - 'ids and user ids, e.g.: ' . $json); - } - - protected function execute(InputInterface $input, OutputInterface $output) { - $feeds = $this->feedService->findAllFromAllUsers(); - $result = ['feeds' => []]; - - foreach ($feeds as $feed) { - $result['feeds'][] = [ - 'id' => $feed->getId(), - 'userId' => $feed->getUserId() - ]; - } - - print(json_encode($result)); - } - -} diff --git a/command/updater/beforeupdate.php b/command/updater/beforeupdate.php deleted file mode 100644 index 6af0a5c3a..000000000 --- a/command/updater/beforeupdate.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @copyright Bernhard Posselt 2016 - */ - -namespace OCA\News\Command\Updater; - -use Exception; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -use \OCA\News\Utility\Updater; - -class BeforeUpdate extends Command { - private $updater; - - public function __construct(Updater $updater) { - parent::__construct(); - $this->updater = $updater; - } - - protected function configure() { - $this->setName('news:updater:before-update') - ->setDescription('This is used to clean up the database. It ' . - 'deletes folders and feeds that are marked for ' . - 'deletion'); - } - - protected function execute(InputInterface $input, OutputInterface $output) { - $this->updater->beforeUpdate(); - } - -} diff --git a/command/updater/updatefeed.php b/command/updater/updatefeed.php deleted file mode 100644 index 13fc2e625..000000000 --- a/command/updater/updatefeed.php +++ /dev/null @@ -1,59 +0,0 @@ - - * @copyright Bernhard Posselt 2016 - */ - -namespace OCA\News\Command\Updater; - -use Exception; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -use OCA\News\Service\FeedService; - - -class UpdateFeed extends Command { - private $feedService; - - public function __construct(FeedService $feedService) { - parent::__construct(); - $this->feedService = $feedService; - } - - protected function configure() { - $this->setName('news:updater:update-feed') - ->addArgument( - 'feed-id', - InputArgument::REQUIRED, - 'feed id, integer' - ) - ->addArgument( - 'user-id', - InputArgument::REQUIRED, - 'user id of a user, string' - ) - ->setDescription('Console API for updating a single user\'s feed'); - } - - protected function execute(InputInterface $input, OutputInterface $output) { - $feedId = $input->getArgument('feed-id'); - $userId = $input->getArgument('user-id'); - try { - $this->feedService->update($feedId, $userId); - } catch (Exception $e) { - $output->writeln('Could not update feed with id ' . $feedId . - ' and user ' . $userId . ': ' . $e->getMessage() . - ' '); - } - } - -} diff --git a/config/appconfig.php b/config/appconfig.php deleted file mode 100644 index 55dcd6d1a..000000000 --- a/config/appconfig.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Config; - -use SimpleXMLElement; - -use OCP\INavigationManager; -use OCP\IURLGenerator; -use OCP\Util; -use OCP\App; - -// Used to parse app.json file, should be in core at some point -class AppConfig { - - private $config; - private $navigationManager; - private $urlGenerator; - - /** - * TODO: External deps that are needed: - * - add jobs - * - connect to hooks - */ - public function __construct(INavigationManager $navigationManager, - IURLGenerator $urlGenerator) { - $this->navigationManager = $navigationManager; - $this->urlGenerator = $urlGenerator; - $this->config = []; - } - - - /** - * Parse an xml config - */ - private function parseConfig($string) { - // no need to worry about XXE since local file - $xml = simplexml_load_string($string, 'SimpleXMLElement'); - return json_decode(json_encode((array)$xml), true); - } - - - /** - * @param string|array $data path to the config file or an array with the - * config - */ - public function loadConfig($data) { - if(is_array($data)) { - $this->config = $data; - } else { - $this->config = $this->parseConfig($data); - } - } - - - /** - * @param string $key if given returns the value of the config at index $key - * @return array|mixed the config - */ - public function getConfig($key=null) { - // FIXME: is this function interface a good idea? - if($key !== null) { - return $this->config[$key]; - } else { - return $this->config; - } - } - - - /** - * Registers all config options - */ - public function registerAll() { - $this->registerNavigation(); - $this->registerHooks(); - // IJob API is fucked up, so silence the code checker - $class = '\OCP\BackgroundJob'; - $class::addRegularTask($this->config['cron']['job'], 'run'); - App::registerAdmin($this->config['id'], $this->config['admin']); - } - - - /** - * Parses the navigation and creates a navigation entry if needed - */ - public function registerNavigation() { - if (array_key_exists('navigation', $this->config)) { - $this->navigationManager->add(function () { - $nav =& $this->config['navigation']; - - $navConfig = [ - 'id' => $this->config['id'], - 'order' => $nav['order'], - 'name' => $nav['name'] - ]; - - $navConfig['href'] = $this->urlGenerator->linkToRoute( - $nav['route'] - ); - $navConfig['icon'] = $this->urlGenerator->imagePath( - $this->config['id'], $nav['icon'] - ); - - return $navConfig; - }); - } - } - - - /** - * Registers all hooks in the config - */ - public function registerHooks() { - // FIXME: this is temporarily static because core emitters are not - // future proof, therefore legacy code in here - foreach ($this->config['hooks'] as $hook) { - $listener = explode('::', $hook['channel']); - $reaction = explode('::', $hook['subscriber']); - - // config is written like HookNamespace::method => Class::method - Util::connectHook($listener[0], $listener[1], $reaction[0], - $reaction[1]); - } - } - - -} diff --git a/config/config.php b/config/config.php deleted file mode 100644 index a91c5053f..000000000 --- a/config/config.php +++ /dev/null @@ -1,181 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Config; - -use OCP\ILogger; -use OCP\Files\Folder; - - -class Config { - - private $fileSystem; - private $autoPurgeMinimumInterval; // seconds, used to define how - // long deleted folders and feeds - // should still be kept for an - // undo actions - private $autoPurgeCount; // number of allowed unread articles per feed - private $maxRedirects; // seconds - private $feedFetcherTimeout; // seconds - private $useCronUpdates; // turn off updates run by owncloud cronjob - private $logger; - private $loggerParams; - private $maxSize; - private $exploreUrl; - - public function __construct(Folder $fileSystem, - ILogger $logger, - $LoggerParameters) { - $this->fileSystem = $fileSystem; - $this->autoPurgeMinimumInterval = 60; - $this->autoPurgeCount = 200; - $this->maxRedirects = 10; - $this->maxSize = 100*1024*1024; // 100Mb - $this->feedFetcherTimeout = 60; - $this->useCronUpdates = true; - $this->logger = $logger; - $this->exploreUrl = ''; - $this->loggerParams = $LoggerParameters; - } - - public function getAutoPurgeMinimumInterval() { - if ($this->autoPurgeMinimumInterval > 60) { - return $this->autoPurgeMinimumInterval; - } else { - return 60; - } - } - - public function getAutoPurgeCount() { - return $this->autoPurgeCount; - } - - - public function getMaxRedirects() { - return $this->maxRedirects; - } - - - public function getFeedFetcherTimeout() { - return $this->feedFetcherTimeout; - } - - - public function getUseCronUpdates() { - return $this->useCronUpdates; - } - - - public function getMaxSize() { - return $this->maxSize; - } - - - public function getExploreUrl() { - return $this->exploreUrl; - } - - - public function setAutoPurgeMinimumInterval($value) { - $this->autoPurgeMinimumInterval = $value; - } - - - public function setAutoPurgeCount($value) { - $this->autoPurgeCount = $value; - } - - - public function setMaxRedirects($value) { - $this->maxRedirects = $value; - } - - - public function setFeedFetcherTimeout($value) { - $this->feedFetcherTimeout = $value; - } - - - public function setUseCronUpdates($value) { - $this->useCronUpdates = $value; - } - - public function setMaxSize($value) { - $this->maxSize = $value; - } - - - public function setExploreUrl($value) { - $this->exploreUrl = $value; - } - - - public function read($configPath, $createIfNotExists=false) { - if($createIfNotExists && !$this->fileSystem->nodeExists($configPath)) { - $this->fileSystem->newFile($configPath); - $this->write($configPath); - - } else { - - $content = $this->fileSystem->get($configPath)->getContent(); - $configValues = parse_ini_string($content); - - if($configValues === false || count($configValues) === 0) { - $this->logger->warning( - 'Configuration invalid. Ignoring values.', - $this->loggerParams - ); - } else { - - foreach($configValues as $key => $value) { - if(property_exists($this, $key)) { - $type = gettype($this->$key); - settype($value, $type); - $this->$key = $value; - } else { - $this->logger->warning( - 'Configuration value "' . $key . - '" does not exist. Ignored value.' , - $this->loggerParams - ); - } - } - - } - } - } - - - public function write($configPath) { - $ini = - 'autoPurgeMinimumInterval = ' . - $this->autoPurgeMinimumInterval . "\n" . - 'autoPurgeCount = ' . - $this->autoPurgeCount . "\n" . - 'maxRedirects = ' . - $this->maxRedirects . "\n" . - 'maxSize = ' . - $this->maxSize . "\n" . - 'exploreUrl = ' . - $this->exploreUrl . "\n" . - 'feedFetcherTimeout = ' . - $this->feedFetcherTimeout . "\n" . - 'useCronUpdates = ' . - var_export($this->useCronUpdates, true); - ; - - $this->fileSystem->get($configPath)->putContent($ini); - } - - -} diff --git a/config/dependencyexception.php b/config/dependencyexception.php deleted file mode 100644 index 690d187c3..000000000 --- a/config/dependencyexception.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Config; - -class DependencyException extends \Exception { - - - /** - * Constructor - * @param string $msg the error message - */ - public function __construct($msg){ - parent::__construct($msg); - } - - -} \ No newline at end of file diff --git a/config/schema.json b/config/schema.json deleted file mode 100644 index 13dca5132..000000000 --- a/config/schema.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "title": "ownCloud App Schema", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "id": { - "type": "string", - "pattern": "^[a-z_]+$" - }, - "description": { - "type": "string" - }, - "licence": { - "type": "string", - "enum": ["AGPL", "MIT", "GPL", "LGPL", "BSD","Apache"] - }, - "admin": { - "type": "boolean" - }, - "version": { - "type": "string", - "pattern": "^[0-9]+(\\.[0-9]+)*$" - }, - "authors": { - "type": "array", - "items": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^.+@.+\\..+$" - }, - "homepage": { - "type": "string", - "pattern": "^https?://.*$" - } - }, - "required": ["name", "email"], - "additionalProperties": false - } - }, - "repository": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": ["type", "url"], - "additionalProperties": false - }, - "homepage": { - "type": "string", - "pattern": "^https?://.*$" - }, - "bugs": { - "type": "string", - "pattern": "^https?://.*$" - }, - "documentation": { - "type": "object", - "properties": { - "user": { - "type": "string", - "pattern": "^https?://.*$" - }, - "admin": { - "type": "string", - "pattern": "^https?://.*$" - }, - "developer": { - "type": "string", - "pattern": "^https?://.*$" - } - }, - "additionalProperties": false - }, - "jobs": { - "type": "array", - "items": { - "type": "string", - "pattern": "^[a-zA-Z-_:\\\\]+$" - } - }, - "hooks": { - "type": "object", - "patternProperties": { - "^[a-zA-Z-_:\\\\]+$": { - "type": "string", - "pattern": "^[a-zA-Z-_:\\\\]+$" - } - } - }, - "navigation": { - "type": "object", - "properties": { - "route": { - "type": "string", - "pattern": "^([a-z]+(\\.[a-z]+)*)*|(/.+/.*)$" - }, - "icon": { - "type": "string" - }, - "name": { - "type": "string" - }, - "order": { - "type": "integer" - } - }, - "additionalProperties": false - }, - "categories": { - "type": "array", - "items": { - "type": "string", - "enum": ["Filesystem", "Authentication", "PIM", "Multimedia", - "Productivity", "Games", "Tools", "Other"] - }, - "minItems": 1, - "uniqueItems": true - }, - "dependencies": { - "type": "object", - "properties": { - "databases": { - "type": "array", - "items": { - "type": "string", - "enum": ["pgsql", "mysql", "sqlite3", "mssql", "oracle"] - }, - "uniqueItems": true - }, - "php": { - "type": "string", - "pattern": "^((=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*(,(=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*)*|\\*)$" - }, - "apps": { - "type": "object", - "patternProperties": { - "^[a-z_]+$": { - "type": "string", - "pattern": "^((=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*(,(=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*)*|\\*)$" - } - } - }, - "libs": { - "type": "object", - "patternProperties": { - "^[a-z_]+$": { - "type": "string", - "pattern": "^((=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*(,(=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*)*|\\*)$" - } - } - }, - "owncloud": { - "type": "string", - "pattern": "^((=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*(,(=|<|>|<=|>=)?[0-9]+(\\.[0-9]+)*)*|\\*)$" - } - }, - "additionalProperties": false - } - }, - "required": [ - "name", - "id", - "description", - "licence", - "version", - "authors", - "repository" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/controller/admincontroller.php b/controller/admincontroller.php deleted file mode 100644 index a673566de..000000000 --- a/controller/admincontroller.php +++ /dev/null @@ -1,88 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Controller; - -use OCP\AppFramework\Http\TemplateResponse; -use OCP\IRequest; -use OCP\AppFramework\Controller; - -use OCA\News\Config\Config; -use OCA\News\Service\itemService; - -class AdminController extends Controller { - - private $config; - private $configPath; - private $itemService; - - public function __construct($AppName, IRequest $request, Config $config, - ItemService $itemService, $configFile){ - parent::__construct($AppName, $request); - $this->config = $config; - $this->configPath = $configFile; - $this->itemService = $itemService; - } - - // There are no checks for the index method since the output is rendered - // in admin/admin.php - public function index() { - $data = [ - 'autoPurgeMinimumInterval' => - $this->config->getAutoPurgeMinimumInterval(), - 'autoPurgeCount' => $this->config->getAutoPurgeCount(), - 'maxRedirects' => $this->config->getMaxRedirects(), - 'feedFetcherTimeout' => $this->config->getFeedFetcherTimeout(), - 'useCronUpdates' => $this->config->getUseCronUpdates(), - 'maxSize' => $this->config->getMaxSize(), - 'exploreUrl' => $this->config->getExploreUrl(), - ]; - return new TemplateResponse($this->appName, 'admin', $data, 'blank'); - } - - - /** - * @param int $autoPurgeMinimumInterval - * @param int $autoPurgeCount - * @param int $maxRedirects - * @param int $feedFetcherTimeout - * @param int $maxSize - * @param bool $useCronUpdates - * @param string $exploreUrl - * @return array with the updated values - */ - public function update($autoPurgeMinimumInterval, $autoPurgeCount, - $maxRedirects, $feedFetcherTimeout, $maxSize, - $useCronUpdates, $exploreUrl) { - $this->config->setAutoPurgeMinimumInterval($autoPurgeMinimumInterval); - $this->config->setAutoPurgeCount($autoPurgeCount); - $this->config->setMaxRedirects($maxRedirects); - $this->config->setMaxSize($maxSize); - $this->config->setFeedFetcherTimeout($feedFetcherTimeout); - $this->config->setUseCronUpdates($useCronUpdates); - $this->config->setExploreUrl($exploreUrl); - $this->config->write($this->configPath); - - return [ - 'autoPurgeMinimumInterval' => - $this->config->getAutoPurgeMinimumInterval(), - 'autoPurgeCount' => $this->config->getAutoPurgeCount(), - 'maxRedirects' => $this->config->getMaxRedirects(), - 'maxSize' => $this->config->getMaxSize(), - 'feedFetcherTimeout' => $this->config->getFeedFetcherTimeout(), - 'useCronUpdates' => $this->config->getUseCronUpdates(), - 'exploreUrl' => $this->config->getExploreUrl(), - ]; - } - -} diff --git a/controller/apicontroller.php b/controller/apicontroller.php deleted file mode 100644 index f3b77b379..000000000 --- a/controller/apicontroller.php +++ /dev/null @@ -1,37 +0,0 @@ - - * @author Bernhard Posselt - * @copyright Alessandro Cosentino 2012 - * @copyright Bernhard Posselt 2012, 2014 - */ - -namespace OCA\News\Controller; - -use OCP\IRequest; -use OCP\AppFramework\ApiController as BaseApiController; - -class ApiController extends BaseApiController { - - public function __construct($appName, - IRequest $request){ - parent::__construct($appName, $request); - } - - /** - * @PublicPage - * @NoCSRFRequired - * @CORS - */ - public function index() { - return [ - 'apiLevels' => ['v1-2'] - ]; - } - -} diff --git a/controller/entityapiserializer.php b/controller/entityapiserializer.php deleted file mode 100644 index 073ad5c39..000000000 --- a/controller/entityapiserializer.php +++ /dev/null @@ -1,68 +0,0 @@ - - * @copyright Bernhard Posselt 2014 - */ - -namespace OCA\News\Controller; - -use \OCA\News\Db\IAPI; - - -class EntityApiSerializer { - - private $level; - - public function __construct($level) { - $this->level = $level; - } - - - /** - * Call toAPI() method on all entities. Works on - * - * @param mixed $data : - * * Entity - * * Entity[] - * * array('level' => Entity[]) - * * Response - * @return array|mixed - */ - public function serialize