Download the PHP package casivaagustin/phrequests without Composer

On this page you can find all versions of the php package casivaagustin/phrequests. 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 phrequests

PHRequests

PHRequests is an API to make HTTP requests using Curl.

Is pronounced Free-Quests (original Idea by @mgi1982)

Why use PHRequests ?

Usage

If you need to make a Request to get the content of some Url using Curl a clasic code will look like this.

PHRequests wraps all this awful code to make our lives easier.

In order to make a GET Request you should do this

Yes, only that. Looks nice, take a look to a POST Request.

To make a POST you can do this

and that's all folks!

The Response object will hold the result of the request. Also it has a lot of important data of the request.

And more.

PHRequests uses the PSR-0 standard for class autoloading so you will need a compatible defined autoload function to start using by itself (versus inside a compatible framework like Symfony). You can find one such a function in the Tests\bootstrap.php file.

To see more samples, check the tests (until I write more documentation).

Proxy Support

If your are behind a proxy you need to define the Url of the proxy in order to make the Request. Here is an example.

If your proxy uses auth, try with this

HTTPS support

In order to make HTTPs Requests against a valid HTTPs Server. You need download and save the Certificate of the site, save it into a reachable folder. After, you need to define the option ssl_ca with the full path to the certificate in order to setup PHRequest. Here is an example.

If you don't set the PEM certificate, the HTTPs request will be made anyway but without a proper certificate validation, the connection will be still an SSL connection but can be a security issue accept any certificate without validation.

IMPORTANT : The certificate must be a PEM certificate.

Here you have more detailed explanation about HTTPs with curl.

http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/

Save Remote Files Locally

To get a remote file and save it locally you can do the following.

The file located in $urlSource, will be saved in $pathDest, using $options.

The request will be made with GET method.

IMPORTANT : The BAD usage of this feature can create security problems, please keep that in mind and be careful.

Supported methods.

Todo

How to run the tests

First install phpunit, i'm using PHPUnit 4.7.3 and I have installed using the phar file.

Go to the test folder, and just run

That will run all the tests.

I'm having troubles to write a good public tests to test the proxies functionality, need an open and public proxy to validate that works, that's why that test is disabled.

If you are going to work in the proxy features, please, set a proxy, enable the test and test it before commit.

Support

If you want a special feature or if you find a bug, please, let me know.

If you want to contribute to the project, also, please let me know :).


All versions of phrequests with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.1
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 casivaagustin/phrequests contains the following files

Loading the files please wait ....