PHPackages                             alterrabr/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. alterrabr/comet

ActiveLibrary[Framework](/categories/framework)

alterrabr/comet
===============

Modern PHP framework for building blazing fast REST APIs and microservices

03PHP

Since Apr 30Pushed 2y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

 [![](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 improvments - 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 authorizathion services
- Hassle-free out-of-the-box integration with 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 use all the classes and methods of 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 tenfold advantage over Symfony and other popular frameworks.

### Latency

[](#latency)

How long it takes to get response from 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 charts are not 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 framework itself and all required dependencies. Comet requires PHP 7.2 or newer.

### Hello Comet

[](#hello-comet)

Create single app.php file at project root folder with content:

```
