Download the PHP package modulework/http without Composer

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

HTTP Package

Latest Stable Version Build Status

The HTTP Package of the Modulework Framework.

It provides a convient way of handling HTTP request and HTTP response.

So for example you could already create a application with these two classes:

This will app will great every vistor with their name or if the vistor didn' t provide the name in the query string it will fallback to "Stranger".

Of course this is a very basic example but it can do a lot more!

We could expand this and save the name into a cookie:

Or check if the method is GET or POST, so a user could also POST it' s name:

Or display the client' s IP:

Now we also send a cookie a too the user. But we can do even more:

Chained methods! Custom Headers! Custom Status Codes! And much more!

The Response class is intelligent enough to set the status code, if a redirect is issued:

Will result in this header

But the Request class can do even more, we can use it for very basic routing:

This is very basic and not best practice, but it shows for what we can use this class for!

There are also some more Response classes, like the RedirectResponse and JsonResponse class.

Here is an usage example:

As you can see very easy to use. NOTE! This is just a wrapper for a normal Response. You could also do this:

The only thing what is not shown in the alternative way is the HTML meta redirect (in case the header doesn' t fire).

The JsonResponse class is pretty straight forward as well:

This would result in this response:

Pretty nifty, eeh!!?


All versions of http with dependencies

PHP Build Version
Package Version
Requires php Version >=5.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 modulework/http contains the following files

Loading the files please wait ....