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