The major version bump is due to upping the required PHP version from 8.1
to 8.4
and a several breaking changes. Most applications built using Mako 10
should run on Mako 11
with just a few simple adjustments.
New
- Mako applications are now better suited to run on application servers like FrankenPHP.
- The development error view now displays the Mako environment name.
- Added
Connection::blob()
method that allows you to easily fetch a blob column as a stream. - Added
Query::blob()
method that allows you to easily fetch a blob column as a stream. - The
ManyToMany::unlink()
andManyToMany::synchronize()
methods now support junction attributes. - Enums are now also supported when writing "raw" SQL.
- Added support for deletes with joins to the MySQL query compiler.
- The database library will use the new driver specific PDO sub-classes.
- Added upsert functionality to the query builder. The feature is currently supported by the
MySQL
,PostgreSQL
andSQLite
compilers. - The database library now allows you to bind stringable objects as query parameters.
- Added
ConnectionManager::getOpenConnections()
method. - The
Time::createFromTimestamp()
andTimeImmutable::createFromTimestamp()
methods now support microsecond precision. - The
Time::createFromFormat()
andTimeImmutable::createFromFormat()
methods now support microsecond precision. - It is now possible to customize how JSON request bodies are decoded using the following methods:
Body::setJsonMaxDepth()
to set the maximum JSON nesting level.Body::setJsonFlags()
to set the JSON decoding options.
- The dependency injection container can now resolve intersection types.
- Added
Deprecated
middleware that allows you to easily set theDeprecation
andSunset
HTTP headers. - Global constraints and middleware will now be listed and sorted by priority when using the
app:routes
command. - The Redis client now supports the following Redis Stack features:
- Bloom filter
- Cuckoo filter
- Count-min sketch
- JSON
- Redis query engine
- Auto-suggest
- T-digest
- Time series
- Top-k
- Added
Redis::executeCommand()
helper method that makes it possible to call commands not yet supported by the client. - Added
Permission
enum to make it easier to interact with file permissions. - Added
Permissions
class that can be used to interact with a set ofPermission
enum instances. - Added
FileSystem::setPermissions()
method that accepts an integer or aPermissions
instance. - Added
FileSystem::hasPermissions()
method that accepts an integer or aPermissions
instance. - Added
FileSystem::getPermissions()
method that returns aPermissions
instance. - Added
FileSystem::isExecutable()
method. - Added
FileSystem::clearCache()
method. - Added
FileInfo::hasPermissions()
method that accepts an integer or aPermissions
instance. - Added
FileInfo::getPermissions()
method that returns aPermissions
instance. - Reactor command names can now be registered with the
CommandName
attribute. - Reactor command descriptions can now be registered with the
CommandDescription
attribute. - Reactor command arguments can now be registered with the
CommandArguments
attribute. - Added new
Cursor
class that makes it easier to control the CLI cursor. - Added a signal handler to make it easier to handle async process control signals.
- Added a CLI spinner output component.
- Added a CLI hyperlink component.
- Added a CLI progress component.
- Added a CLI progress iterator component.
- New and improved look of rendered CLI tables.
- Added a simple way to defer small tasks until after the response has been sent to the client when using FastCGI.
Changes
- The gatekeeper
Session::login()
andSession::forceLogin()
methods will now return aLoginStatus
enum instance instead of a mix of boolean and integer values. - Dropped support for underscore separated Redis method calls.
- Renamed the
UUID::sequential()
method toUUID::v4Sequential()
. - Renamed the
ErrorHandler::handle()
method toErrorHandler::addHandler()
. - Renamed the
ErrorHandler::handler()
method toErrorHandler::handle()
. - Renamed the
mako\cli\output\helpers
namespace tomako\cli\output\components
. - The Redis cache
clear
implementation will no longer flush the entire database but instead just deleted the cached keys.
Deprecations
- Deprecated the
Command::$command
property. Use theCommandName
attribute instead. - Deprecated the
Command::$description
property. Use theCommandDescription
attribute instead. - Deprecated the
Command::getCommand()
method. - Deprecated the
Command::getDescription()
method. - Deprecated the
Command::getArguments()
method. Use theCommandArguments
attribute instead. - Deprecated the
Command::progressBar()
method. Use theCommand::progress()
orCommand::progressIterator()
methods instead.
Improvements
- Text in CLI alerts can now be styled and the alerts will render properly with text consisting of characters of varying width.
- More consistent look and feel when creating CLI commands.
- The preloader generator will now ensure preloading of class, property, method and argument attributes.
- Various other improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
10.0.*.
All deprecated features will be removed in Mako 12.0.