-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
introduce callForSeenUsers and countSeenUsers #1888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@MorrisJobke, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rullzer, @PVince81 and @DeepDiver1975 to be potential reviewers. |
|
cc @icewind1991 |
|
I like it. |
lib/private/User/Manager.php
Outdated
| ); | ||
|
|
||
| $query = $queryBuilder->execute(); | ||
| return (int)$query->fetchColumn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing $query->closeCursor()
lib/private/User/Manager.php
Outdated
| 'appid', $queryBuilder->createNamedParameter('login')) | ||
| ) | ||
| ->andWhere($queryBuilder->expr()->eq( | ||
| 'configkey', $queryBuilder->createNamedParameter('lastLogin')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code style is odd in here
lib/private/User/Manager.php
Outdated
|
|
||
| /** | ||
| * @param \Closure $callback | ||
| * @param string $search |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't see this
| * @return string[] with user ids | ||
| */ | ||
| private function getSeenUserIds($limit = null, $offset = null) { | ||
| $queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah that will cause the DB to be initialized to early. So then installing fails. We should fix that at some point. But probabaly can't right now.
| * @since 9.2.0 | ||
| */ | ||
| public function countSeenUsers() { | ||
| $queryBuilder = \OC::$server->getDatabaseConnection()->getQueryBuilder(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DI?
|
|
||
| while ($row = $query->fetch()) { | ||
| $result[] = $row['userid']; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing $query->closeCursor()
|
|
||
| return $result; | ||
| } | ||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new line before this?
| * @param \Closure $callback | ||
| * @param string $search | ||
| * @since 9.2.0 | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awkward space
lib/private/User/Manager.php
Outdated
| * @param string $search | ||
| * @since 9.2.0 | ||
| */ | ||
| public function callForSeenUsers (\Closure $callback) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awkward space
* introduce callForSeenUsers and countSeenUsers * add tests * oracle should support not null on clob * since 9.2.0
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
| public function countSeenUsers(); | ||
|
|
||
| /** | ||
| * @param \Closure $callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid doc
* Fixed comments Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
d186f31 to
f722640
Compare
|
I fixed most of the comments. Injecting the DB here fails hard as it gets initialized to early then. I say lets get this in. 👍 |
|
Fine by me, also tested with the announcement center 👍 |
cc @rullzer @nickvergessen @schiessle
I will create a ticket to check our codebase for similar usages.