Skip to content

Commit

Permalink
Fix. Code. Request class dependency now support via Mloader.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glomberg committed Oct 17, 2024
1 parent 98fed87 commit 06d7114
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Cleantalk\Common\Api;

use Cleantalk\Common\Http\Request;
use Cleantalk\Common\Mloader\Mloader;

/**
* CleanTalk API class.
Expand Down Expand Up @@ -795,7 +795,9 @@ public static function sendRequest($data, $_url = self::URL, $timeout = 10, $ssl
// Possibility to switch API url
$url = defined('CLEANTALK_API_URL') ? CLEANTALK_API_URL : $_url;

$http = new Request();
/** @var \Cleantalk\Common\Http\Request $request_class */
$request_class = Mloader::get('Request');
$http = new $request_class();

return $http->setUrl($url)
->setData($data)
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"license": "GPL-3.0-or-later",
"require": {
"cleantalk/apbct-installer": "*",
"cleantalk/http": "*"
"cleantalk/http": "*",
'cleantalk/mloader': "*"
},
"config": {
"allow-plugins": {
Expand Down

0 comments on commit 06d7114

Please sign in to comment.