~/talk

How to re use code: Utility Classes and PHP Namespaces

Talkat CakeFest 2021 · 2021-10-07..10-08· [php]
links:none on file
slides:none on file

Refactors a coins sync routine into a reusable class called app\Utility\CoinSync that runs from a controller or a CLI command and returns true on success false on failure, demonstrating it actually syncs and removes records via an external crypto API. Shows use of composer PSR-4 autoload mapping, declaring namespaces to match folders, loading models with ModelAwareTrait or TableLocator, and IDE support via PhpStorm or VS Code extensions so the refactor works in both web and CLI contexts.

AI-written summary · about

  1. 0:00Introduction
  2. 1:24Understanding namespaces
  3. 5:48Namespaces in CakePHP
  4. 8:06Implementing utility classes
  5. 11:38Refactoring for reusability
  6. 19:44Cli and automation
  7. 22:40IDE support and errors
  8. 26:00Conclusion and best practices
~/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.