summaryrefslogtreecommitdiffstats
path: root/apps/federation/command
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-12-17 17:01:24 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-12 14:24:47 +0100
commit693617d8a5b566454a2d18ff4cb9bcfd8559f3bd (patch)
tree714dc2f033863c8984469d041c00d6055b2608b3 /apps/federation/command
parent6d223df2f47a330c1bd61d2483de9bc113616068 (diff)
downloadnextcloud-server-693617d8a5b566454a2d18ff4cb9bcfd8559f3bd.tar.gz
nextcloud-server-693617d8a5b566454a2d18ff4cb9bcfd8559f3bd.zip
Inject DbHandler ....
Diffstat (limited to 'apps/federation/command')
-rw-r--r--apps/federation/command/syncfederationaddressbooks.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/federation/command/syncfederationaddressbooks.php b/apps/federation/command/syncfederationaddressbooks.php
index d152f1b19db..d7761d14814 100644
--- a/apps/federation/command/syncfederationaddressbooks.php
+++ b/apps/federation/command/syncfederationaddressbooks.php
@@ -16,22 +16,22 @@ use Symfony\Component\Console\Output\OutputInterface;
class SyncFederationAddressBooks extends Command {
- /** @var \OCP\IDBConnection */
- protected $dbConnection;
+ /** @var DbHandler */
+ protected $dbHandler;
/** @var SyncService */
private $syncService;
/**
* @param IUserManager $userManager
- * @param IDBConnection $dbConnection
+ * @param IDBConnection $dbHandler
* @param IConfig $config
*/
- function __construct(IDBConnection $dbConnection) {
+ function __construct(DbHandler $dbHandler) {
parent::__construct();
$this->syncService = \OC::$server->query('CardDAVSyncService');
- $this->dbConnection = $dbConnection;
+ $this->dbHandler = $dbHandler;
}
protected function configure() {
@@ -48,8 +48,7 @@ class SyncFederationAddressBooks extends Command {
$progress = new ProgressBar($output);
$progress->start();
- $db = new DbHandler($this->dbConnection, null);
- $trustedServers = $db->getAllServer();
+ $trustedServers = $this->dbHandler->getAllServer();
foreach ($trustedServers as $trustedServer) {
$progress->advance();
$url = $trustedServer['url'];
@@ -66,7 +65,7 @@ class SyncFederationAddressBooks extends Command {
];
$newToken = $this->syncService->syncRemoteAddressBook($url, 'system', $sharedSecret, $syncToken, $targetPrincipal, $targetBookId, $targetBookProperties);
if ($newToken !== $syncToken) {
- $db->setServerStatus($url, TrustedServers::STATUS_OK, $newToken);
+ $this->dbHandler->setServerStatus($url, TrustedServers::STATUS_OK, $newToken);
}
}
$progress->finish();