From b5385f31685108e6959bc41fc984f17bf5c7b576 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 22 Mar 2018 15:59:01 +0100 Subject: [PATCH 1/4] Make compatible with NC14 Signed-off-by: Roeland Jago Douma --- appinfo/info.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/info.xml b/appinfo/info.xml index 47a89ed0..0b23eba4 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -23,7 +23,7 @@ https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-presentation.png https://nextcloud.com/wp-content/themes/next/assets/img/features/collabora-spreadsheet.png - + OCA\Richdocuments\Settings\Admin From fb29fe72a33e56ed6e7d3d85b75bfd01108a0c8c Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 22 Mar 2018 16:01:21 +0100 Subject: [PATCH 2/4] Properly name classes * All should be PSR-4 Signed-off-by: Roeland Jago Douma --- lib/{appconfig.php => AppConfig.php} | 0 lib/{db.php => Db/DbBase.php} | 4 ++-- lib/{db/wopi.php => Db/Wopi.php} | 5 +---- lib/{helper.php => Helper.php} | 0 4 files changed, 3 insertions(+), 6 deletions(-) rename lib/{appconfig.php => AppConfig.php} (100%) rename lib/{db.php => Db/DbBase.php} (98%) rename lib/{db/wopi.php => Db/Wopi.php} (94%) rename lib/{helper.php => Helper.php} (100%) diff --git a/lib/appconfig.php b/lib/AppConfig.php similarity index 100% rename from lib/appconfig.php rename to lib/AppConfig.php diff --git a/lib/db.php b/lib/Db/DbBase.php similarity index 98% rename from lib/db.php rename to lib/Db/DbBase.php index 11efefb3..ff620ec9 100644 --- a/lib/db.php +++ b/lib/Db/DbBase.php @@ -9,13 +9,13 @@ * later. */ -namespace OCA\Richdocuments; +namespace OCA\Richdocuments\Db; /** * Generic DB class */ -abstract class Db { +abstract class DbBase { protected $data; diff --git a/lib/db/wopi.php b/lib/Db/Wopi.php similarity index 94% rename from lib/db/wopi.php rename to lib/Db/Wopi.php index 45152f8e..d4b40c12 100644 --- a/lib/db/wopi.php +++ b/lib/Db/Wopi.php @@ -11,10 +11,7 @@ namespace OCA\Richdocuments\Db; -use \OCA\Richdocuments\Download; -use \OCA\Richdocuments\DownloadResponse; - -class Wopi extends \OCA\Richdocuments\Db{ +class Wopi extends DbBase { const DB_TABLE = '`*PREFIX*richdocuments_wopi`'; diff --git a/lib/helper.php b/lib/Helper.php similarity index 100% rename from lib/helper.php rename to lib/Helper.php From 543cfe524258c0c0e8525f9957590a1d7862c42f Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 22 Mar 2018 16:02:10 +0100 Subject: [PATCH 3/4] Move Application also to lib Signed-off-by: Roeland Jago Douma --- {appinfo => lib/AppInfo}/Application.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {appinfo => lib/AppInfo}/Application.php (100%) diff --git a/appinfo/Application.php b/lib/AppInfo/Application.php similarity index 100% rename from appinfo/Application.php rename to lib/AppInfo/Application.php From ecfac31c214aea014a7b5b1dad644957f30ef8d3 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Thu, 22 Mar 2018 16:05:53 +0100 Subject: [PATCH 4/4] Let DI handle the magic Signed-off-by: Roeland Jago Douma --- lib/AppInfo/Application.php | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 0a4c0a98..71377008 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -29,18 +29,5 @@ use OCP\AppFramework\IAppContainer; class Application extends App { public function __construct (array $urlParams = array()) { parent::__construct('richdocuments', $urlParams); - $container = $this->getContainer(); - $container->registerService( - DiscoveryManager::class, - function(IAppContainer $container) { - return new DiscoveryManager( - $container->getServer()->getHTTPClientService(), - $container->getServer()->getAppDataDir('richdocuments'), - $container->getServer()->getConfig(), - $container->getServer()->getL10N('richdocuments'), - new TimeFactory() - ); - } - ); } -} \ No newline at end of file +}