Download the PHP package caendesilva/pikoserve without Composer

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

🍦 Pikoserve - A truly tiny framework for PHP microservices

License MIT Class Size StyleCI Status

About

Pico is a unit prefix often used for something extremely tiny. Which is just what Pikoserve is! While it is designed for writing microservices in PHP calling it a microframework seems excessive.

Pikoserve came to be in this tweet: https://twitter.com/StressedDev/status/1512860967000059907

At its core, Pikoserve is a starter template for creating tiny stateless API services and is essentially a wrapper for writing and reading JSON responses and sending the proper headers all within a single tiny class.

Installation

Since it is so lightweight you can get started by just downloading the Piko.php file (or copying and pasting it), then reference it in a PHP file (usually index.php). If you want you can even use the Piko.php file as your index.php code, just place your own code under the Piko class. Though I prefer to keep it separate to reduce clutter.

To get started quickly, you can use Composer or Git.

Usage

Create an index.php file containing the Main class. Require the Piko.php file, and write your code in the Main class. Then call Piko::boot() with the Main class. Piko will then send the headers and execute the handle method and return a JSON Response.

Setting up a starter project

The only file you need is the Piko.php file, but to get started quickly you can use the starter project in the repo.

You can also use Composer to create a new Piko project. It is not available as a package, since if you are writing something that will be dependent on several packages you will probably need something more sophisticated than Piko anyway.

This will set you up with the Piko.php file which contains the Piko class, and an index.php file that references it. Speaking of, let's take a look at what it looks like.

Hello World Example

This is the index.php file that is shipped with Piko but is shown here again to break down how Piko works.

This is all you need to run Piko. Seriously.

Extending Piko

Since Piko is designed to be so minimal, it's up to you to add any functionality you may need.

However, Piko makes it easy to fluently add functionality by adding a callback to the boot method.

For example, if you want to add a custom error handler or a server log, you can do so by adding a callback to the boot method.

The callback is executed after the handle method, i.e. after the headers and JSON response are sent.

I had an idea that this can be used to load callback modules to easily share these kinds of callbacks. If you have any ideas for such micro-packages, please let me know your ideas!


All versions of pikoserve with dependencies

PHP Build Version
Package Version
No informations.
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 caendesilva/pikoserve contains the following files

Loading the files please wait ....