diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-06 12:34:19 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-07-21 15:25:47 +0200 |
commit | de348180ae257017a9a2af05dac72286bf262bed (patch) | |
tree | 3fe07523249ca6a6e91defcff781b86be031b98c /lib | |
parent | 1bfb944d515c88f915739c3b920d39d6da200d29 (diff) | |
download | nextcloud-server-de348180ae257017a9a2af05dac72286bf262bed.tar.gz nextcloud-server-de348180ae257017a9a2af05dac72286bf262bed.zip |
Use the public interface and our method instead of the doctrine thing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/repair.php | 10 | ||||
-rw-r--r-- | lib/private/share/share.php | 16 | ||||
-rw-r--r-- | lib/repair/cleantags.php | 10 | ||||
-rw-r--r-- | lib/repair/dropoldtables.php | 8 | ||||
-rw-r--r-- | lib/repair/filletags.php | 7 |
5 files changed, 25 insertions, 26 deletions
diff --git a/lib/private/repair.php b/lib/private/repair.php index 166efd3eb8f..bf385af2c2b 100644 --- a/lib/private/repair.php +++ b/lib/private/repair.php @@ -103,14 +103,14 @@ class Repair extends BasicEmitter { public static function getRepairSteps() { return array( new RepairMimeTypes(), - new RepairLegacyStorages(\OC::$server->getConfig(), \OC_DB::getConnection()), + new RepairLegacyStorages(\OC::$server->getConfig(), \OC::$server->getDatabaseConnection()), new RepairConfig(), new AssetCache(), - new FillETags(\OC_DB::getConnection()), - new CleanTags(\OC_DB::getConnection()), - new DropOldTables(\OC_DB::getConnection()), + new FillETags(\OC::$server->getDatabaseConnection()), + new CleanTags(\OC::$server->getDatabaseConnection()), + new DropOldTables(\OC::$server->getDatabaseConnection()), new DropOldJobs(\OC::$server->getJobList()), - new RemoveGetETagEntries(\OC_DB::getConnection()), + new RemoveGetETagEntries(\OC::$server->getDatabaseConnection()), ); } diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 7fcbb695c68..e3364e0de0b 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -38,7 +38,7 @@ namespace OC\Share; use OCP\IUserSession; -use OC\DB\Connection; +use OCP\IDBConnection; use OCP\IConfig; /** @@ -1195,13 +1195,13 @@ class Share extends Constants { /** * Retrieve the owner of a connection * - * @param Connection $connection + * @param IDBConnection $connection * @param int $shareId * @throws \Exception * @return string uid of share owner */ - private static function getShareOwner(Connection $connection, $shareId) { - $qb = $connection->createQueryBuilder(); + private static function getShareOwner(IDBConnection $connection, $shareId) { + $qb = $connection->getQueryBuilder(); $qb->select('`uid_owner`') ->from('`*PREFIX*share`') @@ -1221,15 +1221,15 @@ class Share extends Constants { * Set expiration date for a share * * @param IUserSession $userSession - * @param Connection $connection + * @param IDBConnection $connection * @param IConfig $config * @param int $shareId * @param string $password * @throws \Exception * @return boolean */ - public static function setPassword(IUserSession $userSession, - Connection $connection, + public static function setPassword(IUserSession $userSession, + IDBConnection $connection, IConfig $config, $shareId, $password) { $user = $userSession->getUser(); @@ -1252,7 +1252,7 @@ class Share extends Constants { throw new \Exception('Cannot remove password'); } - $qb = $connection->createQueryBuilder(); + $qb = $connection->getQueryBuilder(); $qb->update('`*PREFIX*share`') ->set('`share_with`', ':pass') ->where('`id` = :shareId') diff --git a/lib/repair/cleantags.php b/lib/repair/cleantags.php index 7d2002427f8..ddd1a483016 100644 --- a/lib/repair/cleantags.php +++ b/lib/repair/cleantags.php @@ -22,9 +22,9 @@ namespace OC\Repair; -use OC\DB\Connection; use OC\Hooks\BasicEmitter; use OC\RepairStep; +use OCP\IDBConnection; /** * Class RepairConfig @@ -33,13 +33,13 @@ use OC\RepairStep; */ class CleanTags extends BasicEmitter implements RepairStep { - /** @var Connection */ + /** @var IDBConnection */ protected $connection; /** - * @param Connection $connection + * @param IDBConnection $connection */ - public function __construct(Connection $connection) { + public function __construct(IDBConnection $connection) { $this->connection = $connection; } @@ -108,7 +108,7 @@ class CleanTags extends BasicEmitter implements RepairStep { * the entry is deleted in the $deleteTable */ protected function deleteOrphanEntries($repairInfo, $deleteTable, $deleteId, $sourceTable, $sourceId, $sourceNullColumn) { - $qb = $this->connection->createQueryBuilder(); + $qb = $this->connection->getQueryBuilder(); $qb->select('d.`' . $deleteId . '`') ->from('`' . $deleteTable . '`', 'd') diff --git a/lib/repair/dropoldtables.php b/lib/repair/dropoldtables.php index 9afd9698e04..cfe0df6cb5b 100644 --- a/lib/repair/dropoldtables.php +++ b/lib/repair/dropoldtables.php @@ -22,19 +22,19 @@ namespace OC\Repair; -use OC\DB\Connection; use OC\Hooks\BasicEmitter; use OC\RepairStep; +use OCP\IDBConnection; class DropOldTables extends BasicEmitter implements RepairStep { - /** @var Connection */ + /** @var IDBConnection */ protected $connection; /** - * @param Connection $connection + * @param IDBConnection $connection */ - public function __construct(Connection $connection) { + public function __construct(IDBConnection $connection) { $this->connection = $connection; } diff --git a/lib/repair/filletags.php b/lib/repair/filletags.php index 501a18d0b4a..a46c951efaf 100644 --- a/lib/repair/filletags.php +++ b/lib/repair/filletags.php @@ -22,16 +22,15 @@ namespace OC\Repair; -use Doctrine\DBAL\Query\QueryBuilder; use OC\Hooks\BasicEmitter; class FillETags extends BasicEmitter implements \OC\RepairStep { - /** @var \OC\DB\Connection */ + /** @var \OCP\IDBConnection */ protected $connection; /** - * @param \OC\DB\Connection $connection + * @param \OCP\IDBConnection $connection */ public function __construct($connection) { $this->connection = $connection; @@ -42,7 +41,7 @@ class FillETags extends BasicEmitter implements \OC\RepairStep { } public function run() { - $qb = $this->connection->createQueryBuilder(); + $qb = $this->connection->getQueryBuilder(); $qb->update('`*PREFIX*filecache`') ->set('`etag`', $qb->expr()->literal('xxx')) ->where($qb->expr()->eq('`etag`', $qb->expr()->literal(''))) |