php-soap/cached-engine
Composer 安装命令:
composer require php-soap/cached-engine
包简介
A cache decorator for php-soap/engine
README 文档
README
This package contains a cache wrapper for a SOAP engine. For more information about the engine, please check the php-soap/engine package.
Want to help out? 💚
Want more information about the future of this project? Check out this list of the next big projects we'll be working on.
Prerequisites
You can choose what cache implementation you want to use. This package expects some PSR implementations to be present in order to be installed:
- PSR-6:
psr/cache-implementationlikesymfony/cacheorcache/*
Example:
$ composer require symfony/cache
Installation
composer install php-soap/cached-engine
Engines
This package provides engines that can be used in a generic way:
CachedEngine
You can cache a complete engine so that you don't have to reload a WSDL on every HTTP request.
use PhpSoap\CachedEngine\CachedEngine; use Soap\CachedEngine\CacheConfig; use Soap\Engine\Engine; $engine = new CachedEngine( $yourPsr6CachePool, new CacheConfig( key: 'cached-engine', ttlInSeconds: 3600 ), static function (): Engine { return new YourSoapEngine(); } );
Note: This driver doesn't work well with the LazyEngine because of its closures that cannot be serialized.
Since this engine is already lazy, you can use it as a direct replacement.
Drivers
This package provides drivers that can be used in a generic way:
CachedDriver
You can cache a complete driver so that you don't have to reload a WSDL on every HTTP request.
use PhpSoap\CachedEngine\CachedDriver; use Soap\CachedEngine\CacheConfig; use Soap\Driver\Driver; $driver = new CachedDriver( $yourPsr6CachePool, new CacheConfig( key: 'cached-engine', ttlInSeconds: 3600 ), static function (): Driver { return new YourSoapDriver(); } );
Concrete example:
use Soap\CachedEngine\CacheConfig; use Soap\CachedEngine\CachedDriver; use Soap\Encoding\Driver; use Soap\Wsdl\Loader\StreamWrapperLoader; use Soap\WsdlReader\Wsdl1Reader; use Symfony\Component\Cache\Adapter\RedisAdapter; $driver = new CachedDriver( new RedisAdapter( RedisAdapter::createConnection('redis://localhost') ), new CacheConfig('your-soap-driver', ttlInSeconds: 3600), static fn() => Driver::createFromWsdl1( (new Wsdl1Reader( new StreamWrapperLoader() ))($wsdlLocation) ) );
php-soap/cached-engine 适用场景与选型建议
php-soap/cached-engine 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 404.69k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 06 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 php-soap/cached-engine 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 php-soap/cached-engine 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 404.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 24
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-06-07