A lightweight, composable toolkit for PHP 8.4+ projects.
📖 Documentation: guibranco.github.io/pancake
Pancake provides a curated set of battle-tested utility classes, ready to drop into any PHP project:
| Class | Description |
|---|---|
CircuitBreaker |
Prevents cascading failures with open/half-open/closed state management |
Color |
Color conversion and manipulation utilities |
Database |
Thin PDO wrapper with query building helpers |
GUIDv4 |
RFC 4122-compliant UUID v4 generator |
GitHub |
Interact with the GitHub REST API |
HealthChecks |
Liveness and readiness probe endpoints |
IpUtils |
IP address parsing, validation, and range checking |
Logger |
PSR-3 compatible structured logger |
LogStream |
Real-time log ingestion and streaming client |
MemoryCache |
Shared-memory key/value store backed by shmop |
OneSignal |
Push notification client for the OneSignal API |
Request |
Fluent HTTP client with curl_multi support |
SessionManager |
Secure session handling with lifetime and flash support |
ShieldsIo |
Shields.io badge builder with cache-control |
| Build | Last commit | Coverage | Code smells | Lines of code |
|---|---|---|---|---|
Requirements: PHP 8.4+, Composer
composer require guibranco/pancakeDownload the latest archive from the Releases page and include the autoloader manually.
Full documentation, class references, and examples live at guibranco.github.io/pancake.
<?php
require 'vendor/autoload.php';
use GuiBranco\Pancake\CircuitBreaker;
use GuiBranco\Pancake\MemoryCache;
use GuiBranco\Pancake\Request;
// Protect an external API call with a circuit breaker
$cb = new CircuitBreaker(new MemoryCache(), failureThreshold: 3, resetTimeout: 60);
$result = $cb->execute(function () {
$request = new Request();
return $request->get('https://api.example.com/data');
});- PHP 8.4+
- Composer
- MySQL / MariaDB running locally with the following config:
| Setting | Value |
|---|---|
| Host | localhost |
| Port | 3306 |
| User | root |
| Password | root |
| Database | pancake |
- WireMock for integration tests (see
docker-compose.yml)
# Install dependencies
composer install
# Start WireMock (required for integration tests)
docker compose up -d
# Run all tests
./vendor/bin/phpunit tests
# Run only unit tests
./vendor/bin/phpunit tests/Unit
# Run only integration tests
./vendor/bin/phpunit tests/IntegrationSee CHANGELOG for the full history of releases and changes.
Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.
|
Guilherme Branco Stracini |
Gabriel Goulart |
Haraprasad Mondal |
Sheikh Humayun Roshid |
|
dependabot[bot] |
github-actions[bot] |
gitauto-ai[bot] |
deepsource-autofix[bot] |
penify-dev[bot] |
Snyk Bot |
Please open an issue for bug reports, feature requests, or questions.
Copyright © Guilherme Branco Stracini. Released under the MIT License.
