Skip to content

Instantly share code, notes, and snippets.

@FMCorz
Created November 26, 2015 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FMCorz/f0dbeab09074a0c0dfc3 to your computer and use it in GitHub Desktop.
Save FMCorz/f0dbeab09074a0c0dfc3 to your computer and use it in GitHub Desktop.
Admin tool backup/restore test using tool_uploadcourse. (Files should be in admin/tool/uploadcourse/backup/moodle/)
<?php
// This file is part of Moodle - http://moodle.org/
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Backup test file.
*
* @package tool_uploadcourse
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/backup/moodle2/backup_tool_plugin.class.php');
/**
* Backup test class.
*
* @package tool_uploadcourse
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_tool_uploadcourse_plugin extends backup_tool_plugin {
protected function define_course_plugin_structure() {
$this->step->log('Yay, backup!', backup::LOG_DEBUG);
return $plugin;
}
}
<?php
// This file is part of Moodle - http://moodle.org/
//
// 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.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Restore test file.
*
* @package tool_uploadcourse
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/backup/moodle2/restore_tool_plugin.class.php');
/**
* Restore test class.
*
* @package tool_uploadcourse
* @copyright 2015 Frédéric Massart - FMCorz.net
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class restore_tool_uploadcourse_plugin extends restore_tool_plugin {
protected function define_course_plugin_structure() {
$paths = array();
$this->step->log('Yay, restore!', backup::LOG_DEBUG);
return $paths;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment