edgebinder/edgebinder-laminas-component
Composer 安装命令:
composer require edgebinder/edgebinder-laminas-component
包简介
Laminas/Mezzio integration component for EdgeBinder - A lightweight, storage-agnostic relationship management library
关键字:
README 文档
README
A Laminas/Mezzio integration component for EdgeBinder - A lightweight, storage-agnostic relationship management library for PHP 8.3+.
Features
- 🏭 Service Factories - Ready-to-use factories for EdgeBinder instances
- 🔧 ConfigProvider - Seamless Laminas/Mezzio integration
- 🎯 Multi-Instance Support - Multiple EdgeBinder instances with different adapters
- 🔌 Extensible Adapters - Framework-agnostic plugin architecture
- 🛡️ Type Safety - Full PHP 8.3+ type safety with PHPStan level 8
- ⚡ Cross-Version Compatible - Supports ServiceManager 3.x/4.x and PSR-11 v1/v2
Requirements
- PHP 8.3+
- Laminas ServiceManager 3.0+ or 4.0+
- EdgeBinder ^0.9.0 (includes InMemoryAdapter for testing)
Installation
Install via Composer:
composer require edgebinder/edgebinder-laminas-component
Quick Start
1. Register the ConfigProvider
Add the ConfigProvider to your Laminas/Mezzio application:
// config/config.php use EdgeBinder\Component\ConfigProvider; $aggregator = new ConfigAggregator([ ConfigProvider::class, // ... other config providers ]);
2. Configure EdgeBinder
Copy the configuration template and customize it:
cp vendor/edgebinder/edgebinder-laminas-component/config/edgebinder.global.php.dist config/autoload/edgebinder.local.php
Or create configuration file manually:
// config/autoload/edgebinder.local.php return [ 'edgebinder' => [ // For testing and development 'adapter' => 'inmemory', // For production with Weaviate (requires edgebinder/weaviate-adapter) // 'adapter' => 'weaviate', // 'weaviate_client' => 'weaviate.client.default', // 'collection_name' => 'EdgeBindings', // 'schema' => [ // 'auto_create' => true, // 'vectorizer' => 'text2vec-openai', // ], ], ];
Adapters
EdgeBinder uses a self-determining adapter architecture. Adapters register themselves with the EdgeBinder AdapterRegistry when their packages are loaded.
Built-in Adapters
- InMemoryAdapter (
inmemory) - Included with EdgeBinder core v0.9.0+, perfect for testing and development
Available Adapters
- WeaviateAdapter (
weaviate) - Installedgebinder/weaviate-adapterfor vector database support - JanusAdapter (
janus) - Installedgebinder/janus-adapterfor graph database support - RedisAdapter (
redis) - Installedgebinder/redis-adapterfor caching and fast lookups
3. Use in Your Services
use EdgeBinder\EdgeBinder; use Psr\Container\ContainerInterface; class MyService { public function __construct(private EdgeBinder $edgeBinder) {} public function createRelationship($document, $knowledgeBase): void { $this->edgeBinder->bind( from: $document, to: $knowledgeBase, type: 'belongs_to', metadata: [ 'relevance_score' => 0.95, 'semantic_similarity' => 0.87, ] ); } } // Factory class MyServiceFactory { public function __invoke(ContainerInterface $container): MyService { return new MyService($container->get(EdgeBinder::class)); } }
Multiple Instances
Configure multiple EdgeBinder instances for different use cases:
// config/autoload/edgebinder.local.php return [ 'edgebinder' => [ // RAG system with vector search 'rag' => [ 'adapter' => 'weaviate', 'weaviate_client' => 'weaviate.client.rag', 'collection_name' => 'RAGBindings', 'schema' => ['vectorizer' => 'text2vec-openai'], ], // Analytics with graph database 'analytics' => [ 'adapter' => 'janus', 'janus_client' => 'janus.client.analytics', 'graph_name' => 'AnalyticsGraph', ], // Fast cache lookups 'cache' => [ 'adapter' => 'redis', 'redis_client' => 'redis.client.cache', 'ttl' => 3600, ], // Testing instance 'test' => [ 'adapter' => 'inmemory', ], ], ];
Register named instances in your container:
// config/autoload/dependencies.local.php return [ 'dependencies' => [ 'factories' => [ 'edgebinder.rag' => function(ContainerInterface $container) { $factory = new EdgeBinderFactory(); return $factory->createEdgeBinder($container, 'rag'); }, 'edgebinder.analytics' => function(ContainerInterface $container) { $factory = new EdgeBinderFactory(); return $factory->createEdgeBinder($container, 'analytics'); }, 'edgebinder.test' => function(ContainerInterface $container) { $factory = new EdgeBinderFactory(); return $factory->createEdgeBinder($container, 'test'); }, ], ], ]; 'rag' => [ 'adapter' => 'weaviate', 'weaviate_client' => 'weaviate.client.rag', 'collection_name' => 'RAGBindings', ], 'analytics' => [ 'adapter' => 'weaviate', 'weaviate_client' => 'weaviate.client.analytics', 'collection_name' => 'AnalyticsBindings', ], ], ];
Use named instances:
$ragBinder = $container->get('edgebinder.rag'); $analyticsBinder = $container->get('edgebinder.analytics');
Documentation
Contributing
Please see CONTRIBUTING.md for details.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Support
edgebinder/edgebinder-laminas-component 适用场景与选型建议
edgebinder/edgebinder-laminas-component 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.36k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「graph」 「dependency-injection」 「Relationships」 「service-manager」 「laminas」 「mezzio」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 edgebinder/edgebinder-laminas-component 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 edgebinder/edgebinder-laminas-component 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 edgebinder/edgebinder-laminas-component 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Netgen Open Graph Bundle is an Ibexa Platform bundle that allows simple integration with Open Graph protocol.
PHP Interface for Babel Street Text Analytics
Adds nested resources routing support along with related actions and relationship handlers to the Yii RESTful API framework
Supporing Symfony's DependencyInjection component for your symfony1 project
Adds KeyBy('id') to Eloquent relationships
A tool for scraping URL resources (oEmbed, OpenGraph, Twitter cards, JSON-LD)
统计信息
- 总下载量: 1.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 32
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-08-04