Answer the question
In order to leave comments, you need to log in
How to initialize a function via composer?
Created a simple library via composer with one function:
namespace ing;
function amocrmErrors ($getCode, $getMessage,$domen){
$data = array(
'getCode' => $getCode,
'getMessage' =>$getMessage,
'domen' => $domen
);
$url = 'любой урл';
$ch = curl_init($url);
$encodedData = $data;
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encodedData);
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('application/x-www-form-urlencoded'));
curl_exec($ch);
curl_close($ch);
}
{
"name": "ing/amolib",
"description": "lib",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "ing",
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"ing\\": "src"
}
},
"require-dev": {
"ing/amolib" : "dev-master"
},
"require": {
"php": ">=5.3.0"
}
}
amocrmErrors($getCode, $getMessage,$domen );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question