summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml118
-rw-r--r--appinfo/app.php6
-rw-r--r--appinfo/application.php834
-rw-r--r--appinfo/database.xml516
-rw-r--r--appinfo/info.xml10
-rw-r--r--appinfo/routes.php138
-rw-r--r--articleenhancer/articleenhancer.php2
-rw-r--r--articleenhancer/enhancer.php112
-rw-r--r--articleenhancer/globalarticleenhancer.php62
-rw-r--r--articleenhancer/regexarticleenhancer.php46
-rw-r--r--articleenhancer/regexenhancers.json68
-rw-r--r--articleenhancer/xpatharticleenhancer.php292
-rw-r--r--articleenhancer/xpathenhancers.json248
-rw-r--r--config/appconfig.php528
-rw-r--r--config/config.php290
-rw-r--r--config/schema.json326
-rw-r--r--controller/admincontroller.php90
-rw-r--r--controller/exportcontroller.php102
-rw-r--r--controller/feedapicontroller.php262
-rw-r--r--controller/feedcontroller.php350
-rw-r--r--controller/folderapicontroller.php148
-rw-r--r--controller/foldercontroller.php158
-rw-r--r--controller/itemapicontroller.php274
-rw-r--r--controller/jsonhttperror.php18
-rw-r--r--controller/pagecontroller.php126
-rw-r--r--controller/utilityapicontroller.php64
-rw-r--r--cron/updater.php26
-rw-r--r--css/7.css384
-rw-r--r--css/mobile.css8
-rw-r--r--db/entityjsonserializer.php14
-rw-r--r--db/feed.php176
-rw-r--r--db/feedmapper.php304
-rw-r--r--db/feedtype.php10
-rw-r--r--db/folder.php60
-rw-r--r--db/foldermapper.php168
-rw-r--r--db/iapi.php2
-rw-r--r--db/item.php342
-rw-r--r--db/itemmapper.php538
-rw-r--r--db/mapperfactory.php34
-rw-r--r--db/newsmapper.php2
-rw-r--r--db/postgres/itemmapper.php88
-rw-r--r--db/statusflag.php48
-rw-r--r--fetcher/feedfetcher.php386
-rw-r--r--fetcher/fetcher.php66
-rw-r--r--fetcher/fetcherexception.php14
-rw-r--r--fetcher/ifeedfetcher.php30
-rw-r--r--hooks/user.php2
-rw-r--r--http/textdownloadresponse.php44
-rw-r--r--http/textresponse.php42
-rw-r--r--js/bower.json66
-rw-r--r--js/package.json94
-rw-r--r--service/feedservice.php698
-rw-r--r--service/folderservice.php292
-rw-r--r--service/itemservice.php426
-rw-r--r--service/service.php74
-rw-r--r--service/serviceconflictexception.php14
-rw-r--r--service/serviceexception.php14
-rw-r--r--service/servicenotfoundexception.php14
-rw-r--r--service/servicevalidationexception.php14
-rw-r--r--templates/part.navigation.starredfeed.php16
-rw-r--r--templates/part.navigation.unreadfeed.php22
-rw-r--r--tests/classloader.php26
-rw-r--r--tests/unit/articleenhancer/EnhancerTest.php150
-rw-r--r--tests/unit/articleenhancer/GlobalArticleEnhancerTest.php72
-rw-r--r--tests/unit/articleenhancer/RegexArticleEnhancerTest.php22
-rw-r--r--tests/unit/articleenhancer/XPathArticleEnhancerTest.php610
-rw-r--r--tests/unit/config/AppConfigTest.php340
-rw-r--r--tests/unit/config/ConfigTest.php350
-rw-r--r--tests/unit/controller/ExportControllerTest.php200
-rw-r--r--tests/unit/controller/FeedApiControllerTest.php576
-rw-r--r--tests/unit/controller/FeedControllerTest.php778
-rw-r--r--tests/unit/controller/FolderApiControllerTest.php332
-rw-r--r--tests/unit/controller/FolderControllerTest.php422
-rw-r--r--tests/unit/controller/ItemApiControllerTest.php674
-rw-r--r--tests/unit/controller/ItemControllerTest.php620
-rw-r--r--tests/unit/controller/PageControllerTest.php234
-rw-r--r--tests/unit/controller/UtilityApiControllerTest.php84
-rw-r--r--tests/unit/db/FeedMapperTest.php614
-rw-r--r--tests/unit/db/FeedTest.php142
-rw-r--r--tests/unit/db/FolderMapperTest.php238
-rw-r--r--tests/unit/db/FolderTest.php60
-rw-r--r--tests/unit/db/ItemMapperTest.php768
-rw-r--r--tests/unit/db/ItemTest.php514
-rw-r--r--tests/unit/db/MapperFactoryTest.php38
-rw-r--r--tests/unit/db/postgres/ItemMapperTest.php146
-rw-r--r--tests/unit/fetcher/FeedFetcherTest.php874
-rw-r--r--tests/unit/fetcher/FetcherTest.php194
-rw-r--r--tests/unit/http/TextDownloadResponseTest.php12
-rw-r--r--tests/unit/http/TextResponseTest.php30
-rw-r--r--tests/unit/service/FeedServiceTest.php1386
-rw-r--r--tests/unit/service/FolderServiceTest.php444
-rw-r--r--tests/unit/service/ItemServiceTest.php696
-rw-r--r--tests/unit/service/ServiceTest.php98
-rw-r--r--tests/unit/service/StatusFlagTest.php48
-rw-r--r--tests/unit/utility/FaviconFetcherTest.php256
-rw-r--r--tests/unit/utility/OPMLExporterTest.php172
-rw-r--r--tests/unit/utility/SimplePieAPIFactoryTest.php24
-rw-r--r--tests/unit/utility/UpdaterTest.php86
-rw-r--r--utility/faviconfetcher.php230
-rw-r--r--utility/opmlexporter.php120
-rw-r--r--utility/simplepieapifactory.php36
-rw-r--r--utility/updater.php40
102 files changed, 11238 insertions, 11238 deletions
diff --git a/.travis.yml b/.travis.yml
index e63dd3f6a..26e3212ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,73 +1,73 @@
language: php
php:
- - 5.4
- - 5.5
- - 5.6
+ - 5.4
+ - 5.5
+ - 5.6
env:
- - DB=sqlite
- # enable if there are tests for it
- # - DB=postgresql
- # - DB=mysql
+ - DB=sqlite
+ # enable if there are tests for it
+ # - DB=postgresql
+ # - DB=mysql
before_install:
- # get a newer node.js version
- - "export DISPLAY=:99.0"
- - "sh -e /etc/init.d/xvfb start"
- - sudo add-apt-repository -y ppa:chris-lea/node.js # ubuntu 12.04 only
- - sudo apt-get update
- - sudo apt-get -o DPkg::Options::="--force-confold" -y upgrade
- - npm install -g npm@latest
+ # get a newer node.js version
+ - "export DISPLAY=:99.0"
+ - "sh -e /etc/init.d/xvfb start"
+ - sudo add-apt-repository -y ppa:chris-lea/node.js # ubuntu 12.04 only
+ - sudo apt-get update
+ - sudo apt-get -o DPkg::Options::="--force-confold" -y upgrade
+ - npm install -g npm@latest
install:
- - cd ..
- - sudo apt-get -y install nodejs python3-jinja2 python3-setuptools apache2 libapache2-mod-fastcgi firefox chromium-browser
- - export CHROME_BIN=/usr/bin/chromium-browser
- - sudo easy_install3 pip # ubuntu 12.04 only
- - sudo pip3 install ocdev
- # clone core
- - ocdev setup core --dir owncloud
- - mv news owncloud/apps/
+ - cd ..
+ - sudo apt-get -y install nodejs python3-jinja2 python3-setuptools apache2 libapache2-mod-fastcgi firefox chromium-browser
+ - export CHROME_BIN=/usr/bin/chromium-browser
+ - sudo easy_install3 pip # ubuntu 12.04 only
+ - sudo pip3 install ocdev
+ # clone core
+ - ocdev setup core --dir owncloud
+ - mv news owncloud/apps/
before_script:
- # set up databases and users for postgres and mysql
- - createuser -U travis -s oc_autotest
- - mysql -e 'create database oc_autotest;'
- - mysql -u root -e "CREATE USER 'oc_autotest'@'localhost';"
- - mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"
- # set up php under apache
- - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- - sudo a2enmod rewrite actions fastcgi alias
- - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- - sudo cp -f owncloud/apps/news/tests/travis/travis-ci-apache /etc/apache2/sites-available/default
- - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
- - sudo service apache2 restart
- # fill owncloud with default configs and enable news
- - cd owncloud
- - ocdev ci $DB
- - php -f console.php app:enable news
- - cd apps/news
+ # set up databases and users for postgres and mysql
+ - createuser -U travis -s oc_autotest
+ - mysql -e 'create database oc_autotest;'
+ - mysql -u root -e "CREATE USER 'oc_autotest'@'localhost';"
+ - mysql -u root -e "grant all on oc_autotest.* to 'oc_autotest'@'localhost';"
+ # set up php under apache
+ - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
+ - sudo a2enmod rewrite actions fastcgi alias
+ - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
+ - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
+ - sudo cp -f owncloud/apps/news/tests/travis/travis-ci-apache /etc/apache2/sites-available/default
+ - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
+ - sudo service apache2 restart
+ # fill owncloud with default configs and enable news
+ - cd owncloud
+ - ocdev ci $DB
+ - php -f console.php app:enable news
+ - cd apps/news
script:
- # php unit tests
- - phpunit --coverage-clover=coverage.clover tests/unit
- - wget https://scrutinizer-ci.com/ocular.phar
- - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- - cd js/
- # install javascript deps (putting it into install section fails often)
- - npm install --deps # npm install needs to run before sudo npm install because otherwise it fails because a tmp file exists in the home dir
- - sudo npm -g install grunt-cli protractor
- # js unit tests
- - grunt ci-unit
- # acceptance tests
- #- webdriver-manager update
- #- grunt ci-e2e --verbose
- # debug section to check what went wrong
- - sudo apt-get install curl
- - curl http://admin:admin@localhost/owncloud/index.php
- - curl http://admin:admin@localhost/owncloud/index.php/apps/news/
- - sudo cat ../../../data/owncloud.log
+ # php unit tests
+ - phpunit --coverage-clover=coverage.clover tests/unit
+ - wget https://scrutinizer-ci.com/ocular.phar
+ - php ocular.phar code-coverage:upload --format=php-clover coverage.clover
+ - cd js/
+ # install javascript deps (putting it into install section fails often)
+ - npm install --deps # npm install needs to run before sudo npm install because otherwise it fails because a tmp file exists in the home dir
+ - sudo npm -g install grunt-cli protractor
+ # js unit tests
+ - grunt ci-unit
+ # acceptance tests
+ #- webdriver-manager update
+ #- grunt ci-e2e --verbose
+ # debug section to check what went wrong
+ - sudo apt-get install curl
+ - curl http://admin:admin@localhost/owncloud/index.php
+ - curl http://admin:admin@localhost/owncloud/index.php/apps/news/
+ - sudo cat ../../../data/owncloud.log
addons:
- postgresql: "9.3"
+ postgresql: "9.3"
diff --git a/appinfo/app.php b/appinfo/app.php
index 8188d3eeb..2809795fb 100644
--- a/appinfo/app.php
+++ b/appinfo/app.php
@@ -18,9 +18,9 @@ use \OCA\News\Config\DependencyException;
// Turn all errors into exceptions to combat shitty library behavior
set_error_handler(function ($code, $message) {
- if ($code === E_ERROR || $code === E_USER_ERROR) {
- throw new \Exception($message, $code);
- }
+ if ($code === E_ERROR || $code === E_USER_ERROR) {
+ throw new \Exception($message, $code);
+ }
});
$container = new Application();
diff --git a/appinfo/application.php b/appinfo/application.php
index e410ce701..8a1f02a4c 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -56,432 +56,432 @@ use \OCA\News\ArticleEnhancer\RegexArticleEnhancer;
$thirdPartyLibs = [
- '\HTMLPurifier' => 'htmlpurifier/library/HTMLPurifier.auto.php',
- '\SimplePie' => 'simplepie/autoloader.php',
- '\ZendXML\Security' => 'ZendXml/vendor/autoload.php',
- '\Net_URL2' => 'Net_URL2/Net/URL2.php'
+ '\HTMLPurifier' => 'htmlpurifier/library/HTMLPurifier.auto.php',
+ '\SimplePie' => 'simplepie/autoloader.php',
+ '\ZendXML\Security' => 'ZendXml/vendor/autoload.php',
+ '\Net_URL2' => 'Net_URL2/Net/URL2.php'
];
// to prevent clashes with installed app framework versions
foreach ($thirdPartyLibs as $class => $path) {
- if (!class_exists($class)) {
- require_once __DIR__ . '/../3rdparty/' . $path;
- }
+ if (!class_exists($class)) {
+ require_once __DIR__ . '/../3rdparty/' . $path;
+ }
}
class Application extends App {
- public function __construct(array $urlParams=array()){
- parent::__construct('news', $urlParams);
-
- $container = $this->getContainer();
-
-
- /**
- * Controllers
- */
- $container->registerService('PageController', function($c) {
- return new PageController(
- $c->query('AppName'),
- $c->query('Request'),
- $c->query('CoreConfig'),
- $c->query('URLGenerator'),
- $c->query('AppConfig'),
- $c->query('L10N'),
- $c->query('UserId')
- );
- });
-
- $container->registerService('AdminController', function($c) {
- return new AdminController(
- $c->query('AppName'),
- $c->query('Request'),
- $c->query('Config'),
- $c->query('ConfigPath')
- );
- });
-
- $container->registerService('FolderController', function($c) {
- return new FolderController(
- $c->query('AppName'),
- $c->query('Request'),
- $c->query('FolderService'),
- $c->query('FeedService'),
- $c->query('ItemService'),