Skip to content

Commit

Permalink
Some commented-out debugging code for item searches
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Nov 5, 2013
1 parent 57b349f commit c396bc0
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions model/Items.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,23 @@ public static function search($libraryID, $onlyTopLevel=false, $params=array(),
$sqlParams[] = $params['limit'];
}

// Log SQL statement with embedded parameters
/*if (true || !empty($_GET['sqldebug'])) {
error_log($onlyTopLevel);
$debugSQL = "";
$parts = explode("?", $sql);
$debugSQLParams = $sqlParams;
foreach ($parts as $part) {
$val = array_shift($debugSQLParams);
$debugSQL .= $part;
if (!is_null($val)) {
$debugSQL .= is_int($val) ? $val : '"' . $val . '"';
}
}
error_log($debugSQL . ";");
}*/

if ($params['format'] == 'versions') {
$rows = Zotero_DB::query($sql, $sqlParams, $shardID);
}
Expand Down

0 comments on commit c396bc0

Please sign in to comment.