zestic / weaviate-client-component
Laminas/Mezzio integration component for the Weaviate PHP client with dependency injection, multiple client support, and comprehensive configuration
Requires
- php: ^8.3
- guzzlehttp/guzzle: ^7.9
- guzzlehttp/psr7: ^2.7
- laminas/laminas-servicemanager: ^3.22 || ^4.0
- psr/container: ^1.0 || ^2.0
- zestic/weaviate-php-client: ^0.3.0
Requires (Dev)
- ergebnis/composer-normalize: ^2.42
- laminas/laminas-config-aggregator: ^1.14
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.8
README
A modern Laminas/Mezzio integration component for the Weaviate PHP client with dependency injection, multiple client support, and comprehensive configuration.
Features
- ๐ Modern PHP 8.3+ - Leverages latest PHP features
- ๐ง ConfigProvider Integration - Seamless Laminas/Mezzio setup
- ๐ญ Service Factories - Full dependency injection support
- ๐ Multiple Clients - Support for multiple named Weaviate connections
- โ๏ธ Type-Safe Configuration - Readonly configuration classes
- ๐งช Comprehensive Testing - Unit and integration tests
- ๐ Complete Documentation - Installation, configuration, and examples
Requirements
- PHP 8.3 or higher
- Laminas ServiceManager 3.22+
- PSR-11 Container implementation
Installation
Install via Composer:
composer require zestic/weaviate-client-component
Quick Start
- Copy the configuration template:
cp vendor/zestic/weaviate-client-component/config/weaviate.global.php.dist config/autoload/weaviate.local.php
-
Configure your Weaviate connection in
config/autoload/weaviate.local.php
-
Register the ConfigProvider in your application configuration
-
Inject the WeaviateClient into your services
Testing
This project includes comprehensive testing with both unit and integration tests:
# Run all tests (unit only, integration tests skipped without Weaviate) composer test # Run all tests including integration tests (recommended) composer test:with-weaviate # Run only unit tests composer test-unit # Run only integration tests (requires Weaviate) composer test-integration
Test Coverage: 148 tests total (136 unit + 12 integration)
See TESTING.md for detailed testing instructions.
Documentation
Contributing
Please see CONTRIBUTING.md for details on how to contribute to this project.
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Support
Related Projects
- zestic/weaviate-php-client - The core Weaviate PHP client