Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
5e3ecbbf
Commit
5e3ecbbf
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
dont use numRows when it's not needed since it can be expensive
parent
0e2b957d
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/appconfig.php
+4
-6
4 additions, 6 deletions
lib/appconfig.php
lib/group/database.php
+1
-1
1 addition, 1 deletion
lib/group/database.php
lib/preferences.php
+5
-6
5 additions, 6 deletions
lib/preferences.php
lib/user/database.php
+2
-2
2 additions, 2 deletions
lib/user/database.php
with
12 additions
and
15 deletions
lib/appconfig.php
+
4
−
6
View file @
5e3ecbbf
...
...
@@ -93,14 +93,12 @@ class OC_Appconfig{
// At least some magic in here :-)
$query
=
OC_DB
::
prepare
(
'SELECT configvalue FROM *PREFIX*appconfig WHERE appid = ? AND configkey = ?'
);
$result
=
$query
->
execute
(
array
(
$app
,
$key
));
if
(
!
$result
->
numRows
()){
$row
=
$result
->
fetchRow
();
if
(
$row
){
return
$row
[
"configvalue"
];
}
else
{
return
$default
;
}
$row
=
$result
->
fetchRow
();
return
$row
[
"configvalue"
];
}
/**
...
...
This diff is collapsed.
Click to expand it.
lib/group/database.php
+
1
−
1
View file @
5e3ecbbf
...
...
@@ -56,7 +56,7 @@ class OC_Group_Database extends OC_Group_Backend {
$query
=
OC_DB
::
prepare
(
"SELECT gid FROM `*PREFIX*groups` WHERE gid = ?"
);
$result
=
$query
->
execute
(
array
(
$gid
));
if
(
$result
->
num
Row
s
()
>
0
){
if
(
!
$result
->
fetch
Row
()
){
// Can not add an existing group
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
lib/preferences.php
+
5
−
6
View file @
5e3ecbbf
...
...
@@ -116,14 +116,13 @@ class OC_Preferences{
// Try to fetch the value, return default if not exists.
$query
=
OC_DB
::
prepare
(
'SELECT configvalue FROM *PREFIX*preferences WHERE userid = ? AND appid = ? AND configkey = ?'
);
$result
=
$query
->
execute
(
array
(
$user
,
$app
,
$key
));
if
(
!
$result
->
numRows
()){
$row
=
$result
->
fetchRow
();
if
(
$row
){
return
$row
[
"configvalue"
];
}
else
{
return
$default
;
}
$row
=
$result
->
fetchRow
();
return
$row
[
"configvalue"
];
}
/**
...
...
This diff is collapsed.
Click to expand it.
lib/user/database.php
+
2
−
2
View file @
5e3ecbbf
...
...
@@ -106,8 +106,8 @@ class OC_User_Database extends OC_User_Backend {
$query
=
OC_DB
::
prepare
(
"SELECT uid FROM *PREFIX*users WHERE uid LIKE ? AND password = ?"
);
$result
=
$query
->
execute
(
array
(
$uid
,
sha1
(
$password
)));
if
(
$result
->
num
Row
s
()
>
0
){
$row
=
$result
->
fetchRow
();
$row
=
$result
->
fetch
Row
()
;
if
(
$row
){
return
$row
[
'uid'
];
}
else
{
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment