PHPackages                             gotzmann/comet - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. gotzmann/comet

ActiveLibrary[Framework](/categories/framework)

gotzmann/comet
==============

Modern PHP framework for building blazing fast REST APIs and microservices

v2.7.3(9mo ago)68816.2k↓50%52[4 issues](https://github.com/gotzmann/comet/issues)1MITPHP

Since May 8Pushed 9mo ago29 watchersCompare

[ Source](https://github.com/gotzmann/comet)[ Packagist](https://packagist.org/packages/gotzmann/comet)[ Docs](https://github.com/gotzmann/comet)[ RSS](/packages/gotzmann-comet/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (65)Used By (1)

 [![](docs/logo.png)](docs/logo.png)

Comet
=====

[](#comet)

Comet is a modern PHP framework for building blazing fast REST APIs, CRUDs, admin panels, and microservices.

What's new in Comet v2
----------------------

[](#whats-new-in-comet-v2)

- Performance improvements - up to 20-30% faster than first version!
- Embedded secure web-server to serve static content like images, CSS styles and JS scripts
- Extended session support for complex authentication and authorization services
- Hassle-free out-of-the-box integration with a full-featured auth library

Superpowers at your disposal
----------------------------

[](#superpowers-at-your-disposal)

- Blazing fast with 100K HTTP requests per second and ~0.1 ms latency on commodity cloud hardware
- Really cross-platform, works like a charm on Linux, MacOS and Windows 7/10
- Embedded web-server to serve static content like CSS/JS and images
- Integration with full-featured auth library [Comet\\Auth](https://github.com/gotzmann/auth) for users management
- Embedded validation and testing features you could use with easy to create robust software
- Based on bullet-proof components from Guzzle, SlimPHP and Workerman
- Extendable with Composer: use ORM and templating engine of your choice (Eloquent and Twig are recommended)
- PSR compliant with native implementations of all PSR-7 interfaces and PHP sessions abstraction
- Has its own efficient HTTP client with simple programming interface

Standing on the shoulders of giants
-----------------------------------

[](#standing-on-the-shoulders-of-giants)

Comet combines all superpowers of Slim PHP, Guzzle and Workerman and mix its own magic to achieve 10x speed up.

[Slim](https://github.com/slimphp/Slim) is a micro-framework that helps write web applications and APIs based on modern PSR standards.

[Guzzle](https://github.com/guzzle) is a set of PHP components to work with HTTP/1.1 and HTTP/2 services.

[Workerman](https://github.com/walkor/Workerman) is an asynchronous event-driven framework to build fast and scalable network applications.

Comet allows you natively to use all the classes and methods of the Slim framework:

### Performance

[](#performance)

PHP is often criticized for its low throughput and high latency, but that is not necessarily true for modern frameworks. Let's see how Comet outperforms others.

 [![](docs/performance-1000.jpg)](docs/performance-1000.jpg)

#####  Benchmarking stripped versions of frameworks with no ORM under 1,000 concurrent connections

[](#--benchmarking-stripped-versions-of-frameworks-with-no-orm-under-1000-concurrent-connections)

As you can see, the right architecture provides it with a tenfold advantage over Symfony and other popular frameworks.

### Latency

[](#latency)

How long it takes to get a response from an API often is even more important than overall service throughput. And that is where Comet really shines.

 [![](docs/latency-1.jpg)](docs/latency-1.jpg)

#####  Response latency of minimal versions of popular PHP frameworks under series of serial web requests

[](#--response-latency-of-minimal-versions-of-popular-php-frameworks-under-series-of-serial-web-requests)

Comet provides sub-millisecond latency for typical scenarios. Even under hard pressure of thousand concurrent connections it can compete with frameworks of compiled platforms like Go and Java.

### Too good to be true?

[](#too-good-to-be-true)

You may run all benchmarks on your own to be sure that the charts are not a scam:

Basics
------

[](#basics)

### Installation

[](#installation)

It is recommended that you use [Composer](https://getcomposer.org/) to install Comet.

```
$ composer require gotzmann/comet
```

This will install the framework itself and all required dependencies. Comet requires PHP 7.2 or newer.

### Hello Comet

[](#hello-comet)

Create a single app.php file in the project root folder with the following content:

```
