PHPackages                             tncrazvan/catpaw - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. tncrazvan/catpaw

AbandonedLibrary[HTTP &amp; Networking](/categories/http)

tncrazvan/catpaw
================

The catpaw project

3.3.1(1y ago)2125411MITPHPPHP ^8.2CI passing

Since Nov 12Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/tncrazvan/CatPaw)[ Packagist](https://packagist.org/packages/tncrazvan/catpaw)[ RSS](/packages/tncrazvan-catpaw/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (15)Versions (198)Used By (1)

What is this?
=============

[](#what-is-this)

Catpaw is an opinionated dependency injection library that comes with batteries included for developing asynchronous and declarative general purpose programs.
It leverages the [amphp](https://github.com/amphp/amp) platform to make your program asynchronous.

Table of ContentsDescription📦 [Container](./docs/Container.md)Provide dependencies and retrieve them.📦 [Constructors](./docs/Constructors.md)Execute code when a dependency is resolved.📦 [Entry](./docs/Entry.md)Execute code when a dependency is resolved.⚠️ [Error Management](./docs/Error%20Management.md)Manage errors.🌠 [Server](./docs/Server.md)Start a server.🚆 [Server Router](./docs/Server%20Router.md)Define routes.📃 [Server Path Parameters](./docs/Server%20Path%20Parameters.md)Define path parameters for your routes.🎫 [Server Session](./docs/Server%20Session.md)Manage sessions.📞 [Server Websockets](./docs/Server%20Websockets.md)Serve websockets.💠 [Server Open Api](./docs/Server%20Open%20Api.md)Generate an Open Api definition.🎛️ [Command](./docs/Command.md)Create a console command.🗄️ [Database](./docs/Database.md)Connect to a database and send queries.🗄️ [Stores](./docs/Stores.md)Store data in memory and react to changes in said data.🚥 [Queues](./docs/Queues.md)Create in memory queues and tag them.🚥 [Signals](./docs/Signals.md)Create signals and react to them.🕐 [Schedule](./docs/Schedule.md)Schedule code execution using a human readable format.💡 [RaspberryPi](./docs/RaspberryPi.md)Control your RaspberryPi's GPIOs.Note

This project is aimed at linux distributions, some features may or not may work on Windows and/or MacOS.
Feel free to contribute fixing issues for specific platforms.

Prerequisites
=============

[](#prerequisites)

You will need at least [php 8.4](https://www.php.net/downloads.php), `ext-mbstring`, `ext-dom` and `inotify-tools` for [dev mode](#development-mode).
Although optional, I also recommend you install `ext-curl` to speed http requests in php.

```
sudo apt install php-mbstring  # this contains ext-mbstring
sudo apt install php-xml       # this contains ext-dom
sudo apt install php-curl      # this will speed up project creation and http requests in general
sudo apt install inotify-tools # this allows you to use watch mode (read below)
```

Get started
===========

[](#get-started)

Create a new project using one of the starter templates.

You can start from scratch

```
composer create-project catpaw/starter
```

or you can start with a web server

```
composer create-project catpaw/web-starter
```

Install Dependencies
====================

[](#install-dependencies)

```
make install
```

Program Structure
=================

[](#program-structure)

Every program must declare a `main` function in the global scope, that will be your entry point.

```
// src/main.php
use Psr\Log\LoggerInterface;
function main(LoggerInterface $logger){
  $logger->info("hello world");
}
```

You can run your program in one of three modes.

Development Mode
================

[](#development-mode)

Enter Development Mode with

```
make dev
```

This mode will run your program with [XDebug](https://xdebug.org) enabled and it will restart your program every time you make a change to your source code.

Note

See [section Debugging with VSCode](#debugging-with-vscode)

Note

By default "source code" means the "src/lib" directory.
You can change this configuration in your [makefile](./makefile), see section `dev`, flag `--libraries`.

Preview Mode
============

[](#preview-mode)

Enter Preview Mode with

```
make dev
```

This mode will run your program with [XDebug](https://xdebug.org) enabled.

Note

See [section Debugging with VSCode](#debugging-with-vscode)

Production Mode
===============

[](#production-mode)

Enter Production Mode with

```
make start
```

It's just as it sounds, run your program directly.
No debuggers, not extra overhead.

Build
=====

[](#build)

It is possible, but no required, to bundle your program into a single `.phar` file with

```
make build
```

The building process can be configured inside the `build.ini` file.

After building your application, you can simply run it using

```
php out/app.phar

```

The resulting `.phar` will include the following directories

- `src`
- `vendor`
- `.build-cache` (created at build time)

It's a portable bundle, you just need to make sure php is installed on whatever machine you're trying to run it on.

Debugging with VSCode
=====================

[](#debugging-with-vscode)

Install xdebug

```
sudo apt install php8.4-xdebug
```

Configure your `.vscode/launch.json`

```
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen",
            "type": "php",
            "request": "launch",
            "port": 9003
        }
    ]
}
```

Start debugging.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance65

Regular maintenance activity

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

197

Last Release

720d ago

Major Versions

1.0.22 → 2.0.02024-01-11

2.4.10 → 3.0.02024-05-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a17d8165898575f819668fa41fdb760fc139591b0f9161cf322c86a72409a8b?d=identicon)[loopcake](/maintainers/loopcake)

---

Top Contributors

[![razshare](https://avatars.githubusercontent.com/u/6891346?v=4)](https://github.com/razshare "razshare (1520 commits)")

---

Tags

httpphpasynccliserverdiamphpcatpaw

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tncrazvan-catpaw/health.svg)

```
[![Health](https://phpackages.com/badges/tncrazvan-catpaw/health.svg)](https://phpackages.com/packages/tncrazvan-catpaw)
```

###  Alternatives

[danog/madelineproto

Async PHP client API for the telegram MTProto protocol.

3.4k855.0k18](/packages/danog-madelineproto)[amphp/http-server

A non-blocking HTTP application server for PHP based on Amp.

1.3k4.5M81](/packages/amphp-http-server)[amphp/websocket-client

Async WebSocket client for PHP based on Amp.

1613.0M39](/packages/amphp-websocket-client)[amphp/websocket

Shared code for websocket servers and clients.

453.1M9](/packages/amphp-websocket)[amphp/websocket-server

Websocket server for Amp's HTTP server.

124265.1k20](/packages/amphp-websocket-server)[amphp/http-server-form-parser

An HTTP server plugin that simplifies form data handling. Effortlessly parse incoming form submissions and extracting its data.

1886.8k13](/packages/amphp-http-server-form-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
