php

  • The Scout database driver, and the ceiling it has

    Laravel 9 ships a Scout driver backed by the database, which removes a search service from a project that had one for one feature. The ceiling is real…

  • A block theme is a directory of HTML files

    5.9 on 25 January, and templates/ replaces the template hierarchy. A theme with 41 PHP templates and an editor that cannot see any of them.

  • new in initializers works for a parameter and not a property

    An object may be a default for a parameter, a static variable, a global constant and an attribute argument, and not for a property. The exclusion is a…

  • Freezing time, and the code that calls time() directly

    A test freezing the framework clock still fails against code calling time() or new DateTime(), because those bypass it entirely. The database clock is the one that catches…

  • Two-factor as a requirement, not an option

    Optional two-factor is adopted by the people who were already careful, which is not the population it was introduced for. The reset path is the security weak point…

  • index.html is the only required template

    A block theme needs style.css, templates/index.html and nothing else, which makes the minimum viable theme three files. The fallback to index.html is total rather than partial, so a…

  • templates/ and parts/ replace the template hierarchy

    5.9 on 25 January makes a theme a directory of HTML files, and the PHP template hierarchy stops being how a page is chosen. The naming still follows…

  • Composer 2.2 and the allow-plugins prompt

    2.2 in December stops running Composer plugins that have not been explicitly permitted, and a non-interactive install refuses rather than prompting. A Composer plugin runs arbitrary code during…

  • Backed enums, and the column type that finally matches

    A status column had held strings for six years, with no constraint anywhere and three spellings of shipped in production. The backing type must be int or string…

  • array_is_list, and twenty years of guessing

    Deciding whether an array was a list or a map had been done with array_keys($a) === range(0, count($a) – 1), which allocates two arrays to answer a question…