| Server IP : 89.108.64.180 / Your IP : 216.73.216.208 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/жемчужина.online/wp-content/plugins/wp-reset/libs/pCloud-eu/ |
Upload File : |
<?php
namespace pCloud;
class Request {
private $credentialPath;
private $host;
function __construct() {
$this->credentialPath = Config::$credentialPath;
$this->host = Config::$host;
}
private function getGlobalParams() {
$globalParams = array();
$auth = Auth::getAuth($this->credentialPath);
return array_merge($auth, $globalParams);
}
private function buildUrl($method, $params = null) {
$url = $this->host.$method;
if (!is_null($params)) {
$url .= "?".http_build_query($params);
}
return $url;
}
private function buildCurl($url) {
$curl = new Config::$curllib($url);
$curl->set(CURLOPT_USERAGENT, "pCloud PHP SDK");
$curl->set(CURLOPT_SSL_VERIFYPEER, false);
$curl->set(CURLOPT_RETURNTRANSFER, true);
return $curl;
}
public function get($method, $params = array()) {
$globalParams = $this->getGlobalParams();
$url = $this->buildUrl($method, array_merge($globalParams, $params));
$curl = $this->buildCurl($url);
return $curl->exec();
}
public function post($method, $params = array()) {
$globalParams = $this->getGlobalParams();
$url = $this->buildUrl($method, $globalParams);
$curl = $this->buildCurl($url);
$curl->set(CURLOPT_CUSTOMREQUEST, "POST");
$curl->set(CURLOPT_POSTFIELDS, $params);
return $curl->exec();
}
public function put($method, $params = array(), $content = '') {
$globalParams = $this->getGlobalParams();
$url = $this->buildUrl($method, array_merge($globalParams, $params));
$curl = $this->buildCurl($url);
$curl->set(CURLOPT_CUSTOMREQUEST, "PUT");
$curl->set(CURLOPT_POSTFIELDS, $content);
$curl->set(CURLOPT_HTTPHEADER, array("Content-Type: text/html"));
$curl->set(CURLOPT_BINARYTRANSFER, true);
return $curl->exec();
}
}