Skip to content

Commit

Permalink
Fixes Elgg#4084 support anonymous functions for db callbacks - from J…
Browse files Browse the repository at this point in the history
…anek Lasocki-Biczysko
  • Loading branch information
cash committed Jun 19, 2012
1 parent daa9ce7 commit 2584535
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/lib/database.php
Expand Up @@ -387,7 +387,8 @@ function elgg_query_runner($query, $callback = null, $single = false) {
// Since we want to cache results of running the callback, we need to
// need to namespace the query with the callback and single result request.
// http://trac.elgg.org/ticket/4049
$hash = (string)$callback . (int)$single . $query;
$callback_hash = is_object($callback) ? spl_object_hash($callback) : (string)$callback;
$hash = $callback_hash . (int)$single . $query;

// Is cached?
if ($DB_QUERY_CACHE) {
Expand Down

0 comments on commit 2584535

Please sign in to comment.