{"id":19895413,"url":"https://github.com/razshare/catpaw","last_synced_at":"2026-01-11T16:30:15.918Z","repository":{"id":37608777,"uuid":"443791807","full_name":"razshare/catpaw","owner":"razshare","description":"An opinionated dependency injection library for amphp.","archived":false,"fork":false,"pushed_at":"2025-04-19T08:43:06.000Z","size":57436,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T10:52:54.562Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/tncrazvan/catpaw","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/razshare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-02T14:52:38.000Z","updated_at":"2025-04-19T08:42:49.000Z","dependencies_parsed_at":"2024-02-24T18:23:06.179Z","dependency_job_id":"f4667383-f8e1-48a1-84dc-755a30e228b9","html_url":"https://github.com/razshare/catpaw","commit_stats":{"total_commits":1031,"total_committers":3,"mean_commits":343.6666666666667,"dds":"0.012609117361784716","last_synced_commit":"8f535b335722121ec980e475a2e1ef58f92e2cdd"},"previous_names":["tncrazvan/catpaw","tncrazvan/catpaw-core","razshare/catpaw"],"tags_count":781,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fcatpaw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fcatpaw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fcatpaw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fcatpaw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razshare","download_url":"https://codeload.github.com/razshare/catpaw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252104029,"owners_count":21695403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T18:36:36.212Z","updated_at":"2026-01-11T16:30:15.912Z","avatar_url":"https://github.com/razshare.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\n\nCatpaw is an opinionated dependency injection library that comes with batteries included for developing asynchronous and declarative general purpose programs.\\\nIt leverages the [amphp](https://github.com/amphp/amp) platform to make your program asynchronous.\n\n\n| Table of Contents                                                 | Description |\n|-------------------------------------------------------------------|-------------|\n| 📦 [Container](./docs/Container.md)                               | Provide dependencies and retrieve them. |\n| 📦 [Constructors](./docs/Constructors.md)                                       | Execute code when a dependency is resolved. |\n| 📦 [Entry](./docs/Entry.md)                                       | Execute code when a dependency is resolved. |\n| ⚠️ [Error Management](./docs/Error%20Management.md)               | Manage errors. |\n| 🌠 [Server](./docs/Server.md)                                     | Start a server. |\n| 🚆 [Server Router](./docs/Server%20Router.md)                     | Define routes. |\n| 📃 [Server Path Parameters](./docs/Server%20Path%20Parameters.md) | Define path parameters for your routes. |\n| 🎫 [Server Session](./docs/Server%20Session.md)                   | Manage sessions. |\n| 📞 [Server Websockets](./docs/Server%20Websockets.md)             | Serve websockets. |\n| 💠 [Server Open Api](./docs/Server%20Open%20Api.md)               | Generate an Open Api definition. |\n| 🎛️ [Command](./docs/Command.md)                                   | Create a console command. |\n| 🗄️ [Database](./docs/Database.md)                                 | Connect to a database and send queries. |\n| 🗄️ [Stores](./docs/Stores.md)                                     | Store data in memory and react to changes in said data. |\n| 🚥 [Queues](./docs/Queues.md)                                     | Create in memory queues and tag them. |\n| 🚥 [Signals](./docs/Signals.md)                                   | Create signals and react to them. |\n| 🕐 [Schedule](./docs/Schedule.md)                                 | Schedule code execution using a human readable format. |\n| 💡 [RaspberryPi](./docs/RaspberryPi.md)                           | Control your RaspberryPi's GPIOs. |\n\n\n\u003e [!NOTE]\n\u003e This project is aimed at linux distributions, some features may or not may work on Windows and/or MacOS.\\\n\u003e Feel free to contribute fixing issues for specific platforms.\n\n# Prerequisites\n\nYou will need at least [php 8.3](https://www.php.net/downloads.php), `ext-mbstring`, `ext-dom` and `inotify-tools` for [watch mode](#watch-mode).\\\nAlthough optional, I also recommend you install `ext-curl` to speed http requests in php.\n\n```sh\nsudo apt install php-mbstring  # this contains ext-mbstring\nsudo apt install php-xml       # this contains ext-dom\nsudo apt install php-curl      # this will speed up project creation and http requests in general\nsudo apt install inotify-tools # this allows you to use watch mode (read below)\n```\n\n# Get started\n\nCreate a new project using one of the starter templates.\n\nYou can start from scratch\n```bash\ncomposer create-project catpaw/starter\n```\n\nor you can start with a web server\n```bash\ncomposer create-project catpaw/web-starter\n```\n\n# Install Dependencies\n```bash\nmake install\n```\n\n# Program Structure\n\nEvery program must declare a `main` function in the global scope, that will be your entry point.\n\n```php\n// src/main.php\nuse Psr\\Log\\LoggerInterface;\nfunction main(LoggerInterface $logger){\n  $logger-\u003einfo(\"hello world\");\n}\n```\n\nYou can run your program in one of three modes.\n\n# Development Mode\n\nEnter Development Mode with\n\n```bash\nmake dev\n```\n\nThis mode will run your program with [XDebug](https://xdebug.org) enabled.\n\n\u003e [!NOTE]\n\u003e See [section Debugging with VSCode](#debugging-with-vscode)\n\n\n# Watch Mode\n\nEnter Watch Mode with\n\n```bash\nmake watch\n```\n\nThis mode will run your program with [XDebug](https://xdebug.org) enabled and \nit will restart your program every time you make a change to your source code.\n\n\u003e [!NOTE]\n\u003e See [section Debugging with VSCode](#debugging-with-vscode)\n\n\u003e [!NOTE]\n\u003e By default \"source code\" means the \"src\" directory.\\\n\u003e You can change this configuration in your [makefile](./makefile), see section `watch`, parameter `resources`.\n\n# Production Mode\n\nEnter Production Mode with\n\n```bash\nmake start\n```\n\nIt's just as it sounds, run your program directly.\\\nNo debuggers, not extra overhead.\n\n# Build\n\nIt is possible, but no required, to bundle your program into a single `.phar` file with\n\n```bash\nmake build\n```\n\nThe building process can be configured inside the `build.ini` file.\n\nAfter building your application, you can simply run it using\n```\nphp out/app.phar\n```\nThe resulting `.phar` will include the following directories\n\n- `src`\n- `vendor`\n- `.build-cache` (created at build time)\n\nIt's a portable bundle, you just need to make\nsure php is installed on whatever machine you're trying to run it on.\n\n# Debugging with VSCode\n\nInstall xdebug\n```php\nsudo apt install php8.3-xdebug\n```\n\nConfigure your `.vscode/launch.json`\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Listen\",\n            \"type\": \"php\",\n            \"request\": \"launch\",\n            \"port\": 9003\n        }\n    ]\n}\n```\n\nStart debugging.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazshare%2Fcatpaw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazshare%2Fcatpaw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazshare%2Fcatpaw/lists"}