Download the PHP package brtriver/karen without Composer

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

Karen -- PSR-7 micro framework with PHP7

Karen is a simple PSR-7 micro framework with PHP7. This framework provide these names of blocks and simple Controller class:

You have only to write a code in your way with PSR-7 objects.

Karen uses following components by default :

Requirements

Install

Demo

and open http://localhost:8888/hello/karen_girls in your browser. If try FastRoute version, open http://localhost:8888/karen2/hello/karen_girls

Usage

see web/index.php.

You have to write your logic of a controller with anonymous function:

If you write your application class and write logic there instead of anonymous class, it is to be a simple one:

$args is arguments from routing path, and $controller is a instance of Karen\Controller class.

Karen\Controller has a render method. this is equal to $controller->response->getBody()->write($output).

Extends Controller

For example, you want to render without a template engine:

And if you want to use a template engine like Twig, you have only to write with anonymous class and trait:

Create your own framework

This microframework application is a simple template method pattern.

this abstract application knows about Request, Response, MiddlewareBulder(relay), so you have to write your application logic in methods(container, middleware, route and response methods) of your extends application class. these methods are executed by run() method.

method

container

create your container and set necessary object in your container:

Karen use pimple, but you can change it.

middleware (option)

Middleware method is to add your middleware through $this->addQueue() method as needed. Karen use (Relay)[http://relayphp.com/], so you have to pass callabe following signature:

This is a sample to change status by query parameter(status):

route

Route method is to define you application routes and controller logics:

or if you use anonymous class, you can your logic to this class:

If you change Aura.Route to another, read src/Framework/Karen2.php

response

In response method, you have to pass your controller callable handler to $this->addQueue('action', $handler, $args). it is different how to get $handler, because it depends on your selected router library.

After execute this response method, queue in middleware are executed automatically.

If you want to use JsonResponse:

Your Own Framework

Within this pattern, you have only to implement your framework logic in these methods.

For example, Karen2 is a sample microframework with FastRoute instead of Aura.Router but you have only to call same methods. see code web/karen2/index.php and src/Framework/Karen2.php

Feel free to create your own framework for PHP7.

License

Karen is licensed under the MIT license.


All versions of karen with dependencies

PHP Build Version
Package Version
Requires zendframework/zend-diactoros Version ^1.3
relay/relay Version ^1.0
aura/router Version ^3.0
twig/twig Version ^1.23
pimple/pimple Version ^3.0
nikic/fast-route Version ^0.7.0
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 brtriver/karen contains the following files

Loading the files please wait ....