diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 11:11:20 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 11:11:20 +0200 |
commit | a52df5cad2f9853514988b1bb43b07e812bb9316 (patch) | |
tree | 89dd47c8be24de558bbce3b37cb6d8a59002cac9 | |
parent | 29000e2d6f49ed9b08b15a9f474dfb5b4145d800 (diff) |
move config class into config folder
-rw-r--r-- | appinfo/app.php | 5 | ||||
-rw-r--r-- | appinfo/application.php | 3 | ||||
-rw-r--r-- | appinfo/install.php | 22 | ||||
-rw-r--r-- | articleenhancer/xpatharticleenhancer.php | 4 | ||||
-rw-r--r-- | config/config.php (renamed from utility/config.php) | 2 | ||||
-rw-r--r-- | fetcher/feedfetcher.php | 2 | ||||
-rw-r--r-- | service/feedservice.php | 2 | ||||
-rw-r--r-- | service/folderservice.php | 2 | ||||
-rw-r--r-- | service/itemservice.php | 2 | ||||
-rw-r--r-- | tests/unit/articleenhancer/XPathArticleEnhancerTest.php | 2 | ||||
-rw-r--r-- | tests/unit/config/ConfigTest.php (renamed from tests/unit/utility/ConfigTest.php) | 2 | ||||
-rw-r--r-- | tests/unit/fetcher/FeedFetcherTest.php | 2 | ||||
-rw-r--r-- | tests/unit/service/FeedServiceTest.php | 2 | ||||
-rw-r--r-- | tests/unit/service/FolderServiceTest.php | 8 | ||||
-rw-r--r-- | tests/unit/service/ItemServiceTest.php | 2 |
15 files changed, 41 insertions, 21 deletions
diff --git a/appinfo/app.php b/appinfo/app.php index 077d0b7c4..a6de66ce2 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -28,7 +28,4 @@ $container = new Application(); $config = $container->getAppConfig(); $config->registerNavigation(); $config->registerBackgroundJobs(); -$config->registerHooks(); - -// check for correct app dependencies and fail if possible -$config->testDependencies(); +$config->registerHooks();
\ No newline at end of file diff --git a/appinfo/application.php b/appinfo/application.php index 5d27fe5dd..cdbaa82d6 100644 --- a/appinfo/application.php +++ b/appinfo/application.php @@ -19,6 +19,7 @@ use \OCP\Util; use \OCP\User; use \OCA\News\Config\AppConfig; +use \OCA\News\Config\Config; use \OCA\News\Controller\PageController; use \OCA\News\Controller\FolderController; @@ -39,7 +40,6 @@ use \OCA\News\Db\FeedMapper; use \OCA\News\Db\StatusFlag; use \OCA\News\Db\MapperFactory; -use \OCA\News\Utility\Config; use \OCA\News\Utility\OPMLExporter; use \OCA\News\Utility\Updater; use \OCA\News\Utility\SimplePieAPIFactory; @@ -470,5 +470,6 @@ class Application extends App { } + public function dispatchPart($controller, $) } diff --git a/appinfo/install.php b/appinfo/install.php new file mode 100644 index 000000000..572f21fff --- /dev/null +++ b/appinfo/install.php @@ -0,0 +1,22 @@ +<?php +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Alessandro Cosentino <cosenal@gmail.com> + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Alessandro Cosentino 2012 + * @copyright Bernhard Posselt 2012, 2014 + */ + +namespace OCA\News\AppInfo; + +use \OCA\News\Config\DependencyException; + + +// check for correct app dependencies and fail if possible +$container = new Application(); +$config = $container->getAppConfig(); +$config->testDependencies();
\ No newline at end of file diff --git a/articleenhancer/xpatharticleenhancer.php b/articleenhancer/xpatharticleenhancer.php index fa704e301..623b42bfc 100644 --- a/articleenhancer/xpatharticleenhancer.php +++ b/articleenhancer/xpatharticleenhancer.php @@ -20,7 +20,7 @@ use \ZendXml\Security; use \OCA\News\Db\Item; use \OCA\News\Utility\SimplePieAPIFactory; -use \OCA\News\Utility\Config; +use \OCA\News\Config\Config; @@ -38,7 +38,7 @@ class XPathArticleEnhancer implements ArticleEnhancer { * @param array $regexXPathPair an associative array containing regex to * match the url and the xpath that should be used for it to extract the * page - * @param \OCA\News\Utility\Config $config + * @param \OCA\News\Config\Config $config */ public function __construct(SimplePieAPIFactory $fileFactory, array $regexXPathPair, diff --git a/utility/config.php b/config/config.php index 94e71442b..d84e4076c 100644 --- a/utility/config.php +++ b/config/config.php @@ -11,7 +11,7 @@ * @copyright Bernhard Posselt 2012, 2014 */ -namespace OCA\News\Utility; +namespace OCA\News\Config; use \OCP\ILogger; diff --git a/fetcher/feedfetcher.php b/fetcher/feedfetcher.php index feeabb2bb..c08bf4606 100644 --- a/fetcher/feedfetcher.php +++ b/fetcher/feedfetcher.php @@ -17,7 +17,7 @@ use \OCA\News\Db\Item; use \OCA\News\Db\Feed; use \OCA\News\Utility\FaviconFetcher; use \OCA\News\Utility\SimplePieAPIFactory; -use \OCA\News\Utility\Config; +use \OCA\News\Config\Config; use \OCA\News\Config\AppConfig; diff --git a/service/feedservice.php b/service/feedservice.php index cb8d4f7cc..ce1c48af9 100644 --- a/service/feedservice.php +++ b/service/feedservice.php @@ -24,7 +24,7 @@ use \OCA\News\Db\ItemMapper; use \OCA\News\Fetcher\Fetcher; use \OCA\News\Fetcher\FetcherException; use \OCA\News\ArticleEnhancer\Enhancer; -use \OCA\News\Utility\Config; +use \OCA\News\Config\Config; class FeedService extends Service { diff --git a/service/folderservice.php b/service/folderservice.php index f6d45c7e5..88cc8355e 100644 --- a/service/folderservice.php +++ b/service/folderservice.php @@ -17,7 +17,7 @@ use \OCP\IL10N; use \OCA\News\Db\Folder; use \OCA\News\Db\FolderMapper; -use \OCA\News\Utility\Config; +use \OCA\News\Config\Config; class FolderService extends Service { diff --git a/service/itemservice.php b/service/itemservice.php index dcabb2f11..792fcc987 100644 --- a/service/itemservice.php +++ b/service/itemservice.php @@ -18,7 +18,7 @@ use \OCP\AppFramework\Db\DoesNotExistException; use \OCA\News\Db\ItemMapper; use \OCA\News\Db\StatusFlag; use \OCA\News\Db\FeedType; -use \OCA\News\Utility\Config; +use \OCA\News\Config\Config; class ItemService extends Service { diff --git a/tests/unit/articleenhancer/XPathArticleEnhancerTest.php b/tests/unit/articleenhancer/XPathArticleEnhancerTest.php index 8a99e9d5a..082a2030c 100644 --- a/tests/unit/articleenhancer/XPathArticleEnhancerTest.php +++ b/tests/unit/articleenhancer/XPathArticleEnhancerTest.php @@ -37,7 +37,7 @@ class XPathArticleEnhancerTest extends \PHPUnit_Framework_TestCase { $this->proxyPort = 3; $this->proxyAuth = 'hi'; $this->config = $this->getMockBuilder( - '\OCA\News\Utility\Config') + '\OCA\News\Config\Config') ->disableOriginalConstructor() ->getMock(); $this->config->expects($this->any()) diff --git a/tests/unit/utility/ConfigTest.php b/tests/unit/config/ConfigTest.php index a8f7be1be..b03eeb325 100644 --- a/tests/unit/utility/ConfigTest.php +++ b/tests/unit/config/ConfigTest.php @@ -11,7 +11,7 @@ * @copyright Bernhard Posselt 2012, 2014 */ -namespace OCA\News\Utility; +namespace OCA\News\Config; class ConfigTest extends \PHPUnit_Framework_TestCase { diff --git a/tests/unit/fetcher/FeedFetcherTest.php b/tests/unit/fetcher/FeedFetcherTest.php index 893fb7b2a..948e25e9b 100644 --- a/tests/unit/fetcher/FeedFetcherTest.php +++ b/tests/unit/fetcher/FeedFetcherTest.php @@ -102,7 +102,7 @@ class FeedFetcherTest extends \PHPUnit_Framework_TestCase { $this->proxyAuth = 'hi'; $this->fetchTimeout = 40; $this->config = $this->getMockBuilder( - '\OCA\News\Utility\Config') + '\OCA\News\Config\Config') ->disableOriginalConstructor() ->getMock(); $this->config->expects($this->any()) diff --git a/tests/unit/service/FeedServiceTest.php b/tests/unit/service/FeedServiceTest.php index a4e722109..cc8d3018e 100644 --- a/tests/unit/service/FeedServiceTest.php +++ b/tests/unit/service/FeedServiceTest.php @@ -69,7 +69,7 @@ class FeedServiceTest extends \PHPUnit_Framework_TestCase { ->getMock(); $this->purifier = $this->getMock('purifier', ['purify']); $config = $this->getMockBuilder( - '\OCA\News\Utility\Config') + '\OCA\News\Config\Config') ->disableOriginalConstructor() ->getMock(); $config->expects($this->any()) diff --git a/tests/unit/service/FolderServiceTest.php b/tests/unit/service/FolderServiceTest.php index 144705b26..bbc89c99d 100644 --- a/tests/unit/service/FolderServiceTest.php +++ b/tests/unit/service/FolderServiceTest.php @@ -40,7 +40,7 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase { ->getMock(); $this->autoPurgeMinimumInterval = 10; $config = $this->getMockBuilder( - '\OCA\News\Utility\Config') + '\OCA\News\Config\Config') ->disableOriginalConstructor() ->getMock(); $config->expects($this->any()) @@ -147,14 +147,14 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase { $this->folderService->rename(3, 'bogus', ''); - $this->assertEquals('bogus', $folder->getName()); + $this->assertEquals('bogus', $folder->getName()); } public function testRenameThrowsExWhenFolderNameExists(){ $folderName = 'hihi'; $rows = [['id' => 1]]; - + $this->l10n->expects($this->once()) ->method('t'); $this->folderMapper->expects($this->once()) @@ -169,7 +169,7 @@ class FolderServiceTest extends \PHPUnit_Framework_TestCase { public function testRenameThrowsExWhenFolderNameEmpty(){ $folderName = ''; - + $this->folderMapper->expects($this->once()) ->method('findByName') ->with($this->equalTo($folderName)) diff --git a/tests/unit/service/ItemServiceTest.php b/tests/unit/service/ItemServiceTest.php index 2f5f31cba..03d644eb9 100644 --- a/tests/unit/service/ItemServiceTest.php +++ b/tests/unit/service/ItemServiceTest.php @@ -49,7 +49,7 @@ class ItemServiceTest extends \PHPUnit_Framework_TestCase { ->will($this->returnValue($this->status)); $this->threshold = 2; $config = $this->getMockBuilder( - '\OCA\News\Utility\Config') + '\OCA\News\Config\Config') ->disableOriginalConstructor() ->getMock(); $config->expects($this->any()) |