Improved
- Added PHP 8.6 compatibility (while keeping PHP 8.3+ support): replaced deprecated
spl_object_hash()calls withspl_object_id(), replacedis_a()on possible strings withinstanceof ArrayAccess, guardedparse_str()andUri::pathExists()against NUL-byteValueErrorexceptions, handledpreg_grep()andCollator::asort()error fallbacks, normalizedPage::taxonomy()input beforearray_walk(), and cleaned up remaining PHP 8.5+ deprecations (finfo_close(),Reflection*::setAccessible(),case ...;, null array offset inJob, andimagedestroy()in tests) - Faster page rendering on large sites: navigation menus work out the current page's parents once per request instead of once per menu item, and
active()/activeChild()and absolute URLs look up a single route instead of loading every route from the lazy page index - Sorting a collection no longer encodes every page's metadata as JSON to build its cache key, which took about 1 ms per sort on a 2,000-page blog
dateRangeandtype/typescollection filters read page dates and templates from the page index instead of loading every page in the collection (20–25% faster on a 2,000-page blog)- The Redis and Memcached cache drivers share one connection per request instead of opening one for each cache
- Smaller savings: linked CSS/JS pipeline bundles aren't read from disk on every request, the summary-divider regex only runs when the content has a divider, and
Collection::isFirst()/isLast()no longer copy the item list
Bugfix
- A
media://(or other stream) image in a folder whose name starts with a number, such as a2022/09upload folder, rendered with a broken//media:2022//09/...address. Images with resize or crop actions and HTML<img>tags in content were affected too #4417 Utils::replaceLastOccurrence()no longer cuts in the wrong place when the text has multibyte characters before the match (/blog/über-uns.jsoncame out as/blog/über-uns.)Uri::post()with a filter no longer logs a PHP deprecation on every call. It compared against the deprecatedFILTER_SANITIZE_STRINGconstant, which PHP 9 removes- Removed a call to
ArrayAdapter::setNamespace(), which doesn't exist in Symfony Cache 7, from thearraycache driver, plus a few smaller static-analysis cleanups Grav\Framework\Psr7\ServerRequest,Grav\Framework\Logger\Processors\UserProcessorandGrav\Framework\Cache\Adapter\SessionCacheload again. Their method signatures no longer matched PSR-7 2.0, Monolog 3 and Grav's cache base class, so PHP stopped with a fatal error on first use- The Flex relationship classes no longer log PHP deprecations when they load
FlexIndex::findFirst()andreduce()return a result instead of always returningnullbin/gpm selfupgradeno longer callsstrftime(), which is deprecated and removed in PHP 9- Removed the unused
Scheduler\SchedulerControllerclass, which pointed to a scheduler class that no longer exists, and the scheduler service's setup for ascheduler.modern.enabledoption that called methods that were gone. The scheduler sets up its own queue, workers and history fromscheduler.modern - Replaced deprecated library calls (Cron
factory(), Monolog level constants, DoctrinegetOrderings(),utf8_encode()) and removed compatibility branches for Twig 1/2 and PHP 7 that could no longer run, plus an unused Monolog 1/2 shim - Object collection filtering (
ObjectExpressionVisitor) no longer extends Doctrine'sClosureExpressionVisitor, which Doctrine marks final and may lock in a future major version. It builds on Doctrine's abstractExpressionVisitorand handles AND/OR/NOT itself, with the same results