Članci s tagom #dependency-injection
-
Dependency injection in PHP without a package: reflection autowiring from scratch
Shinobi Apps framework Container: singleton vs request scope, reflection-based constructor parameter resolution, APCu L2 cache for constructor signatures (namespace keyed by Container.php mtime, TTL 3600s). Circular dependency detection via $resolving stack. Lazy EventDispatcher resolution from container (bootstraps where DI registers after QueueManager). register/singleton/request/get/has API. Auto-class resolution for unregistered class names.
-
Lazy vs eager bootstrap in PHP: the production incident that taught me the hard way
Three bootstrap patterns for PHP service registration — pure eager, pure lazy, and the split approach. Why lazy sounds smart, why it breaks cross-cutting hooks, and what the 2026-04-28 incident looked like at 11pm.