diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-03-16 21:59:47 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2017-03-16 21:59:47 +0100 |
commit | d134dea50897382021fb78661edaab483fdfff73 (patch) | |
tree | a57d25222ea30fe3b53ebc38a515bb66d6b09cb7 /lib/private/User | |
parent | 085891a15d1ee7761d3a90df3fd0242249dcea18 (diff) | |
download | nextcloud-server-d134dea50897382021fb78661edaab483fdfff73.tar.gz nextcloud-server-d134dea50897382021fb78661edaab483fdfff73.zip |
Don't call function in constructor
The constructor is iniitiated already very early in base.php, thus requiring this here will break the setup and some more. For now we probably have to live with a static function call here thus.
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'lib/private/User')
-rw-r--r-- | lib/private/User/Database.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php index b1795d27e93..060953c3009 100644 --- a/lib/private/User/Database.php +++ b/lib/private/User/Database.php @@ -68,9 +68,6 @@ class Database extends Backend implements IUserBackend { /** @var EventDispatcher */ private $eventDispatcher; - /** @var \OCP\IDBConnection */ - private $connection; - /** * \OC\User\Database constructor. * @@ -79,7 +76,6 @@ class Database extends Backend implements IUserBackend { public function __construct($eventDispatcher = null) { $this->cache = new CappedMemoryCache(); $this->eventDispatcher = $eventDispatcher ? $eventDispatcher : \OC::$server->getEventDispatcher(); - $this->connection = \OC::$server->getDatabaseConnection(); } /** @@ -189,8 +185,8 @@ class Database extends Backend implements IUserBackend { $parameters = []; $searchLike = ''; if ($search !== '') { - $parameters[] = '%' . $this->connection->escapeLikeParameter($search) . '%'; - $parameters[] = '%' . $this->connection->escapeLikeParameter($search) . '%'; + $parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%'; + $parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%'; $searchLike = ' WHERE LOWER(`displayname`) LIKE LOWER(?) OR ' . 'LOWER(`uid`) LIKE LOWER(?)'; } @@ -279,7 +275,7 @@ class Database extends Backend implements IUserBackend { $parameters = []; $searchLike = ''; if ($search !== '') { - $parameters[] = '%' . $this->connection->escapeLikeParameter($search) . '%'; + $parameters[] = '%' . \OC::$server->getDatabaseConnection()->escapeLikeParameter($search) . '%'; $searchLike = ' WHERE LOWER(`uid`) LIKE LOWER(?)'; } |