Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
387608ca
Commit
387608ca
authored
Dec 19, 2012
by
Byron Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 815532: Add caching for Bugzilla::User objects
r=dkl,a=LpSolit
parent
e068bcc7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
28 deletions
+18
-28
Attachment.pm
Bugzilla/Attachment.pm
+2
-3
Bug.pm
Bugzilla/Bug.pm
+3
-3
Comment.pm
Bugzilla/Comment.pm
+2
-1
Component.pm
Bugzilla/Component.pm
+5
-12
Flag.pm
Bugzilla/Flag.pm
+6
-9
No files found.
Bugzilla/Attachment.pm
View file @
387608ca
...
...
@@ -190,9 +190,8 @@ the user who attached the attachment
sub
attacher
{
my
$self
=
shift
;
return
$self
->
{
attacher
}
if
exists
$self
->
{
attacher
};
$self
->
{
attacher
}
=
new
Bugzilla::
User
(
$self
->
{
submitter_id
});
return
$self
->
{
attacher
};
return
$self
->
{
attacher
}
||=
new
Bugzilla::
User
({
id
=>
$self
->
{
submitter_id
},
cache
=>
1
});
}
=over
...
...
Bugzilla/Bug.pm
View file @
387608ca
...
...
@@ -3154,7 +3154,7 @@ sub assigned_to {
my
(
$self
)
=
@_
;
return
$self
->
{
'assigned_to_obj'
}
if
exists
$self
->
{
'assigned_to_obj'
};
$self
->
{
'assigned_to'
}
=
0
if
$self
->
{
'error'
};
$self
->
{
'assigned_to_obj'
}
||=
new
Bugzilla::
User
(
$self
->
{
'assigned_to'
});
$self
->
{
'assigned_to_obj'
}
||=
new
Bugzilla::
User
(
{
id
=>
$self
->
{
'assigned_to'
},
cache
=>
1
});
return
$self
->
{
'assigned_to_obj'
};
}
...
...
@@ -3452,7 +3452,7 @@ sub qa_contact {
return
undef
if
$self
->
{
'error'
};
if
(
Bugzilla
->
params
->
{
'useqacontact'
}
&&
$self
->
{
'qa_contact'
})
{
$self
->
{
'qa_contact_obj'
}
=
new
Bugzilla::
User
(
$self
->
{
'qa_contact'
});
$self
->
{
'qa_contact_obj'
}
=
new
Bugzilla::
User
(
{
id
=>
$self
->
{
'qa_contact'
},
cache
=>
1
});
}
else
{
$self
->
{
'qa_contact_obj'
}
=
undef
;
}
...
...
@@ -3463,7 +3463,7 @@ sub reporter {
my
(
$self
)
=
@_
;
return
$self
->
{
'reporter'
}
if
exists
$self
->
{
'reporter'
};
$self
->
{
'reporter_id'
}
=
0
if
$self
->
{
'error'
};
$self
->
{
'reporter'
}
=
new
Bugzilla::
User
(
$self
->
{
'reporter_id'
});
$self
->
{
'reporter'
}
=
new
Bugzilla::
User
(
{
id
=>
$self
->
{
'reporter_id'
},
cache
=>
1
});
return
$self
->
{
'reporter'
};
}
...
...
Bugzilla/Comment.pm
View file @
387608ca
...
...
@@ -137,7 +137,8 @@ sub attachment {
sub
author
{
my
$self
=
shift
;
$self
->
{
'author'
}
||=
new
Bugzilla::
User
(
$self
->
{
'who'
});
$self
->
{
'author'
}
||=
new
Bugzilla::
User
({
id
=>
$self
->
{
'who'
},
cache
=>
1
});
return
$self
->
{
'author'
};
}
...
...
Bugzilla/Component.pm
View file @
387608ca
...
...
@@ -342,23 +342,16 @@ sub bug_ids {
sub
default_assignee
{
my
$self
=
shift
;
if
(
!
defined
$self
->
{
'default_assignee'
})
{
$self
->
{
'default_assignee'
}
=
new
Bugzilla::
User
(
$self
->
{
'initialowner'
});
}
return
$self
->
{
'default_assignee'
};
return
$self
->
{
'default_assignee'
}
||=
new
Bugzilla::
User
({
id
=>
$self
->
{
'initialowner'
},
cache
=>
1
});
}
sub
default_qa_contact
{
my
$self
=
shift
;
return
if
!
$self
->
{
'initialqacontact'
};
if
(
!
defined
$self
->
{
'default_qa_contact'
})
{
$self
->
{
'default_qa_contact'
}
=
new
Bugzilla::
User
(
$self
->
{
'initialqacontact'
});
}
return
$self
->
{
'default_qa_contact'
};
return
unless
$self
->
{
'initialqacontact'
};
return
$self
->
{
'default_qa_contact'
}
||=
new
Bugzilla::
User
({
id
=>
$self
->
{
'initialqacontact'
},
cache
=>
1
});
}
sub
flag_types
{
...
...
Bugzilla/Flag.pm
View file @
387608ca
...
...
@@ -181,22 +181,20 @@ is an attachment flag, else undefined.
sub
type
{
my
$self
=
shift
;
$self
->
{
'type'
}
||=
new
Bugzilla::
FlagType
(
$self
->
{
'type_id'
});
return
$self
->
{
'type'
};
return
$self
->
{
'type'
}
||=
new
Bugzilla::
FlagType
(
$self
->
{
'type_id'
});
}
sub
setter
{
my
$self
=
shift
;
$self
->
{
'setter'
}
||=
new
Bugzilla::
User
(
$self
->
{
'setter_id'
});
return
$self
->
{
'setter'
};
return
$self
->
{
'setter'
}
||=
new
Bugzilla::
User
({
id
=>
$self
->
{
'setter_id'
},
cache
=>
1
});
}
sub
requestee
{
my
$self
=
shift
;
if
(
!
defined
$self
->
{
'requestee'
}
&&
$self
->
{
'requestee_id'
})
{
$self
->
{
'requestee'
}
=
new
Bugzilla::
User
(
$self
->
{
'requestee_id'
});
$self
->
{
'requestee'
}
=
new
Bugzilla::
User
(
{
id
=>
$self
->
{
'requestee_id'
},
cache
=>
1
});
}
return
$self
->
{
'requestee'
};
}
...
...
@@ -206,16 +204,15 @@ sub attachment {
return
undef
unless
$self
->
attach_id
;
require
Bugzilla::
Attachment
;
$self
->
{
'attachment'
}
||=
new
Bugzilla::
Attachment
(
$self
->
attach_id
);
return
$self
->
{
'attachment'
}
;
return
$self
->
{
'attachment'
}
||=
new
Bugzilla::
Attachment
({
id
=>
$self
->
attach_id
,
cache
=>
1
})
;
}
sub
bug
{
my
$self
=
shift
;
require
Bugzilla::
Bug
;
$self
->
{
'bug'
}
||=
new
Bugzilla::
Bug
(
$self
->
bug_id
);
return
$self
->
{
'bug'
};
return
$self
->
{
'bug'
}
||=
new
Bugzilla::
Bug
({
id
=>
$self
->
bug_id
,
cache
=>
1
});
}
################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment