Skip to content
A easy CURL wrapper for PHP
PHP Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
art
examples
src
testing
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
README_RU.md
codecov.yml
composer.json
composer.lock
phpunit.xml
tests-run.sh

README.md

EasyCurl

EasyCurl, it a easy CURL wrapper for PHP.

Build Status license codecov Codacy Badge

Install

composer require lightair/easycurl

How to use (PHP)

use LightAir\EasyCurl\EasyCurl;

$easyCurl = new EasyCurl('http://yandex.ru');
$result = $easyCurl->get();

How to use (With Lumen)

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());

How to use (With Laravel)

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());

Run tests

./tests-run.sh
You can’t perform that action at this time.