Skip to content

Commit

Permalink
fix: add backwards compatibility layer for external_lib usage under M…
Browse files Browse the repository at this point in the history
…oodle 4.2
  • Loading branch information
keevan committed Jul 5, 2023
1 parent 857cdbf commit 6860e59
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 7 deletions.
31 changes: 31 additions & 0 deletions classes/external/external_api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?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/>.

namespace tool_dataflows\external;

// Moved as part of https://tracker.moodle.org/browse/MDL-78049 so this is
// required to redirect sites using older versions of Moodle to the previous
// implementation.
// Once the base supported version is 4.2, this is no longer required.
if (class_exists(\core_external\external_api::class) && !class_exists(\external_api::class)) {
class_alias(\core_external\external_api::class, \external_api::class);
}

/**
* Backwards compatibility class for underlying core's external_api
*/
class external_api extends \external_api {
}
2 changes: 1 addition & 1 deletion classes/external/trigger_dataflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @copyright Catalyst IT, 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class trigger_dataflow extends \external_api {
class trigger_dataflow extends external_api {

/**
* Returns description of method parameters
Expand Down
4 changes: 1 addition & 3 deletions classes/local/step/flow_web_service.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

namespace tool_dataflows\local\step;

defined('MOODLE_INTERNAL') || die();

use core_user;
use core\session\manager;
use core_external\external_api;
use tool_dataflows\external\external_api;
use moodle_exception;
use Symfony\Component\Yaml\Yaml;
use Throwable;
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2023063000;
$plugin->release = 2023063000;
$plugin->version = 2023070500;
$plugin->release = 2023070500;
$plugin->requires = 2017051500; // Our lowest supported Moodle (3.3.0).
$plugin->supported = [35, 401]; // Available as of Moodle 3.9.0 or later.
$plugin->supported = [35, 402]; // Available as of Moodle 3.9.0 or later.
// TODO $plugin->incompatible = ; // Available as of Moodle 3.9.0 or later.
$plugin->component = 'tool_dataflows';
$plugin->maturity = MATURITY_ALPHA;
Expand Down

0 comments on commit 6860e59

Please sign in to comment.