mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
![[Peter Burnett]](/assets/img/avatar_default.png)
* Plugins can now explicitly declare supported and incompatible Moodle versions in version.php - $plugin->supported[37,39]; supported takes an array of ascending numbers, that correspond to a range of branch numbers of supported versions, inclusive. Moodle versions that are outside of this range will produce a message notifying at install time, but will allow for installation. - $plugin->incompatible = 36; incompatible takes a single int corresponding to the first incompatible branch. Any Moodle versions including and below this will be prevented from installing the plugin, and a message will be given when attempting installation.
51 lines
1.7 KiB
PHP
51 lines
1.7 KiB
PHP
<?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/>.
|
|
|
|
/**
|
|
* Provides testable_plugininfo_base class.
|
|
*
|
|
* @package core
|
|
* @category test
|
|
* @copyright 2015 David Mudrak <david@moodle.com>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
|
|
defined('MOODLE_INTERNAL') || die();
|
|
|
|
/**
|
|
* Testable plugininfo subclass representing a fake plugin type instance.
|
|
*
|
|
* @copyright 2015 David Mudrak <david@moodle.com>
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
*/
|
|
class testable_plugininfo_base extends \core\plugininfo\base {
|
|
|
|
public static function fake_plugin_instance($type, $typerootdir, $name, $namerootdir, $typeclass, $pluginman) {
|
|
return self::make_plugin_instance($type, $typerootdir, $name, $namerootdir, $typeclass, $pluginman);
|
|
}
|
|
|
|
public function init_display_name() {
|
|
$this->displayname = 'Testable fake pluginfo instance';
|
|
}
|
|
|
|
public function load_db_version() {
|
|
$this->versiondb = null;
|
|
}
|
|
|
|
public function init_is_standard() {
|
|
$this->source = core_plugin_manager::PLUGIN_SOURCE_EXTENSION;
|
|
}
|
|
}
|