phoneburner/pinch
Composer 安装命令:
composer require phoneburner/pinch
包简介
The Pinch API Framework Monorepo
README 文档
README
Pinch Framework
Feels like home, just without the salty tears of frustration
The Pinch Framework is a "batteries-included," very-highly-opinionated PHP framework, derived from the original Salt framework/application used by PhoneBurner. While modeled on other modern "general purpose" frameworks like Symfony and Laravel, the Pinch Framework is designed and optimized as an API backend.
Ideally, it adapts the best core features of Salt without dragging along unnecessary complexity, technical debt, and the (many) design decisions we regret. The goal is to provide users with a robust framework with minimum cognitive overhead from the original Salt framework, avoiding the pitfalls of bringing in a full-fledged third-party framework and trying to adapt that to our needs.
Guiding Principles
- Compatiblity with the PSRs should be the general rule, but sensible deviations are allowed, especially in the name of type safety.
- Where practical, third-party library code should be wrapped in a way that lets us expose our own interface. This allows us to swap out the underlying library without changing application code.
- Separation of "framework" and "application" concerns
- Take the best parts of Salt, leave the rest, and add new features wrapping the best of modern PHP
- Configuration driven, with environment variables as the primary source of overrides
Notable Differences from Salt
- The time zone configuration for PHP and the database is set to UTC by default.
- Configuration is defined by the environment, and not by the path value of a request.
- Overriding configuration values is done via environment variables, not by adding local configuration files.
- Database migrations are handled by the Doctrine Migrations library, as opposed to Phinx.
- PHPUnit 12 is used for testing, this is a significant upgrade from the previous version. Notably, unit tests are defined with attributes and data providers must be defined as static functions.
- When cast to a string,
\Phoneburner\Pinch\Component\PhoneNumber\DomesticPhoneNumberis formatted as an E.164 phone number ("+13145551234"), instead a ten-digit number ("3145551234").
Backwards Capability Guarantees
Classes and interfaces with the #[PhoneBurner\Pinch\Attribute\Usage\Contract] attribute
are considered part of the public API of the framework and should not be changed without
a major version bump. These "contracts" can be freely used in application code.
Conversely, classes and interfaces with the #[PhoneBurner\Pinch\Attribute\Usage\Internal]
attribute are very tightly coupled to third-party vendor and/or framework logic,
and should not be used in application code.
Included Functionality
- PSR-7/PSR-15 Request & Response Handling
- PSR-11 Dependency Injection Container
- PSR-3 Logging with Monolog
- PSR-14 Event Dispatching based on Symfony EventDispatcher
- Local/Remote Filesystem Operations with Flysystem
- Development Environment Error Handling with Whoops
- Console Commands with Symfony Console
- Interactive PsySH Shell with Application Runtime
- Doctrine ORM & Migrations
- Redis for Remote Caching with PSR-6/PSR-16 Support
- RabbitMQ for Message Queues and Job Processing
- Task Scheduling with Cron Expression Parsing with Symfony Scheduler
- SMTP/API Email Sending with Symfony Mailer
Docker
The default Docker image used by this project is based on Docker's official PHP 8.4 FPM image with default with a few additional extensions installed and configuration tweaks. The base image's "php.ini-production" configure is used as the basis for the php.ini file. The values in this file are overridden by the "php-development.ini" or "php-production.ini" files, depending on the environment.
Sodium
The official PHP 8.4 FPM image ships with an older version of libsodium, which does not support the latest functionality added to PHP's Sodium extension. The project image updates 1.0.20, so AEGIS-256 related functions are available.
XDebug
The PHP Docker image used by this project includes the XDebug extension, but it is not enabled in the same way as the other extensions. To load the XDebug extension, "zend_extension=xdebug.so" must be added to an INI file. It is enabled by default in the Docker image as the "php-development.ini" is copied to the PHP INI directory as "settings.ini". Production builds should copy the "php-production.ini" file instead, which does not include the XDebug extension (enabling the JIT instead).
Notes
- Events can be defined at the component level; Event listeners must be defined at the framework or application level.
phoneburner/pinch 适用场景与选型建议
phoneburner/pinch 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phoneburner/pinch 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phoneburner/pinch 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-07