summaryrefslogtreecommitdiffstats
path: root/apps/files/lib/activity.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-11-30 09:42:11 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-11-30 17:14:47 +0100
commit23046ca5b7484b69ffe89b947d84f0b5cf2222ca (patch)
treef89be00a835526a51cd4c6f0b22dc56b5e1e688f /apps/files/lib/activity.php
parente9094b8a41e81fbd4f86aae5a4cadcab0674d93c (diff)
downloadnextcloud-server-23046ca5b7484b69ffe89b947d84f0b5cf2222ca.tar.gz
nextcloud-server-23046ca5b7484b69ffe89b947d84f0b5cf2222ca.zip
Inject the database connection
Diffstat (limited to 'apps/files/lib/activity.php')
-rw-r--r--apps/files/lib/activity.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/files/lib/activity.php b/apps/files/lib/activity.php
index 132f4169dee..23e3f26e62d 100644
--- a/apps/files/lib/activity.php
+++ b/apps/files/lib/activity.php
@@ -22,6 +22,7 @@
namespace OCA\Files;
+use OCP\IDBConnection;
use OCP\L10N\IFactory;
use OCP\Activity\IExtension;
use OCP\Activity\IManager;
@@ -52,6 +53,9 @@ class Activity implements IExtension {
/** @var \OCP\Activity\IManager */
protected $activityManager;
+ /** @var \OCP\IDBConnection */
+ protected $connection;
+
/** @var \OCP\IConfig */
protected $config;
@@ -63,14 +67,16 @@ class Activity implements IExtension {
* @param IURLGenerator $URLGenerator
* @param IManager $activityManager
* @param ActivityHelper $helper
+ * @param IDBConnection $connection
* @param IConfig $config
*/
- public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator, IManager $activityManager, ActivityHelper $helper, IConfig $config) {
+ public function __construct(IFactory $languageFactory, IURLGenerator $URLGenerator, IManager $activityManager, ActivityHelper $helper, IDBConnection $connection, IConfig $config) {
$this->languageFactory = $languageFactory;
$this->URLGenerator = $URLGenerator;
$this->l = $this->getL10N();
$this->activityManager = $activityManager;
$this->helper = $helper;
+ $this->connection = $connection;
$this->config = $config;
}
@@ -391,7 +397,7 @@ class Activity implements IExtension {
}
foreach ($favorites['folders'] as $favorite) {
$fileQueryList[] = '`file` LIKE ?';
- $parameters[] = \OC::$server->getDatabaseConnection()->escapeLikeParameter($favorite) . '/%';
+ $parameters[] = $this->connection->escapeLikeParameter($favorite) . '/%';
}
return [