4 * Copyright 2007 $ThePhpWikiProgrammingTeam
6 * This file is part of PhpWiki.
8 * PhpWiki is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * PhpWiki is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * @author: Reini Urban
26 require_once 'lib/WikiDB/backend/PDO.php';
28 class WikiDB_backend_PDO_oci8
29 extends WikiDB_backend_PDO
34 // Do nothing here -- Leave that for the DBA
35 // Cost Based Optimizer tuning vary from version to version
40 * Lock all tables we might use.
42 function _lock_tables($write_lock = true)
46 // Not sure if we really need to lock tables here, the Oracle row
47 // locking mechanism should be more than enough
48 // For the time being, lets stay on the safe side and lock...
50 // Next line is default behaviour, so just skip it
51 // $dbh->query("SET TRANSACTION READ WRITE");
52 foreach ($this->_table_names as $table) {
53 $dbh->exec("LOCK TABLE $table IN EXCLUSIVE MODE");
56 // Just ensure read consistency
57 $dbh->exec("SET TRANSACTION READ ONLY");
61 function backendType()
66 function write_accesslog(&$entry)
70 $log_tbl = $entry->_accesslog->logtable;
71 $sth = $dbh->prepare("INSERT INTO $log_tbl"
72 . " (time_stamp,remote_host,remote_user,request_method,request_line,request_args,"
73 . "request_file,request_uri,request_time,status,bytes_sent,referer,agent,request_duration)"
74 . " VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)");
75 // Either use unixtime as %d (long), or the native timestamp format.
76 $sth->bindParam(1, date('d-M-Y H:i:s', $entry->time));
77 $sth->bindParam(2, $entry->host, PDO_PARAM_STR, 100);
78 $sth->bindParam(3, $entry->user, PDO_PARAM_STR, 50);
79 $sth->bindParam(4, $entry->request_method, PDO_PARAM_STR, 10);
80 $sth->bindParam(5, $entry->request, PDO_PARAM_STR, 255);
81 $sth->bindParam(6, $entry->request_args, PDO_PARAM_STR, 255);
82 $sth->bindParam(7, $entry->request_uri, PDO_PARAM_STR, 255);
83 $sth->bindParam(8, $entry->_ncsa_time($entry->time), PDO_PARAM_STR, 28);
84 $sth->bindParam(9, $entry->time, PDO_PARAM_INT);
85 $sth->bindParam(10, $entry->status, PDO_PARAM_INT);
86 $sth->bindParam(11, $entry->size, PDO_PARAM_INT);
87 $sth->bindParam(12, $entry->referer, PDO_PARAM_STR, 255);
88 $sth->bindParam(13, $entry->user_agent, PDO_PARAM_STR, 255);
89 $sth->bindParam(14, $entry->duration, PDO_PARAM_FLOAT);
98 // c-hanging-comment-ender-p: nil
99 // indent-tabs-mode: nil