Download the PHP package fightbulc/php_curl without Composer

On this page you can find all versions of the php package fightbulc/php_curl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php_curl

PHP_CURL

PHP_CURL is an object-oriented implementation of the PHP's functional CURL interface.

Basic Usage

Since PHP_CURL allows for method-chaining, the static init method is used to generate an instance of a CURL object (similar to curl_init).

We can then set some CURL options:

All set... functions return an instance of the current CURL object, so you are free to set as many of the options in a row as necessary before executing.

All of the functions are close matches to the CURLOPT_* alternatives.

Comparison to functional cURL

The basic example given in the PHP manual for functional cURL is as follows:

We can perform the same operation with PHP_CURL like so:

There isn't much of a difference in terms of code-size or performance, however, the PHP_CURL approach is arguably more readible, and less repeatitive.

One major benefit to using this approach is that it enables us to take advantage of PHP editors with auto-completion, so setting multiple cURL options should be somewhat easier.

Issues

At present, there is no support for curl_multi.... Support for curl_multi... is coming soon.

Why do this?

I found that writing for CURL in PHP was repeatitive and cumbersome, and having a quick, object-oriented and more readable way of performing quick CURL tasks was something I've wanted for a while.

I don't claim to have done anything special here, nor do I propose that this should be used in any sort of production environment. It's quick and dirty, but it's working for me.

I strongly encoruage any sort of feedback, patches or contributions. I'd be more than happy to open up this project to more developers if there is any demand.

FAQ

Q. Why CURL::init() instead of new CURL()?

A. If you want to take advantage of method-chaining, use CURL::init, since PHP's constructors don't allow for things like (new Curl())->foo().

However, if you prefer to instanciate an object and then use that object, support for $foo = new CURL() is allowed. Both will work.

Q. Couldn't you have just done this with a single __call() wrapper, or use __get() and __set()?

This is true, however, a design decision was made to expand all the possible functions to get... and set... functions individually. This means that it's easier for a newcomer to the code to see clearly what methods are available. Not to mention that editors with auto-completion ability aren't often clever enough to discover magic method handling.

At the end of the day, whether it's handled using PHPDoc paramters and magic methods, or all methods are out there in plain sight, it doesn't make a difference either way, and I feel that if all methods are in plain sight, then there is little to no confusion as to what methods are available.


All versions of php_curl with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fightbulc/php_curl contains the following files

Loading the files please wait ....