MDL-86279 core: fix deprecation emitting/annotation in AWS helpers.
This commit is contained in:
@@ -27,7 +27,7 @@ require_once($CFG->dirroot . '/lib/adminlib.php');
|
||||
* @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.
|
||||
* @todo MDL-82459 Final deprecation in Moodle 6.0.
|
||||
*/
|
||||
class admin_settings_aws_region extends \admin_setting_configtext {
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ use Psr\Http\Message\RequestInterface;
|
||||
* @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.
|
||||
* @todo MDL-82459 Final deprecation in Moodle 6.0.
|
||||
*/
|
||||
class aws_helper {
|
||||
|
||||
@@ -37,12 +37,11 @@ class aws_helper {
|
||||
* @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(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation([static::class, __FUNCTION__]);
|
||||
global $CFG;
|
||||
$proxy = '';
|
||||
if (empty($CFG->proxytype)) {
|
||||
@@ -74,12 +73,11 @@ class aws_helper {
|
||||
* @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(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation([static::class, __FUNCTION__]);
|
||||
$client->getHandlerList()->appendBuild(self::add_proxy_when_required(), 'proxy_bypass');
|
||||
return $client;
|
||||
}
|
||||
@@ -91,12 +89,11 @@ class aws_helper {
|
||||
* @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(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation([static::class, __FUNCTION__]);
|
||||
return function (callable $fn) {
|
||||
return function (CommandInterface $command, ?RequestInterface $request = null) use ($fn) {
|
||||
if (isset($request)) {
|
||||
|
||||
@@ -24,7 +24,7 @@ use Aws\AwsClient;
|
||||
* @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.
|
||||
* @todo MDL-82459 Final deprecation in Moodle 6.0.
|
||||
*/
|
||||
class client_factory {
|
||||
/**
|
||||
@@ -36,12 +36,12 @@ class client_factory {
|
||||
* @deprecated Since Moodle 4.5
|
||||
*/
|
||||
#[\core\attribute\deprecated(
|
||||
'client_factory::get_client()',
|
||||
'aws_helper::configure_client_proxy()',
|
||||
since: '4.5',
|
||||
mdl: 'MDL-80962',
|
||||
)]
|
||||
public static function get_client(string $class, array $opts): AwsClient {
|
||||
\core\deprecation::emit_deprecation(__FUNCTION__);
|
||||
\core\deprecation::emit_deprecation([static::class, __FUNCTION__]);
|
||||
// Modify the opts to add HTTP timeouts.
|
||||
if (empty($opts['http'])) {
|
||||
$opts['http'] = ['connect_timeout' => HOURSECS];
|
||||
|
||||
Reference in New Issue
Block a user