Uncategorized

  • Index hints are a last resort with a shelf life

    FORCE INDEX makes the immediate problem go away and freezes a decision the optimiser would otherwise revisit as the data changes. It is a fix with an expiry…

  • Generators can return a value as well as yield

    A generator yields a sequence, and until PHP 7 that was all it could produce — so a function streaming rows had no way to also report how…

  • Extracting a service without a rewrite

    The reporting code had one caller and a six-hour test run. Finding the seam, dealing with the shared schema honestly, and routing traffic gradually rather than switching.

  • Getters and setters inside a class body

    A computed value usually starts as a method and becomes a property when someone forgets the parentheses. An accessor lets it be read as a property while still…

  • A transient with an expiry of zero never expires

    Passing 0 as the expiry reads like “expire immediately” and means the opposite: no expiry is stored, so the transient lives until something deletes it. A variable that…

  • Composer scripts see vendor/bin on the path

    Scripts in composer.json run with vendor/bin prepended to PATH, so the tools do not need a path prefix — which is why “test”: “phpunit” works and the same…

  • OCSP stapling removes a round trip from the handshake

    Without stapling, the browser checks whether a certificate has been revoked by contacting the issuing authority itself — an extra DNS lookup and request, to a third party,…

  • Term meta arrived in 4.4 and nobody noticed

    Attaching data to a category or tag used to mean an option keyed by term id, a separate table, or a plugin. 4.4 added a real meta table…

  • docker exec attaches; docker-compose run creates

    The two commands look like alternatives and do different things. exec runs a process inside a container that is already up; run starts a new container from the…

  • Source maps in production without shipping the source

    Minified stack traces are unreadable, and the usual fix — shipping source maps — publishes the original source to anyone who opens devtools. Both problems have the same…