Package Data | |
---|---|
Maintainer Username: | LightAir |
Maintainer Contact: | public@softroot.ru (LightAir) |
Package Create Date: | 2016-12-28 |
Package Last Update: | 2020-12-15 |
Home Page: | https://packagist.org/packages/lightair/easycurl |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-04-18 15:15:16 |
Package Statistics | |
---|---|
Total Downloads: | 89 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
EasyCurl, it a easy CURL wrapper for PHP.
composer require lightair/easycurl
use LightAir\EasyCurl\EasyCurl;
$easyCurl = new EasyCurl('http://yandex.ru');
$result = $easyCurl->get();
In file bootstrap/app.php uncomment $app->withFacades();
and add:
$app->register(LightAir\EasyCurl\EasyCurlServiceProvider::class);
if (!class_exists('ECurl')) {
class_alias(LightAir\EasyCurl\EasyCurlFacade::class, 'ECurl');
}
$result = \ECurl::get([], 'http://yandex.ru');
dd($result, \ECurl::getHttpStatusCode());
Register the service provider.
'providers' => [
// Other service providers...
LightAir\EasyCurl\EasyCurlServiceProvider::class
],
Add aliase
'providers' => [
// Other aliases...
'ECurl' => \LightAir\EasyCurl\EasyCurlFacade::class,
],
Publish the config file
php artisan vendor:publish --provider="LightAir\EasyCurl\EasyCurlServiceProvider"
And use
$result = ECurl::get([], 'http://yandex.ru');
dd($result, ECurl::getHttpStatusCode());
./tests-run.sh