|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00031 defined('MOODLE_INTERNAL') || die(); 00032 00033 require_once($CFG->libdir.'/dml/moodle_temptables.php'); 00034 00035 class oci_native_moodle_temptables extends moodle_temptables { 00036 00037 protected $unique_session_id; // To store unique_session_id. Needed for temp tables unique naming (upto 24cc) 00038 protected $counter; // To get incrementally different temptable names on each add_temptable() request 00039 00044 public function __construct($mdb, $unique_session_id) { 00045 $this->unique_session_id = $unique_session_id; 00046 $this->counter = 1; 00047 parent::__construct($mdb); 00048 } 00049 00065 public function add_temptable($tablename) { 00066 // TODO: throw exception if exists: if ($this->is_temptable... 00067 $this->temptables[$tablename] = $this->prefix . $this->unique_session_id . $this->counter; 00068 $this->counter++; 00069 } 00070 }