Skip to content

Commit

Permalink
Support MOODLE 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Nguyen committed Nov 13, 2024
1 parent 99a74ec commit f86f5f9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 28 deletions.
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@ The following sections outline the steps that need to be followed to install the
## Supported Moodle Versions
This plugin currently supports Moodle:

* 3.4
* 3.5
* 3.6
* 3.7
* 3.8
* 3.9
* 3.10
* 3.11
| Moodle version | Branch |
-----------------|-------------------|
| Moodle 3.4+ | MOODLE_34_STABLE |
| Moodle 4.5+ | MOODLE_405_STABLE |

## Plugin Installation
The following steps will help you install this plugin into your Moodle instance.
Expand Down
5 changes: 2 additions & 3 deletions classes/converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@

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

require_once($CFG->dirroot . '/local/aws/sdk/aws-autoloader.php');

use \core_files\conversion;
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
use smsgateway_aws\helper;

/**
* Class for converting files between different formats using unoconv.
Expand Down Expand Up @@ -108,7 +107,7 @@ public function create_client($handler=null) {

// Check if we are using the Moodle proxy.
if ($this->config->useproxy) {
$connectionoptions['http'] = ['proxy' => \local_aws\local\aws_helper::get_proxy_string()];
$connectionoptions['http'] = ['proxy' => helper::get_proxy_string()];
}

// Allow handler overriding for testing.
Expand Down
7 changes: 3 additions & 4 deletions classes/provision.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@

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

require_once($CFG->dirroot . '/local/aws/sdk/aws-autoloader.php');

use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
use Aws\CloudFormation\CloudFormationClient;
use Aws\CloudFormation\Exception\CloudFormationException;
use Aws\Exception\AwsException;
use smsgateway_aws\helper;

/**
* Class for provisioning AWS resources.
Expand Down Expand Up @@ -173,7 +172,7 @@ protected function create_s3_client($handler=null) {

// Check if we are using the Moodle proxy.
if ($this->useproxy) {
$connectionoptions['http'] = ['proxy' => \local_aws\local\aws_helper::get_proxy_string()];
$connectionoptions['http'] = ['proxy' => helper::get_proxy_string()];
}

// Allow handler overriding for testing.
Expand Down Expand Up @@ -290,7 +289,7 @@ protected function create_cloudformation_client($handler=null) {

// Check if we are using the Moodle proxy.
if ($this->useproxy) {
$connectionoptions['http'] = ['proxy' => \local_aws\local\aws_helper::get_proxy_string()];
$connectionoptions['http'] = ['proxy' => helper::get_proxy_string()];
}

// Allow handler overriding for testing.
Expand Down
5 changes: 2 additions & 3 deletions classes/tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@

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

require_once($CFG->dirroot . '/local/aws/sdk/aws-autoloader.php');

use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
use Aws\Iam\Exception\IamException;
use smsgateway_aws\helper;

/**
* Class for provisioning AWS resources.
Expand Down Expand Up @@ -150,7 +149,7 @@ public function create_s3_client($handler=null) {

// Check if we are using the Moodle proxy.
if ($this->useproxy) {
$connectionoptions['http'] = ['proxy' => \local_aws\local\aws_helper::get_proxy_string()];
$connectionoptions['http'] = ['proxy' => helper::get_proxy_string()];
}

// Allow handler overriding for testing.
Expand Down
3 changes: 0 additions & 3 deletions tests/converter_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

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

global $CFG;
require_once($CFG->dirroot . '/local/aws/sdk/aws-autoloader.php');

use Aws\Result;
use Aws\MockHandler;
use Aws\CommandInterface;
Expand Down
3 changes: 0 additions & 3 deletions tests/events_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

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

global $CFG;
require_once($CFG->dirroot . '/local/aws/sdk/aws-autoloader.php');

use Aws\Result;
use Aws\MockHandler;
use Aws\CommandInterface;
Expand Down
3 changes: 0 additions & 3 deletions tests/provision_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

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

global $CFG;
require_once($CFG->dirroot . '/local/aws/sdk/aws-autoloader.php');

use Aws\MockHandler;
use Aws\Result;
use Aws\CommandInterface;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
$plugin->dependencies = array(
'local_aws' => 2023072100
);
$plugin->supported = [34, 401]; // A range of branch numbers of supported moodle versions.
$plugin->supported = [405, 405]; // A range of branch numbers of supported moodle versions.

0 comments on commit f86f5f9

Please sign in to comment.