2009-05-26 09:40:16 +00:00
|
|
|
<?php
|
2008-08-30 18:54:57 +00:00
|
|
|
|
2009-06-12 08:50:50 +00:00
|
|
|
// This file is part of Moodle - http://moodle.org/
|
|
|
|
//
|
2009-05-26 09:40:16 +00:00
|
|
|
// Moodle is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Moodle is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2009-06-12 08:50:50 +00:00
|
|
|
//
|
2009-05-26 09:40:16 +00:00
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
2008-08-30 18:54:57 +00:00
|
|
|
|
2009-06-12 08:50:50 +00:00
|
|
|
|
2009-05-26 09:40:16 +00:00
|
|
|
/**
|
MDL-29029 move dbtransfer to admin tools
AMOS BEGIN
CPY [dbexport,core_dbtransfer],[pluginname,tool_dbtransfer]
MOV [dbexport,core_dbtransfer],[dbexport,tool_dbtransfer]
MOV [dbtransfer,core_dbtransfer],[dbtransfer,tool_dbtransfer]
MOV [exportdata,core_dbtransfer],[exportdata,tool_dbtransfer]
MOV [notargetconectexception,core_dbtransfer],[notargetconectexception,tool_dbtransfer]
MOV [pluginname,core_dbtransfer],[pluginname,tool_dbtransfer]
MOV [transferdata,core_dbtransfer],[transferdata,tool_dbtransfer]
MOV [transferdbintro,core_dbtransfer],[transferdbintro,tool_dbtransfer]
MOV [transferdbtoserver,core_dbtransfer],[transferdbtoserver,tool_dbtransfer]
MOV [transferringdbto,core_dbtransfer],[transferringdbto,tool_dbtransfer]
AMOS END
2011-09-17 22:24:12 +02:00
|
|
|
* DTL == Database Transfer Library
|
2009-05-26 09:40:16 +00:00
|
|
|
*
|
|
|
|
* This library includes all the required functions used to handle
|
|
|
|
* transfer of data from one database to another.
|
2009-06-12 08:50:50 +00:00
|
|
|
*
|
2010-07-25 13:35:05 +00:00
|
|
|
* @package core
|
|
|
|
* @subpackage dtl
|
2009-06-12 08:50:50 +00:00
|
|
|
* @copyright 2008 Andrei Bautu
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
2009-05-26 09:40:16 +00:00
|
|
|
*/
|
2008-08-30 18:54:57 +00:00
|
|
|
|
2010-07-25 13:35:05 +00:00
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link ddllib.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/ddllib.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link database_exporter.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/database_exporter.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link xml_database_exporter.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/xml_database_exporter.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link file_xml_database_exporter.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/file_xml_database_exporter.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link string_xml_database_exporter.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/string_xml_database_exporter.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link database_mover.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/database_mover.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link database_importer.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/database_importer.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link xml_database_importer.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/xml_database_importer.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link file_xml_database_importer.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/file_xml_database_importer.php');
|
2009-06-12 08:50:50 +00:00
|
|
|
// Require {@link string_xml_database_importer.php}
|
2008-08-30 18:54:57 +00:00
|
|
|
require_once($CFG->libdir.'/dtl/string_xml_database_importer.php');
|
|
|
|
|
|
|
|
/**
|
2008-09-02 21:20:45 +00:00
|
|
|
* Exception class for db transfer
|
2008-08-30 18:54:57 +00:00
|
|
|
* @see moodle_exception
|
|
|
|
*/
|
2008-09-02 21:20:45 +00:00
|
|
|
class dbtransfer_exception extends moodle_exception {
|
2009-05-26 09:40:16 +00:00
|
|
|
/**
|
|
|
|
* @global object
|
|
|
|
* @param string $errorcode
|
|
|
|
* @param string $a
|
|
|
|
* @param string $link
|
|
|
|
* @param string $debuginfo
|
|
|
|
*/
|
2008-09-02 21:20:45 +00:00
|
|
|
function __construct($errorcode, $a=null, $link='', $debuginfo=null) {
|
|
|
|
global $CFG;
|
|
|
|
if (empty($link)) {
|
|
|
|
$link = "$CFG->wwwroot/$CFG->admin/";
|
|
|
|
}
|
MDL-29029 move dbtransfer to admin tools
AMOS BEGIN
CPY [dbexport,core_dbtransfer],[pluginname,tool_dbtransfer]
MOV [dbexport,core_dbtransfer],[dbexport,tool_dbtransfer]
MOV [dbtransfer,core_dbtransfer],[dbtransfer,tool_dbtransfer]
MOV [exportdata,core_dbtransfer],[exportdata,tool_dbtransfer]
MOV [notargetconectexception,core_dbtransfer],[notargetconectexception,tool_dbtransfer]
MOV [pluginname,core_dbtransfer],[pluginname,tool_dbtransfer]
MOV [transferdata,core_dbtransfer],[transferdata,tool_dbtransfer]
MOV [transferdbintro,core_dbtransfer],[transferdbintro,tool_dbtransfer]
MOV [transferdbtoserver,core_dbtransfer],[transferdbtoserver,tool_dbtransfer]
MOV [transferringdbto,core_dbtransfer],[transferringdbto,tool_dbtransfer]
AMOS END
2011-09-17 22:24:12 +02:00
|
|
|
parent::__construct($errorcode, 'core_dbtransfer', $link, $a, $debuginfo);
|
2008-08-30 18:54:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|