Download the PHP package thinframe/karma without Composer

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

Karma

New generation of PHP frameworks

Latest Stable Version Latest Unstable Version License

What is the problem with the current generation?

To explain the current problem let me start with a simple description on how PHP websites work:

  1. A user makes a request from his browser to a certain website that is running using PHP

  2. The HTTP server accepts that request and handles it in different ways:

    • Apache executes the PHP script associated with the requested path directly and returns the output

    • Nginx uses PHP-FPM to do basically the same thing.
  3. The HTTP server sends the response back to the client

All good so far, but let's look a little bit deeper. When a PHP script is executed the followings things take place:

  1. The necessary dependencies are loaded, lazy or all at once, and all the components are configured/initialized.

  2. Your logic is executed depending on the request and a response is returned.

But there is a problem in this process, because one of those two steps is executed every single time. Oh well ...

Step 1 is executed for every single request, and from my point of view that is a bottleneck of PHP applications, since IO operations are very expensive.

Solutions that already exists

A new aproach ... ?

Tom & David Kelley, the authors of the book Creative Confidence and owners of the company IDEO, say in their book that the best solution to an existing problem is to rethink the whole process that causes that problem. But the problem in this case is by design. PHP was made this way, right ?

The solution

Some time ago, I came across ReactPHP, it is a PHP library that offers Event-driven, non-blocking I/O. It is inspired from NodeJS and it is awesome. I played with it, I did some tests and then an idea came to my mind:

Instead of using two programs to do one thing, the HTTP server and the PHP, why don't we use a single one that will act as both?

Basically, we merge the HTTP server, and the PHP framework that is behind the server, to make a single program written in PHP that will do both tasks. This way we will eliminate the recurrent loading/initialization time for PHP dependencies and also save some time that is lost between the HTTP server and PHP.

Painfull ? Not at all.

Karma

It is a PHP Application that acts as an HTTP server and a PHP framework, all at the same time. It provides an easy to use abstraction layer over anything that relates to socket work, so developers can focus on their work. It is fast, with a response time that is 80 to 90 percent faster than a conventional framework and it works with already existing PHP components, like Twig.

It provides built-in routing using Symfony Routing component and all the architecture is build around Symfony Dependency Injection Container. Most of the socket work is handled by the ReactPHP component. Basically, it is built with already existing PHP components.

Installation

composer create-project thinframe/karma-project <project_name> --stability=dev

If you want to use the command line component with completion support execute the following command in your project root:

bash bin/thinframe-installer

From this point on, you can use the thinframe command in each karma project folder that you have. Otherwise, you can use bin/thinframe instead of thinframe.

Usage

To see all available commands execute the following command: thinframe help. Pretty simple.

  help                   - Show this list

  server run             - Start the HTTP server

  server run --daemon    - Start the HTTP server as a daemon

  server stop            - Stop the HTTP server

  server status          - Check HTTP server status

  server restart         - Restart the HTTP server

  server monitor         - Restart the HTTP server when source files are changed

  debug routes           - Show all routes

  debug applications     - Show all loaded applications

The test the setup, run thinframe server start and in your browser go to http://localhost:1337. If you see a default Karma page, then everything works.

By default, when you install karma-project, it creates a bootstrap project. All project related files are located in src/Acme/DemoApp.

[to be continued ...]

TODO's

OS Support

So far it was tested on Ubuntu and Elementary OS. It should work on other Linux distributions pretty well.

Dependencies

Fair warning

This project is experimental. I recommend that it shouldn't be used on a production environment (yet).


All versions of karma with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
thinframe/foundation Version @stable
thinframe/events Version @stable
thinframe/applications Version @stable
thinframe/command_line Version @stable
thinframe/annotations Version @stable
thinframe/pcntl Version @stable
thinframe/server Version @stable
thinframe/inotify Version @stable
monolog/monolog Version @stable
symfony/routing Version @stable
filp/whoops Version dev-master
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 thinframe/karma contains the following files

Loading the files please wait ....