added an option to syslog sphinx queries

This commit is contained in:
SJ 2012-10-23 19:11:49 +02:00
parent 79282987a5
commit e96eab3c1b
3 changed files with 5 additions and 2 deletions

View File

@ -18,7 +18,7 @@ define('ENABLE_FOLDER_RESTRICTIONS', 0);
define('ENABLE_GOOGLE_LOGIN', 0);
define('SEARCH_RESULT_CHECKBOX_CHECKED', 1);
define('HELPER_URL', '');
define('ENABLE_SYSLOG', 0);
define('GOOGLE_CLIENT_ID', 'xxxxxxxxxxx');
define('GOOGLE_CLIENT_SECRET', 'xxxxxxxxxxxxx');
define('GOOGLE_DEVELOPER_KEY', 'xxxxxxxxxxxx');

View File

@ -32,6 +32,9 @@ $language = new Language();
Registry::set('language', $language);
if(ENABLE_SYSLOG == 1) { openlog("piler-webui", LOG_PID, LOG_MAIL); }
/* check if user has authenticated himself. If not, we send him to login */
Registry::set('username', getAuthenticatedUsername());

View File

@ -303,7 +303,7 @@ class ModelSearchSearch extends Model {
$query = $this->sphx->query("SELECT id FROM " . SPHINX_MAIN_INDEX . " WHERE $a $date $attachment $direction $size $folders MATCH('$match') $sortorder LIMIT 0," . MAX_SEARCH_HITS);
}
//print $query->query; print "<p>" . $query->exec_time . "</p>\n";
if(ENABLE_SYSLOG == 1) { syslog(LOG_INFO, sprintf("sphinx query: %s in %.2f s", $query->query, $query->exec_time)); }
/*