1
0

Added PDO::Postgres DB-layer support by Theo Schlossnagle

This commit is contained in:
Garvin Hicking
2007-02-06 08:27:29 +00:00
parent 99021e58cd
commit 1c83a7099a
10 changed files with 350 additions and 8 deletions

View File

@ -327,7 +327,8 @@ function &serendipity_fetchEntries($range = null, $full = true, $limit = '', $fe
serendipity_plugin_api::hook_event('frontend_fetchentries', $cond, array('noCache' => $noCache, 'noSticky' => $noSticky, 'source' => 'entries'));
if ($serendipity['dbType'] == 'postgres') {
if ($serendipity['dbType'] == 'postgres' ||
$serendipity['dbType'] == 'pdo-postgres') {
$group = '';
$distinct = 'DISTINCT';
} else {
@ -613,7 +614,8 @@ function &serendipity_fetchCategories($authorid = null, $name = null, $order = n
$where .= " c.category_name = '" . serendipity_db_escape_string($name) . "'";
}
if ($serendipity['dbType'] == 'postgres') {
if ($serendipity['dbType'] == 'postgres' ||
$serendipity['dbType'] == 'pdo-postgres') {
$group = '';
$distinct = 'DISTINCT';
} else {
@ -702,7 +704,8 @@ function &serendipity_searchEntries($term, $limit = '') {
$term = serendipity_db_escape_string($term);
$cond = array();
if ($serendipity['dbType'] == 'postgres') {
if ($serendipity['dbType'] == 'postgres' ||
$serendipity['dbType'] == 'pdo-postgres') {
$group = '';
$distinct = 'DISTINCT';
$cond['find_part'] = "(title ILIKE '%$term%' OR body ILIKE '%$term%' OR extended ILIKE '%$term%')";