[Tickets #8684] Reduce number of calls of hasPermission(PERMS_READ)

bugs at horde.org bugs at horde.org
Fri Nov 6 15:48:38 UTC 2009


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/8684
------------------------------------------------------------------------------
  Ticket             | 8684
  Created By         | patrick.abiven at apitech.fr
  Summary            | Reduce number of calls of hasPermission(PERMS_READ)
  Queue              | Kronolith
  Version            | FRAMEWORK_3
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


patrick.abiven at apitech.fr (2009-11-06 10:48) wrote:

Hello
In lib/Driver.php, adding a new optional argument $permsread in the  
getLink() function enables a valuable optimization (15 seconds instead  
of 21 seconds in our scenario). Instead of calling 3 times  
hasPermission() we just do a single call.

In lib/Views/Month.php, function html()
$permread = $event->hasPermission(PERMS_READ);
$event->getLink($timestamp, true, $this->link(0, true, $permread)

And then in lib/Driver.php, function getLink() we do not call twice  
hasPermission but we use the optional argument.

Regards







More information about the bugs mailing list