Skip to content

guibranco/pancake

🥞 Pancake

A lightweight, composable toolkit for PHP 8.4+ projects.

CI GitHub license Packagist Version Packagist Downloads Time tracker

Pancake logo

📖 Documentation: guibranco.github.io/pancake


Table of contents


Features

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

CI/CD

Build Last commit Coverage Code smells Lines of code
CI GitHub last commit Coverage Code Smells Lines of Code

Code quality

Codacy Grade Codacy Coverage Codecov CodeFactor

Quality Gate Status Maintainability Rating Reliability Rating Security Rating

Technical Debt Duplicated Lines (%) Bugs Vulnerabilities

Maintainability Code Coverage DeepSource


Installation

Requirements: PHP 8.4+, Composer

Via Composer (recommended)

composer require guibranco/pancake

Via GitHub Releases

Download the latest archive from the Releases page and include the autoloader manually.

GitHub release date


User guide

Full documentation, class references, and examples live at guibranco.github.io/pancake.

Quick start

<?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');
});

Testing

Requirements

  • PHP 8.4+
  • Composer
  • MySQL / MariaDB running locally with the following config:
Setting Value
Host localhost
Port 3306
User root
Password root
Database pancake

Running the test suite

# 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/Integration

Changelog

See CHANGELOG for the full history of releases and changes.


Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.

Contributors

guibranco
Guilherme Branco Stracini
gvieiragoulart
Gabriel Goulart
Hero-Aviraj
Haraprasad Mondal
Humayun-23
Sheikh Humayun Roshid

Bots

dependabot[bot]
dependabot[bot]
github-actions[bot]
github-actions[bot]
gitauto-ai[bot]
gitauto-ai[bot]
deepsource-autofix[bot]
deepsource-autofix[bot]
penify-dev[bot]
penify-dev[bot]
snyk-bot
Snyk Bot

Support

Please open an issue for bug reports, feature requests, or questions.


Copyright © Guilherme Branco Stracini. Released under the MIT License.

About

🧰 🛠️ Pancake project - toolkit for PHP projects

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors