Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
/lib/ -> dtllib.php (source)
   1  <?php
   2  
   3  // This file is part of Moodle - http://moodle.org/
   4  //
   5  // Moodle is free software: you can redistribute it and/or modify
   6  // it under the terms of the GNU General Public License as published by
   7  // the Free Software Foundation, either version 3 of the License, or
   8  // (at your option) any later version.
   9  //
  10  // Moodle is distributed in the hope that it will be useful,
  11  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13  // GNU General Public License for more details.
  14  //
  15  // You should have received a copy of the GNU General Public License
  16  // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  17  
  18  
  19  /**
  20   * DTL == Database Transfer Library
  21   *
  22   * This library includes all the required functions used to handle
  23   * transfer of data from one database to another.
  24   *
  25   * @package    core
  26   * @subpackage dtl
  27   * @copyright  2008 Andrei Bautu
  28   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  29   */
  30  
  31  defined('MOODLE_INTERNAL') || die();
  32  
  33  // Require {@link ddllib.php}
  34  require_once($CFG->libdir.'/ddllib.php');
  35  // Require {@link database_exporter.php}
  36  require_once($CFG->libdir.'/dtl/database_exporter.php');
  37  // Require {@link xml_database_exporter.php}
  38  require_once($CFG->libdir.'/dtl/xml_database_exporter.php');
  39  // Require {@link file_xml_database_exporter.php}
  40  require_once($CFG->libdir.'/dtl/file_xml_database_exporter.php');
  41  // Require {@link string_xml_database_exporter.php}
  42  require_once($CFG->libdir.'/dtl/string_xml_database_exporter.php');
  43  // Require {@link database_mover.php}
  44  require_once($CFG->libdir.'/dtl/database_mover.php');
  45  // Require {@link database_importer.php}
  46  require_once($CFG->libdir.'/dtl/database_importer.php');
  47  // Require {@link xml_database_importer.php}
  48  require_once($CFG->libdir.'/dtl/xml_database_importer.php');
  49  // Require {@link file_xml_database_importer.php}
  50  require_once($CFG->libdir.'/dtl/file_xml_database_importer.php');
  51  // Require {@link string_xml_database_importer.php}
  52  require_once($CFG->libdir.'/dtl/string_xml_database_importer.php');
  53  
  54  /**
  55   * Exception class for db transfer
  56   * @see moodle_exception
  57   */
  58  class dbtransfer_exception extends moodle_exception {
  59      /**
  60       * @global object
  61       * @param string $errorcode
  62       * @param string $a
  63       * @param string $link
  64       * @param string $debuginfo
  65       */
  66      function __construct($errorcode, $a=null, $link='', $debuginfo=null) {
  67          global $CFG;
  68          if (empty($link)) {
  69              $link = "$CFG->wwwroot/$CFG->admin/";
  70          }
  71          parent::__construct($errorcode, 'core_dbtransfer', $link, $a, $debuginfo);
  72      }
  73  }
  74