Download the PHP package nyx-solutions/yii2-nyx-curl without Composer
On this page you can find all versions of the php package nyx-solutions/yii2-nyx-curl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii2-nyx-curl
Yii PHP Framework Version 2 / NYX cUrl
NYX cUrl is an object-oriented wrapper of the PHP cURL extension that makes it easy to send HTTP requests and integrate with web APIs. This build targets the Yii Framework version 2 and curretly does not adds any functionality to the main library (PHP Curl Class), but adds the \nyx\request\helpers\CurlHelper
which extends Yii2 Base URL Helper and implements methods to verify and manage URLs.
This extension uses the PHP Curl Class 7.* by Zach Borboa. For more details about the PHP Curl Class please refer to php-curl-class/php-curl-class or www.phpcurlclass.com.
Requirements
PHP 5.4+.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Basic Example
GET Example
POST Example
Basic Authentication with Error Handle Example
setOpt method Example
PUT Example
PATCH Example
DELETE Example
Download with GZIP Compression Example
\nyx\request\Curl Available Methods
\nyx\request\MultiCurl Available Methods
You can find more examples at https://github.com/php-curl-class/php-curl-class/tree/master/examples.
Security Considerations
Url may point to system files
- Don't blindly accept urls from users as they may point to system files. Curl supports many protocols including
FILE
. The following would show the contents offile:///etc/passwd
.
Safer:
Url may point to internal urls
- Url may point to internal urls including those behind a firewall (e.g. http://192.168.0.1/ or ftp://192.168.0.1/). Use a whitelist to allow certain urls rather than a blacklist.
Request data may refer to system files
- Request data prefixed with the
@
character may have special interpretation and read from system files.
Unsafe response with redirection enabled
- Requests with redirection enabled may return responses from unexpected sources. Downloading https://www.example.com/image.png may redirect and download https://www.evil.com/virus.exe
Keep SSL protections enabled.
- Do not disable SSL protections.
Based on the following document: https://github.com/php-curl-class/php-curl-class/tree/master/SECURITY.md.
License
yii2-nyx-curl is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.
To find more informations about the PHP Curl Class Licence, please refer to php-curl-class/php-curl-class.
All versions of yii2-nyx-curl with dependencies
nyx-solutions/yii2-nyx Version ~5.0.0
nyx-solutions/yii2-nyx-helpers Version ~5.0.0
php-curl-class/php-curl-class Version ~9.6.0