inital commit

This commit is contained in:
2026-06-24 18:29:01 +06:00
commit f401802bf7
3918 changed files with 553085 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Utility;
class CurlRequest {
public function makeCurlRequest($params,$method,$URL,$header = ['Content-Type: application/json']){
$ch = curl_init();
if ($this->isNonSecureConnection()){
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
}
curl_setopt($ch, CURLOPT_URL, $URL);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
if(!empty($header)){
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 900);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
private function isNonSecureConnection(){
$host = $_SERVER['REMOTE_ADDR'];
$result = true;
/*if ($host != 'readytogoletters.com') {
$result = true;
}*/
return $result;
}
}