forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-81924 core: Remove unused AWS classes and tests
Originally implemented as MDL-80962.
- Loading branch information
1 parent
310f5f5
commit d5bdb07
Showing
7 changed files
with
58 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
issueNumber: MDL-80962 | ||
notes: | ||
core: | ||
- message: > | ||
The following classes are deprecated as they are handled by core_sms API and smsgateway_aws plugin: | ||
- admin_settings_aws_region (lib/classes/aws/admin_settings_aws_region.php) | ||
- aws_helper (lib/classes/aws/aws_helper.php) | ||
- client_factory (lib/classes/aws/client_factory.php) | ||
type: deprecated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
issueNumber: MDL-80962 | ||
notes: | ||
core: | ||
- message: > | ||
The following test classes are removed as their base classes are deprecated: | ||
- admin_settings_aws_region_test (lib/tests/aws/admin_settings_aws_region_test.php) | ||
- aws_helper_test (lib/tests/aws/aws_helper_test.php) | ||
type: removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,6 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Admin setting for AWS regions. | ||
* | ||
* @package core | ||
* @author Dmitrii Metelkin <[email protected]> | ||
* @copyright 2020 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace core\aws; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
@@ -35,6 +26,8 @@ | |
* @package core | ||
* @copyright 2020 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @deprecated Since Moodle 4.5 | ||
* @todo MDL-82459 Final deprecation in Moodle 5.0. | ||
*/ | ||
class admin_settings_aws_region extends \admin_setting_configtext { | ||
|
||
|
@@ -44,8 +37,15 @@ class admin_settings_aws_region extends \admin_setting_configtext { | |
* @param mixed $data array or string depending on setting | ||
* @param string $query | ||
* @return string | ||
* @deprecated Since Moodle 4.5 | ||
*/ | ||
#[\core\attribute\deprecated( | ||
'admin_settings_aws_region::output_html()', | ||
since: '4.5', | ||
mdl: 'MDL-80962', | ||
)] | ||
public function output_html($data, $query='') { | ||
\core\deprecation::emit_deprecation_if_present([$this, __FUNCTION__]); | ||
global $CFG, $OUTPUT; | ||
|
||
$default = $this->get_defaultsetting(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,6 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* AWS helper class. Contains useful functions when interacting with the SDK. | ||
* | ||
* @package core | ||
* @author Peter Burnett <[email protected]> | ||
* @copyright 2020 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace core\aws; | ||
|
||
use Aws\CommandInterface; | ||
|
@@ -34,15 +25,24 @@ | |
* | ||
* @copyright 2020 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @deprecated Since Moodle 4.5 | ||
* @todo MDL-82459 Final deprecation in Moodle 5.0. | ||
*/ | ||
class aws_helper { | ||
|
||
/** | ||
* This creates a proxy string suitable for use with the AWS SDK. | ||
* | ||
* @return string the string to use for proxy settings. | ||
* @deprecated Since Moodle 4.5 | ||
*/ | ||
#[\core\attribute\deprecated( | ||
'aws_helper::get_proxy_string()', | ||
since: '4.5', | ||
mdl: 'MDL-80962', | ||
)] | ||
public static function get_proxy_string(): string { | ||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__); | ||
global $CFG; | ||
$proxy = ''; | ||
if (empty($CFG->proxytype)) { | ||
|
@@ -71,8 +71,15 @@ public static function get_proxy_string(): string { | |
* | ||
* @param AwsClient $client | ||
* @return AwsClient | ||
* @deprecated Since Moodle 4.5 | ||
*/ | ||
#[\core\attribute\deprecated( | ||
'aws_helper::configure_client_proxy()', | ||
since: '4.5', | ||
mdl: 'MDL-80962', | ||
)] | ||
public static function configure_client_proxy(AwsClient $client): AwsClient { | ||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__); | ||
$client->getHandlerList()->appendBuild(self::add_proxy_when_required(), 'proxy_bypass'); | ||
return $client; | ||
} | ||
|
@@ -81,8 +88,15 @@ public static function configure_client_proxy(AwsClient $client): AwsClient { | |
* Generate a middleware higher order function to wrap the handler and append proxy configuration based on target. | ||
* | ||
* @return callable Middleware high order callable. | ||
* @deprecated Since Moodle 4.5 | ||
*/ | ||
#[\core\attribute\deprecated( | ||
'aws_helper::add_proxy_when_required()', | ||
since: '4.5', | ||
mdl: 'MDL-80962', | ||
)] | ||
protected static function add_proxy_when_required(): callable { | ||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__); | ||
return function (callable $fn) { | ||
return function (CommandInterface $command, ?RequestInterface $request = null) use ($fn) { | ||
if (isset($request)) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,15 +14,6 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* AWS Client factory. Retrieves a client with moodle specific HTTP configuration. | ||
* | ||
* @package core | ||
* @author Peter Burnett <[email protected]> | ||
* @copyright 2022 Catalyst IT | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace core\aws; | ||
use Aws\AwsClient; | ||
|
||
|
@@ -32,6 +23,8 @@ | |
* @copyright 2022 Catalyst IT | ||
* @author Peter Burnett <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @deprecated Since Moodle 4.5 | ||
* @todo MDL-82459 Final deprecation in Moodle 5.0. | ||
*/ | ||
class client_factory { | ||
/** | ||
|
@@ -40,8 +33,15 @@ class client_factory { | |
* @param string $class Fully qualified AWS classname e.g. \Aws\S3\S3Client | ||
* @param array $opts array of constructor options for AWS Client. | ||
* @return AwsClient | ||
* @deprecated Since Moodle 4.5 | ||
*/ | ||
#[\core\attribute\deprecated( | ||
'client_factory::get_client()', | ||
since: '4.5', | ||
mdl: 'MDL-80962', | ||
)] | ||
public static function get_client(string $class, array $opts): AwsClient { | ||
\core\deprecation::emit_deprecation_if_present(__FUNCTION__); | ||
// Modify the opts to add HTTP timeouts. | ||
if (empty($opts['http'])) { | ||
$opts['http'] = ['connect_timeout' => HOURSECS]; | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.