Download the PHP package progalaxyelabs/stonescriptdb-gateway-client without Composer
On this page you can find all versions of the php package progalaxyelabs/stonescriptdb-gateway-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download progalaxyelabs/stonescriptdb-gateway-client
More information about progalaxyelabs/stonescriptdb-gateway-client
Files in progalaxyelabs/stonescriptdb-gateway-client
Package stonescriptdb-gateway-client
Short Description HTTP client for StoneScriptDB Gateway - connect any PHP application to PostgreSQL via gateway
License MIT
Informations about the package stonescriptdb-gateway-client
StoneScriptDB Gateway Client
HTTP client for connecting to StoneScriptDB Gateway. Use with any PHP application to leverage PostgreSQL via a centralized gateway.
Features
- 🚀 Framework Agnostic - Works with Laravel, CodeIgniter, Symfony, vanilla PHP, etc.
- 🔌 Simple HTTP API - Call PostgreSQL functions over HTTP
- 🏢 Multi-Tenant Ready - Built-in tenant isolation support
- 📦 Schema Management - Register and migrate schemas programmatically
- 🔐 JWT Token Validation - Validate tokens from ProGalaxy Auth Service
- ⚡ Production Ready - Connection pooling, timeout handling, error management
- 🔍 Minimal Dependencies - Only requires curl, json, and firebase/php-jwt
Installation
Quick Start
Usage
Basic Function Calls
Multi-Tenant Applications
Schema Registration
Hot Schema Migration
Health Checks
Error Handling
Configuration
Authentication
JWT Token Validation
Validate JWT tokens issued by the ProGalaxy Auth Service (or StoneScriptDB Gateway):
Use Cases:
- Middleware for validating incoming API requests
- Extracting user context from JWT tokens
- Multi-tenant applications extracting tenant information from tokens
Note: For managing memberships and invitations (backend-to-backend operations), use the auth client in StoneScriptPHP framework instead.
Integration Examples
Laravel
CodeIgniter 4
Vanilla PHP
API Reference
GatewayClient
Constructor
Methods
callFunction(string $name, array $params = []): array- Call PostgreSQL functionregister(string $archive_path, array $options = []): array- Register schemamigrate(string $archive_path, array $options = []): array- Migrate schemahealthCheck(): bool- Check gateway healthisConnected(): bool- Check if connectedgetLastError(): ?string- Get last error messagesetTenantId(?string $id): self- Set tenant IDgetTenantId(): ?string- Get tenant IDsetPlatform(?string $platform): self- Set platformgetPlatform(): ?string- Get platformsetTimeout(int $seconds): self- Set request timeoutsetConnectTimeout(int $seconds): self- Set connection timeoutsetDebug(bool $enabled): self- Enable/disable debug logging
GatewayException
Thrown when gateway requests fail. Extends Exception.
TokenValidator
Validates JWT tokens issued by the auth service.
Constructor
Methods
validateToken(string $jwt): TokenClaims- Validate JWT and return claimsgetPublicKey(): string- Get cached or fetch auth service's public keyrefreshPublicKey(): void- Force refresh public key from JWKS endpoint
TokenClaims
Value object containing validated JWT claims.
Properties
string $sub- Subject (user ID)?string $email- User email?string $tenantId- Tenant identifier?string $role- User roleint $exp- Expiration timestampint $iat- Issued at timestamp
Methods
isExpired(): bool- Check if token has expiredtoArray(): array- Convert to array
Note: For membership management and invitations, use the auth clients in StoneScriptPHP framework.
Requirements
- PHP 8.1 or higher
- curl extension
- json extension
- firebase/php-jwt ^6.0 (for JWT token validation)
Contributing
Contributions are welcome! Please submit issues and pull requests on GitHub.
License
MIT License. See LICENSE for details.
Related Projects
- StoneScriptDB Gateway - The PostgreSQL gateway server
- StoneScriptPHP - PostgreSQL-native PHP framework
Support
- GitHub Issues: progalaxyelabs/stonescriptdb-gateway-client/issues
- Documentation: docs.progalaxy.com
All versions of stonescriptdb-gateway-client with dependencies
ext-curl Version *
ext-json Version *
firebase/php-jwt Version ^6.0 || ^7.0