Skip to content

Commit

Permalink
remove local_aws dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
rdebleu committed Aug 16, 2024
1 parent cebdb26 commit 44f35fe
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 38 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
moodle-branch: [main]
php: [8.1]
php: [8.2]
database: [mysqli]

name: ${{ matrix.moodle-branch }} php ${{ matrix.php }} ${{ matrix.database }}
Expand All @@ -23,12 +23,6 @@ jobs:
with:
path: this-plugin

- name: add plugin
uses: actions/checkout@v4
with:
repository: ewallah/moodle-local_aws
path: extras/local_aws

- name: setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -43,9 +37,10 @@ jobs:
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
sudo systemctl start mysql.service
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- name: install Moodle
run: moodle-plugin-ci install --db-user=root --db-pass=root --db-host=127.0.0.1 --plugin this-plugin --extra-plugins=extras
run: moodle-plugin-ci install --db-user=root --db-pass=root --db-host=127.0.0.1 --plugin this-plugin
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
Expand Down
16 changes: 4 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ jobs:
strategy:
fail-fast: false
matrix:
moodle-branch: [MOODLE_402_STABLE, MOODLE_403_STABLE]
php: [8.1]
moodle-branch: [MOODLE_404]
php: [8.2]
database: [mariadb, pgsql]
include:
- php: 8.2
moodle-branch: MOODLE_404_STABLE
database: pgsql
- php: 8.3
moodle-branch: main
database: pgsql
Expand All @@ -47,12 +44,6 @@ jobs:
with:
path: this-plugin

- name: add plugin
uses: actions/checkout@v4
with:
repository: ewallah/moodle-local_aws
path: extras/local_aws

- name: setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -66,9 +57,10 @@ jobs:
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
- name: install Moodle
run: moodle-plugin-ci --ansi install --db-host=127.0.0.1 --plugin this-plugin --extra-plugins=extras
run: moodle-plugin-ci --ansi install --db-host=127.0.0.1 --plugin this-plugin
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,9 @@ possible to give teachers and managers access to a specific S3 folder (bucket).
Multiple instances are supported, you only have to create a IAM user who has read access
to your S3 root folder, but read and write permissions to your S3 bucket.

## Dependencies

* Currently this plugin is using a custumized [Amazon's SDK for PHP plugin](https://github.com/ewallah/moodle-local_aws.git).

## Warning

* This plugin is 100% open source and has NOT been tested in Moodle Workplace, Totara, or any other proprietary software system. As long as the latter do not reward plugin developers, you can use this plugin only in 100% open source environments.
* This plugin is NOT compatible with the original [Amazon's SDK for PHP plugin](https://moodle.org/plugins/local_aws). If you use the original SDK, your site will become unavailable.
* Encrypted files or buckets are not supported.

## Theme support
Expand Down
3 changes: 1 addition & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

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

/**
* This is a repository class used to browse a Amazon S3 bucket.
Expand Down Expand Up @@ -318,7 +317,7 @@ public static function instance_config_form($mform) {
$strrequired = get_string('required');
$textops = ['maxlength' => 255, 'size' => 50];
$endpointselect = [];
$all = require($CFG->dirroot . '/local/aws/sdk/Aws/data/endpoints.json.php');
$all = require($CFG->libdir . '/aws-sdk/src/data/endpoints.json.php');
$endpoints = $all['partitions'][0]['regions'];
foreach ($endpoints as $key => $value) {
$endpointselect[$key] = $value['description'];
Expand Down
6 changes: 0 additions & 6 deletions tests/mock_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@

namespace repository_s3bucket;

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

global $CFG;

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

use Aws\S3\Exception\S3Exception;
use Aws\S3\S3Client;

Expand Down
10 changes: 5 additions & 5 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@

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

$plugin->requires = 2023042400;
$plugin->requires = 2024042200;
$plugin->component = 'repository_s3bucket';
$plugin->maturity = MATURITY_STABLE;
$plugin->dependencies = ['repository_s3' => ANY_VERSION, 'local_aws' => 2024050800];
$plugin->release = 'v4.4.2';
$plugin->supported = [402, 404];
$plugin->version = 2024062800;
$plugin->dependencies = ['repository_s3' => ANY_VERSION];
$plugin->release = 'v4.4.3';
$plugin->supported = [404, 404];
$plugin->version = 2024081600;

0 comments on commit 44f35fe

Please sign in to comment.