How neo4j-php/bolt works
Component Relationships
[Client Application] → [Bolt Factory]
• ↓
[Connection Layer] ← → [Protocol Layer] ← → [PackStream Layer]
[Socket Types] [Protocol Versions] [Serialization]
Detailed Component Breakdown
Connection Layer (Green):
┌─ Connection Interface (IConnection)
• Socket Implementation
• StreamSocket Implementation
• PStreamSocket Implementation
Protocol Layer (Blue):
┌─ Abstract Protocol
• Version Implementations (V1-V5.6)
• Message Handlers
• Server State Management
PackStream Layer (Yellow):
┌─ Packer Interface
• Unpacker Interface
• Dictionary Generator
• List Generator
Implementation Details
Following flows:
1. Connection Establishment:
Client → Handshake → Version Negotiation → Authentication
2. Query Execution:
Query → Protocol Version → PackStream → Socket → Neo4j Server
3. Response Handling:
Server Response → Socket → Unpacker → Protocol → Client
Technical Notes
Annotations for:
• Supported Bolt versions (≤ 5.6)
• PHP version requirements (^8.1)
• Required extensions (mbstring, sockets, openssl)
• Connection timeout handling
• Server state transitions