Download the PHP package codeeverything/planck-framework without Composer

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

Planck

A small framework for RESTful PHP apps

An experiment in writing a [small] RESTful framework for PHP. Makes use of the Burlap container for dependencies.

Named for the Planck time and length - the smallest measurements of time and length, respectively, that have any meaning.

NB: This is an ongoing project in its infancy, so expect much to be missing and much not to work ;)

Open Source

This is an open source effort, and although its only a pet project of mine contributions are welcome! So fork and PR away :)

Feel free to add issues to leave suggestions and comments.

Take a look at LICENSE.md for more info (MIT).

Writing a simple app

Planck is designed to be minimal and to help you quickly get working with RESTful responses.

The routing of RESTful requests is still the responsibility of your router and routes, but with the default Junction router that's easy to achieve.

App structure

All your application code will live in the folder, with the exception of any routes, services or listeners you define.

Planck expects only two things in order to get you up and running:

For example:

Controllers in Planck are the entry and exit points for your business logic. Since we're concerned with RESTful applications we expect a controller to return some data, which can be done in two ways:

Responses

Planck's default behaviour is to return responses as JSON, but this can be changed by using one of the other built in , or rolling your own.

Keeping it RESTful

Planck includes a which you can extend to get access to some useful convenience methods - for example:

The RESTController also includes a handy callback which will sniff your request method and try to set approriate codes and body content for you. For example:

If these don't suit your needs you can currently override the behavior by having an empty (or custom) function in your controller. In future I aim to make the process more flexible.

Throw RESTful errors

If there's an error condition in your app (the record with $id doesn't exist for example), throw an exception to capture this and return an appropriate HTTP coded message, all wrapped up in a nice neat package.

Planck includes exceptions for the most common RESTful error responses, covering:

Errors are returned in a neat package, handled by defining a service with the name , which returns a function accepting a single argument - the exception that has been thrown.

The default package is an array with items for "error" and "code", showing the exception message and HTTP status code respectively. You can change this to be whatever you want simply be redefining the service.

Services and Dependency Injection

Planck is agnostic about the container you use, though it does expect it to implement the Container Interoperability Interface.

By default Planck uses the lightweight Burlap container.

A controller's dependencies are drawn from the container, and can be injected by simply referencing container services as the arguments for the controller's function, e.g.:

Listeners

Planck implements a simple event system, which you can extend with your own app specific events.

Event listeners are defined in the file, and by convention Planck expects these to live in the folder, but this is up to you.

An example listener
Example of "emitting" (triggering) an event

TODO

An ever changing list of things to look at! :)


All versions of planck-framework 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 codeeverything/planck-framework contains the following files

Loading the files please wait ....