Download the PHP
package spruce-bruce/curl without Composer
On this page you can find all versions of the php package
spruce-bruce/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.
This is a wrapper class for curl that I've developed as a Curl shorthand. There are other curl wrappers out there, but I was never really a fan of any of the ones I found.
In this class I implement static methods for the HTTP requests: get(), post(), delete(), and put().
Installation
You can just download the zip of this repo (or clone it) and include the Curl.php file. If you like composer I've added this repo to packagist and you can install by adding "spruce-bruce/composer" : "0.1.*" to your requirements.
Usage
Here are some fictional examples that show the use of Curl.php.
POST
Example POST:
GET
Example GET with additional curl options:
Default curl options
Each type of http request will have some default curl options set. Defaults cannot currently be changed. Defaults are determined by my experience using curl in the past, ie, they are the options that I will generally always set for a given HTTP request type.
POST
CURLOPT_RETURNTRANSFER
CURLOPT_POST
CURLOPT_POSTFIELDS (only if the $data param is set)
GET
CURLOPT_RETURNTRANSFER
DELETE
unimplemented
PUT
unimplemented
TODO
Implemente delete() and put() methods
Clean up HTTP code parsing and make it more robust (ie, add any messages in the response to the exception)
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 spruce-bruce/curl contains the following files
Loading the files please wait ....
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.