Download the PHP package bfitech/zapcore without Composer

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

zapcore

A very simple PHP router and other utilities.

Latest Stable Version Latest Unstable Version Build Status Code Coverage GitHub license


0. Reason

but why?

Yeah, why another framework?

These are a few (hopefully good enough) reasons:

  1. web service-oriented

    zapcore and in general zap* packages are geared towards HTTP RESTful APIs with very little emphasis on traditional HTML document serving. If you are building the back end of a single page web application, you'll feel immediately at home.

  2. performance

    zapcore performance is guaranteed to be much faster than any popular batteries-included monolithic frameworks, and is at least on par with other microframeworks. TODO: Benchmark result.

  3. idiosyncracy

    This is just a fancy way of saying, "Because that's the way we like it."

1. Installation

Install it from Packagist:

2. Hello, World

Here's a bare-minimum index.php file:

Run it with PHP builtin web server and see it from your default browser:

3. Usage

3.0 Routing

Routing in zapcore is the responsibility of the method Router::route. Here's a simple route with /hello path, a regular function as the callback to handle the request data, applied to PUT request method.

which will produce:

We can use multiple methods for the same path:

Instead of letting globals floating around, we can use closure and inherited variable for the callback:

Callback can be a method instead of function:

And finally, you can subclass Router:

When request URI and request method do not match any route, a default 404 error page will be sent unless you configure shutdown to false (see below).

3.1 Dynamic Path

Apart from static path of the form /path/to/some/where, there are also two types of dynamic path built with enclosing pairs of symbols '<>' and '{}' that will capture matching strings from request URI and store them under $args['params']:

which will produce:

3.2 Request Headers

All request headers are available under $args['header']. These include custom headers:

which will produce:

NOTE: Custom request header keys will always be received in lower case, with all '-' changed into '_'.

3.3 Response Headers

You can send all kinds of response headers easily with the static method Header::header from the parent class:

which will produce:

For a more proper sequence of response headers, you can use Header::start_header static method:

which will produce:

3.4 Special Responses

There are wrappers specifically-tailored for error pages, redirect and static file serving:

which will produce:

3.5 Advanced

Router::config is a special method to finetune the router behavior, e.g.:

Available configuration items are:

4. Contributing

See CONTRIBUTING.md.

5. Documentation

If you have Doxygen installed, detailed generated documentation is available with:


All versions of zapcore with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0 <7.5
ext-curl Version *
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 bfitech/zapcore contains the following files

Loading the files please wait ....