~/talk

Dependency Injection in CakePHP

Talkat CakeFest 2020 · 2020-10-08..10-09· [php, software-architecture]
links:none on file
slides:none on file

CakePHP 4.2 introduces an experimental container that registers service definitions, supports deferred loading via service providers (activate only when a listed service is requested), and supplies a service config proxy for read-only config values. Controllers and console commands get constructor injection; action parameters use reflection to inject dependencies. Containers store recipes (shared vs non-shared), resolve dependency graphs, and can be swapped for tests. The feature is flagged experimental, may change before stabilization (targeted for 4.3+), and recommends passing Request objects into service methods rather than injecting them.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 0:42What is dependency injection
  3. 2:04Constructor injection basics
  4. 3:31Why dependency injection patterns
  5. 4:34Factories and registries
  6. 5:58Locators and their drawbacks
  7. 8:25Containers explained
  8. 10:34CakePHP's current DI usage
  9. 11:59Application logic gap
  10. 13:02What are application services
  11. 14:48New container in CakePHP 4.2
  12. 15:50Service providers and lazy loading
  13. 17:34Injecting services into controllers
  14. 18:58Handling request in services
  15. 19:18Experimental features explained
  16. 21:43Call for feedback and testing
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.