PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.18
ووسلام – همگام سازی ووکامرس و باسلام v1.10.18
1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 1.8.7 1.8.4 All 51 releases
sync-basalam / includes / Services / ApiServiceManager.php

ApiServiceManager.php in ووسلام – همگام سازی ووکامرس و باسلام 1.10.18, at includes/Services/ApiServiceManager.php

59 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SyncBasalam\Services;
4
5 use SyncBasalam\Services\Api\PostApiService;
6 use SyncBasalam\Services\Api\GetApiService;
7 use SyncBasalam\Services\Api\PatchApiService;
8 use SyncBasalam\Services\Api\PutApiService;
9 use SyncBasalam\Services\Api\DeleteApiService;
10 use SyncBasalam\Services\Api\FileUploadApiService;
11
12 defined('ABSPATH') || exit;
13
14 class ApiServiceManager
15 {
16 private $postService = null;
17 private $getService = null;
18 private $patchService = null;
19 private $putService = null;
20 private $deleteService = null;
21 private $fileUploadService = null;
22
23 public function post($url, $data, $headers = [])
24 {
25 if ($this->postService === null) $this->postService = new PostApiService();
26 return $this->postService->send($url, $data, $headers);
27 }
28
29 public function get($url, $headers = [])
30 {
31 if ($this->getService === null) $this->getService = new GetApiService();
32 return $this->getService->send($url, $headers);
33 }
34
35 public function patch($url, $data, $headers = [])
36 {
37 if ($this->patchService === null) $this->patchService = new PatchApiService();
38 return $this->patchService->send($url, $data, $headers);
39 }
40
41 public function put($url, $data, $headers = [])
42 {
43 if ($this->putService === null) $this->putService = new PutApiService();
44 return $this->putService->send($url, $data, $headers);
45 }
46
47 public function delete($url, $headers = [], $data = null)
48 {
49 if ($this->deleteService === null) $this->deleteService = new DeleteApiService();
50 return $this->deleteService->send($url, $headers, (array) $data);
51 }
52
53 public function upload($url, $localFile, $data = [], $headers = [], $options = [])
54 {
55 if ($this->fileUploadService === null) $this->fileUploadService = new FileUploadApiService();
56 return $this->fileUploadService->upload($url, $localFile, $data, $headers, $options);
57 }
58 }
59