- Added a statistics utility class with the following methods:
Statistics::mean()
Statistics::median()
Statistics::mode()
Statistics::multimode()
Statistics::midrange()
Statistics::sampleVariance()
Statistics::populationVariance()
Statistics::sampleStandardDeviation()
Statistics::populationStandardDeviation()
- Added "update and return" functionality to the query builder. The feature is currently supported by the
Firebird
,PostgreSQL
,SQLite
andSQL Server
compilers.
- Command argument aliases are now shown in a separate column.
- Added
RedisException::getStreamMetadata()
method to assist in debugging of read errors.
- Replaced the deprecated SETEX and SETNX redis command calls with SET with the EX and NX options.
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.
- 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.
- 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.
- 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.
- 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.
- PHP 8.4 compatibility.
- Ensuring compatibility with future PHP versions.
- The
app:routes
command no longer fails when there is registered middleware. - The
Environment::getWidth()
method now works as expected. - The
Environment::hasAnsiSupport()
method now works as expected.
- Query builder update queries can now have joins.
- Fixed request bug that would occur if
PATH_INFO
was set but empty.
- The framework now uses
mako\env
instead ofgetenv
.
- Fixed an issue where an uninitialized connection name in migration would throw an exception.
- Fixed an issue where an uninitialized response body causes problems.
- The validation factory
$container
constructor parameter no longer accepts null.
- Sensitive parameters will be redacted if present in a stack trace when running on PHP 8.2+
- Ensure closing of connection when using the
ConnectionManager::executeAndClose()
method.
The major version bump is due to dropped support for PHP 8.0
and a several breaking changes. Most applications built using Mako 9
should run on Mako 10
with just a few simple adjustments.
- Added the
Session::disableAutoCommit()
method. - Added the
Session::enableAutoCommit()
method. - Made the
Session::gc()
method public and added a$force
parameter. - The following
Request
properties are now public readonly:Request::$query
Request::$post
Request::$cookies
Request::$files
Request::$server
Request::$headers
- The following
Response
properties are now public readonly:Response::$cookies
Response::$headers
- The following methods now accept both an int and the
mako\http\response\Status
enum as a parameter value:Response::setStatus()
JSON::setStatus()
Redirect::setStatus()
- Added the
HttpStatusException::getStatus()
method. - Simplified middleware and constraint registration.
- Global middleware and constraints can now be registered with parameters.
- Added the
Dispatcher::registerGlobalMiddleware()
method. - Added the
Router::registerGlobalConstraint()
method.
- Added the
- Added APCu session store.
- Added the
$validateEmptyFields
parameter to the validator to allow forced validation of empty fields.
- Removed the NuoDB query compiler.
- Removed the deprecated event library (use the bus library instead).
- Removed the deprecated command bus library (use the bus library instead).
- Removed the deprecated
TimeInterface::formatLocalized()
method. - All class properties are now typed.
- The
mako\http\response\Status
class has been converted to an enum. - The following methods now return an
mako\http\response\Status
instance instead of an int:Response::getStatus()
JSON::getStatus()
Redirect::getStatus()
- Removed the
Dispatcher::registerMiddleware()
method. - Removed the
Dispatcher::setMiddlewareAsGlobal()
method. - Changed the
Dispatcher::setMiddlewarePriority()
method signature. - Removed the
Router::registerConstraint()
method. - Removed the
Router::setConstraintAsGlobal()
method. - Application controllers and routing have been moved to the
app/http
namespace.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
9.1.*.
- The
not_empty
validation rule is now available.
- The logger service will no longer start the session unnecessarily if the gatekeeper service is enabled.
- The
mako\env()
function now works as expected with the falsy boolean value defined as "0".
- Added
Arr::append()
method.
- Added the following methods to the
mako\file\FileSystem
class:FileSystem::isLink()
FileSystem::getLinkTarget()
FileSystem::createSymbolicLink()
FileSystem::createHardLink()
- Added
HTTPService::getRoutingPath()
method to make it easier to reorganize the application structure. - Added the following methods to the
mako\utility\Arr
class:Arr::toObject()
- Added
mako\http\exceptions\UnauthorizedException
exception. - Exceptions handled by the Mako exception handlers will be assigned a unique id that makes it easier to find the corresponding log entry.
- Added a new bus library with command, event and query buses.
- New and improved output for the
app:routes
command. - The
Query::insertAndGetId()
method now allows inserting empty rows just like theQuery::insert()
method. - Added
mako\env()
helper function.
- Deprecated the
mako\chrono\TimeInterface::formatLocalized()
method. - Deprecated the old command bus library (see the new command and query buses).
- Deprecated the old event library (see the new event bus).
- Fixed migration rollbacks.
- Fixed autoloading of the
RangeNotSatisfiableException
exception.
- The
CommandInterface::handle()
andSelfHandlingCommandInterface::handle()
methods no longer enforce amixed
return type.
The major version bump is due to dropped support for PHP 7.4
and a several breaking changes. Most applications built using Mako 8
should run on Mako 9
with just a few simple adjustments.
- The name of CLI arguments with aliases can now be defined using an array instead of a string.
- The preloader generator will now attempt to preload typed properties, method arguments and return types.
- Route middleware can now be registered using only the class name.
- Route constraints can now be registered using only the class name.
- Added the following methods to the query builder:
Query::rightJoin()
Query::rightJoinRaw()
Query::crossJoin()
Query::lateralJoin()
Query::insertMultiple()
- Added the
mako\f
"function builder" helper function.
- Removed the
Validator::rule()
helper method in favor of the newmako\f
helper function. - Removed the following deprecated methods from the
Str
class:Str::camel2underscored()
Str::underscored2camel()
- Renamed the following classes:
mako\http\routing\traits\InputValidationTrait
tomako\validator\input\http\routing\traits\InputValidationTrait
.mako\validator\input\HttpInput
tomako\validator\input\http\Input
.mako\validator\input\HttpInputInterface
tomako\validator\input\http\InputInterface
.mako\http\routing\traits\AuthorizationTrait
tomako\gatekeeper\authorization\http\routing\traits\AuthorizationTrait
.
- The following class constants have been made protected:
- mako\application\cli\commands\server\Server::MAX_PORTS_TO_TRY
- mako\classes\ClassFinder::PHP_FILENAME_PATTERN
- mako\cli\input\arguments\Argument::NAME_REGEX
- mako\cli\input\arguments\Argument::ALIAS_REGEX
- mako\cli\input\arguments\ArgvParser::INT_REGEX
- mako\cli\input\arguments\ArgvParser::FLOAT_REGEX
- mako\cli\output\formatter\Formatter::TAG_REGEX
- mako\cli\output\formatter\Formatter::ESCAPED_TAG_REGEX
- mako\cli\output\formatter\Formatter::ANSI_SGR_SEQUENCE_REGEX
- mako\cli\output\helpers\Alert::PADDING
- mako\cli\output\helpers\Countdown::SLEEP_TIME
- mako\commander\CommandBus::COMMAND_SUFFIX
- mako\commander\CommandBus::HANDLER_SUFFIX
- mako\database\midgard\ORM::PRIMARY_KEY_TYPE_INCREMENTING
- mako\database\midgard\ORM::PRIMARY_KEY_TYPE_UUID
- mako\database\midgard\ORM::PRIMARY_KEY_TYPE_CUSTOM
- mako\database\midgard\ORM::PRIMARY_KEY_TYPE_NONE
- mako\database\midgard\relations\Relation::EAGER_LOAD_CHUNK_SIZE
- mako\database\query\compilers\Compiler::JSON_PATH_SEPARATOR
- mako\error\handlers\web\DevelopmentHandler::SOURCE_PADDING
- mako\i18n\I18n::PLURALIZATION_TAG_REGEX
- mako\i18n\I18n::NUMBER_TAG_REGEX
- mako\redis\Redis::CRLF
- mako\redis\Redis::CRLF_LENGTH
- mako\redis\Redis::VERBATIM_PREFIX_LENGTH
- mako\redis\Redis::END
- mako\security\crypto\encrypters\Encrypter::DERIVATION_HASH
- mako\security\crypto\encrypters\Encrypter::DERIVATION_ITERATIONS
- mako\security\Signer::MAC_LENGTH
- mako\session\Session::MAX_TOKENS
- mako\view\compilers\Template::VERBATIM_PLACEHOLDER
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
8.1.*.
- Don't set the Content-Encoding header when sending a chunked data stream.
- PHP
8.1
compatibility:- Creating a migration without a description will no longer fail.
- Junction tables will now be named correctly even when table names are prefixed by the database name.
- Fixed issue caused by breaking changes in Monolog.
- It is now possible to use custom validation rules without registering them first.
- Added
Str::camelToSnake()
method. - Added
Str::snakeToCamel()
method. - Added
CamelCasedTrait
ORM trait that enables camel cased interaction with ORM objects. - The
protect
andexpose
methods of the ORMResultSet
class are now chainable. - Eager loaded relations can now be aliased.
- Route middleware can now be registered using the new
Middleware
attribute (PHP 8.0+). - Route constraints can now be registered using the new
Constraint
attribute (PHP 8.0+). - The ORM
$protected
property andprotect
method now supports nested fields.
- Deprecated the
Str::camel2underscored
method. - Deprecated the
Str::underscored2camel
method.
- PHP 8.1 compatibility.
- Eager loading will now work as expected with
ORM::getOrThrow()
andQuery::getOrThrow()
.
- PHP
8.2
compatibility. - Prevent errors with malformed request paths.
- Fixed issue with subqueries when using the ORM (#291).
- PHP
8.1
compatibility.
The major version bump is due to dropped support for PHP 7.3
and a several breaking changes. Most applications built using Mako 7.3.0
should run on Mako 8.0.0
with just a few simple adjustments.
- Views can now be rendered by casting them to strings.
- Added
WriterInterface::setStream()
method. - The query builder now supports enums (PHP 8.1+).
- The ORM can now cast values to enums (PHP 8.1+).
- Added
boolean:false
validation rule. - Added
boolean:true
validation rule. - Added
boolean
validation rule. - Added
enum
validation rule (PHP 8.1+). - Added
not_empty
validation rule. - Added
number:float
validation rule. - Added
number:int
validation rule. - Added
number:natural_non_zero
validation rule. - Added
number:natural
validation rule. - Added
number
validation rule. - Added
numeric
validation rule. - Added
string
validation rule. - Middleware will now be executed even when routing throws
NotFoundException
andMethodNotAllowed
exceptions.
- The
Str::alternator()
method now returns anAlternator
instance instead of a closure. - Removed the deprecated
AdapterManager::instance()
method. - Removed the deprecated
ConnectionManager::instance()
method. - Removed the following deprecated methods from the
Connection
class:Connection::builder()
Connection::table()
- Removed the deprecated
ORM::builder()
method. - Removed the deprecated
Route::namespace()
method. - Removed support for defining method controller actions as strings.
- Removed the deprecated
AccessControlAllowOrigin
middleware. - The following validation rules have been renamed:
float
tonumeric:float
integer
tonumeric:int
natural_non_zero
tonumeric:natural_non_zero
natural
tonumeric:natural
- The following commands have been renamed:
app.generate_preloader
toapp:generate-preloader
app.generate_secret
toapp:generate-secret
app.generate-key
toapp:generate-key
app.routes
toapp:routes
cache.clear
tocache:clear
cache.remove
tocache:remove
migrate.create
tomigration:create
migrate.down
tomigration:down
migrate.reset
tomigration:reset
migrate.status
tomigration:status
migrate.up
tomigration:up
server
toapp:server
- The following exceptions have been renamed:
mako\cli\output\formatter\FormatterException
tomako\cli\output\formatter\exceptions\FormatterException
mako\config\loaders\LoaderException
tomako\config\loaders\exceptions\LoaderException
mako\gatekeeper\authorization\AuthorizerException
tomako\gatekeeper\authorization\exceptions\AuthorizerException
mako\http\exceptions\HttpException
tomako\http\exceptions\HttpStatusException
mako\i18n\I18nException
tomako\i18n\exceptions\I18nException
mako\i18n\loaders\LoaderException
tomako\i18n\loaders\exceptions\LoaderException
mako\onion\OnionException
tomako\onion\exceptions\OnionException
mako\redis\RedisException
tomako\redis\exceptions\RedisException
mako\security\crypto\CryptoException
tomako\security\crypto\exceptions\CryptoException
mako\security\password\HasherException
tomako\security\password\exceptions\HasherException
mako\validator\ValidationException
tomako\validator\exceptions\ValidationException
mako\view\ViewException
tomako\view\exceptions\ViewException
- Added
$field
parameter to theRuleInterface::validate()
method.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
7.3.*.
- PHP
8.1
compatibility.
- The
InputValidation
middleware will now keep access control headers when clearing the response.
- The
app.routes
command now works with route actions defined as arrays.
- Added protected
AccessControl::getAllowedDomains()
method.
- Added abstract
AccessControl
middleware. - Added new and cleaner way of registering class methods as route actions.
- Added
Cookies::clearExcept()
method. - Added
Headers::clearExcept()
method. - Added
Response::clearExcept()
method. - Added
Response::resetExcept()
method. - It is now possible to define a whitelist of cookies and headers to keep when an exception has been handled.
- Added
Connection::firstOrThrow()
method to the database connection class. - Added
Query::firstOrThrow()
method to the base query builder class. - Added
Query::getOrThrow()
method to the ORM query builder class. - Added
Query::firstOrThrow()
method to the ORM query builder class. - Added
ORM::getOrThrow()
method. - The database library will now throw
mako\database\exceptions\DatabaseException
exceptions that extend the previously thrownRuntimeException
exceptions. - Added
ConnectionManager::getConnection()
method. - Added
Connection::getQuery()
method. - Added
ORM::getQuery()
method. - Added
FileSystem::copy()
method. - Added
CacheManager::getInstance()
method. - Added
CacheManager::getStore()
method. - Added
CryptoManager::getInstance()
method. - Added
CryptoManager::getEncrypter()
method. - Added
Headers::getBearerToken()
method.
- Deprecated the
AccessControlAllowOrigin
middleware. - Deprecated the
Route::namespace()
method. - Deprecated the
ConnectionManager::connection()
method. - Deprecated the
Connection::builder()
method. - Deprecated the
Connection::table()
method. - Deprecated the
ORM::builder()
method. - Deprecated
CacheManager::instance()
method. - Deprecated
CryptoManager::instance()
method.
- Better autocompletion when calling methods proxied by
__call
methods.
All deprecated features will be removed in Mako 8.0.
- PHP
8.1
compatibility.
- The default production error handler now has "dark mode" support.
- New and improved development error handler with "dark mode" support.
- Added
setMetadata
andgetMetadata
methods to theHttpException
class.- The
HttpException
metadata array is available in the production error views as$_metadata_
. - The
HttpException
metadata array will also be avaiable in the JSON and XML representation of the errors.
- The
- Template block names can now be surrounded by single quotes for consistency.
- The language cache has been removed as OPcache will cache the language files in memory and load them faster than any other cache solution.
- The ORM will now throw an exception when attempting to access related records on non-persisted models instead of loading random records.
- Fixed bug that could occur when building "non-clean" URLs in the command line.
- It is now possible to register contextual dependencies for class methods in the container.
- Added a HTTP status code helper class.
- Added missing status codes to
Response
class. - Added a
Retry
helper class that allows you to retry a callable a set number of times. - Added
Application::getStoragePath()
method. - Added a
Finder
class. - Added a
ClassFinder
class. - Added
app.generate_preloader
command that generates an opcache preloder script for improved production performance (only available on PHP7.4
and greater). - It is now possible for reactor commands to automatically register themselves.
- Added
getCommand
method to theCommandInterface
interface.
- Cloned database connections will now get a new PDO instance and have their query log and transaction nesting level reset.
- The
ClassInspector
class has been moved from themako\syringe
namespace to themako\classes
namespace.
- Fixed error that could occur when restoring GD snapshots on PHP
8.0
.
- Connection managers will now close connections before removing configurations when calling the
removeConfiguration
method.
- Fixed an issue where the path to the reactor executable would fail. (#283).
- Fixed an issue where the path to the application could prevent the development server from starting (#282).
- Fixes an issue where
ORM::toArray()
would fail when a related record isnull
(#279).
The major version bump is due to dropped support for PHP 7.2
and a several breaking changes. Most applications built using Mako 6.3.0
should run on Mako 7.0.0
with just a few simple adjustments.
- Added
Collection::first()
method. - Added
Collection::last()
method. - Added support for the
samesite
cookie option (defaults toLax
). - Added
Query::withCountOf()
method to the ORM query builder. - Added abstract
AccessControlAllowOrigin
middleware. - Added
Cookies::addRaw()
method. - Added
Cookies::addRawSigned()
method. - Added a
InputValidationTrait
for use in a controller context. - The Redis client now supports Redis 6 ACL as well as the new RESP3 protocol.
- The following "raw" query builder methods now support bound query parameters:
Join::onRaw()
Join::orOnRaw()
Query::selectRaw()
Query::orderByRaw()
Query::ascendingRaw()
Query::descendingRaw()
- The cache
StoreInterface::get()
method will now returnnull
instead offalse
when the item does not exist in the cache. - The following methods in the database library will now return
null
instead offalse
when no matching record is found:Connection::first()
Connection::column()
Query::first()
Query::column()
Query::get()
ORM::get()
- The following methods in the Gatekeeper library will now return
null
instead offalse
when unable to retrieve data:GroupRepositoryInterface::getByIdentifier()
GroupRepository::getById()
GroupRepository::getByName()
UserRepositoryInterface::getByIdentifier()
UserRepository::getByAccessToken()
UserRepository::getByActionToken()
UserRepository::getByEmail()
UserRepository::getById()
UserRepository::getByUsername()
- Passing a
Query
instance to theSubquery
constructor is no longer supported. - Passing a
Closure
orQuery
instance to represent a subquery to the following methods is no longer supported:Query::table()
Query::from()
Query::into()
Query::in()
Query::notIn()
Query::orIn()
Query::orNotIn()
Query::exists()
Query::orExists()
Query::notExists()
Query::orNotExists()
Query::with()
Query::withRecursive()
- Dropped support for
DB2
databases. - Removed the following deprecated methods from the
UploadedFile
class:UploadedFile::getName()
UploadedFile::getReportedType()
- Removed the following deprecated constants from the
Redirect
class:Redirect::MULTIPLE_CHOICES
Redirect::NOT_MODIFIED
Redirect::USE_PROXY
- Removed the following deprecated methods from the
Redirect
class:Redirect::multipleChoices()
Redirect::notModified()
Redirect::useProxy()
- Removed the following deprecated methods from the
ErrorHandler
class:ErrorHandler::disableLoggingFor()
- Removed the following deprecated validation rule aliases:
max_filesize
mimetype
- Removed the deprecated
commandInformation
property from theCommand
class. - Removed the following deprecated cache stores:
ZendDisk
ZendMemory
- Removed support for the deprecated "empty else" template syntax.
- Class aliases will no longer be registered during the application boot process.
- The Gatekeeper
Adapter::activateUser()
method will now always return a boolean value as described in the documentation. - Renamed the
InputValidationTrait::validate()
method toInputValidationTrait::getValidatedInput()
. - Removed the undocumented recursive configuration file merging.
- Renamed
Validator::validate()
toValidator::getValidatedInput()
.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
6.3.*.
- PHP
8.0
compatibility.
- PHP
8.0
compatibility.
- PHP
8.0
compatibility.
- Fixed issue that occurred when cloning queries that have set operations.
- Query pagination now works with queries that have set operations.
ManyToMany::unlink()
andManyToMany::updateLink()
now supports wheres.
- The error handler will now attempt to log logger exceptions using PHP's system logger.
- The old input from the
InputValidation
middleware will no longer be cast to an object before being assigned to views.
- The
ProgressBar::advance()
method will now throw aLogicException
when trying to advance past 100%.
- The
$ruleSets
parameter of theValidatorFactory
andValidator
constructors is now optional.
- Refactored the
InputValidation
middleware and added theHttpInputInterface
interface.
Request::isSecure()
will no longer fail ifREMOTE_ADDR
isn't set.
Request::getIp()
will no longer fail ifREMOTE_ADDR
isn't set.
- Added
TimeImmutable
class. - Added
Time::copy()
method. - Added
Time::getImmutable()
method. - Added
Redis::subscribeTo()
method. - Added
Redis::subscribeToPattern()
method. - Added
Redis::monitor()
method. - Added
UploadedFile::getReportedFilename()
method. - Added
UploadedFile::getReportedMimeType()
method. - Added
max_file_size
validation rule. - Added
mime_type
validation rule. - Added
max_filename_length
validation rule. - Added
SecurityHeaders
middleware. - Added
ContentSecurityPolicy
middleware. - Added
InputValidation
middleware. - Added
InputValidationTrait
trait that reduces the need for validation boilerplate. - Added
FileSystem::getDiskSize()
method. - Added
FileSystem::getFreeSpaceOnDisk()
method. - Added
JSON::getStatus()
method. - Added
JSON::getCharset()
method. - Added
Redirect::getStatus()
method. - Added
Stream::getType()
method. - Added
Stream::getCharset()
method. - Added
Response::getRequest()
method.
- The following methods have been deprecated and will be removed in
7.0
:UploadedFile::getName()
(replaced byUploadedFile::getReportedFilename()
)UploadedFile::getReportedType()
(replaced byUploadedFile::getReportedMimeType()
)Redirect::multipleChoices()
Redirect::notModified()
Redirect::useProxy()
- The following validation rules have been deprecated and will be removed in
7.0
:max_filesize
(replaced bymax_file_size
)mimetype
(replaced bymime_type
)
- Massive speed improvements when sending large values to Redis.
- Reduced number of method calls when hydrating models.
- The correct field name will now be displayed when using wildcard validation rules.
- Fixed breaking change introduced in
5.7.6
,6.0.5
,6.1.4
and6.2.2
.
- Fixed bug that could cause the production error handler to fail when using the view auto assign feature.
- Fixed breaking change introduced in
6.2.0
.
- New and improved command line argument parser.
- Added
Request::isCacheable()
method. - Added
Request::isIdempotent()
method. - Added
Response::isCacheable()
method. - Added
ValidationException::getMessageWithErrors()
method. - The query builder now supports multiple tables in the
FROM
clause.
- Commands are now required to define their arguments.
- The
Command::$isStrict
property doesn't do anything as all commands are required to define their arguments. - The
OPTIONS
andTRACE
request methods are now also considdered safe by theRequest::isSafe()
method.
- The
Command::$commandInformation
property is deprecated and will be removed in7.0
. - The
application.class_aliases
config key is deprecated and will be removed in7.0
. - The
ZendDisk
cache store is deprecated and will be removed in7.0
. - The
ZendMemory
cache store is deprecated and will be removed in7.0
. - Passing a
Closure
orQuery
instance to represent a subquery to the following methods is deprecated and will stop working in7.0
:Query::table()
Query::from()
Query::into()
Query::in()
Query::notIn()
Query::orIn()
Query::orNotIn()
Query::exists()
Query::orExists()
Query::notExists()
Query::orNotExists()
Query::with()
Query::withRecursive()
- Passing a
Closure
,Query
orSubquery
instance to the following methods is deprecated and will stop working in7.0
:Query::union()
Query::unionAll()
Query::intersect()
Query::intersectAll()
Query::except()
Query::exceptAll()
- Support for
DB2
databases is deprecated and will be removed in7.0
.
Check out the upgrade guide for details on how to upgrade from
6.1.*.
- Fixed breaking change introduced in
5.7.4
,6.0.4
and6.1.2
.
- PHP
7.4
compatibility.
- Package validation rule i18n messages will now work as expected.
- The server command will make up to 10 attempts to find an available port if the default one is in use.
- Added
Container::hasInstanceOf()
method. - It is now possible to send additional arguments to authorization policy methods.
- Added bitonal filter to the image library (#258).
- Added new collection methods:
Collection::with()
Collection::without()
- The following Collection methods are now chainable:
clear
each
put
remove
resetKeys
shuffle
sort
- Added support for common table expressions to the query builder.
Query::with()
Query::withRecursive()
- Added
Query::forCompiler()
method that can be used to add dialect specific SQL to queries. - Added
Query::selectRaw()
method. - Added
Query::whereColumn()
method. - Added query builder date helpers:
Query::whereDate()
Query::orWhereDate()
Query::betweenDate()
Query::orBetweenDate()
Query::notBetweenDate()
Query::orNotBetweenDate()
- MySQL and SQLite query builder queries now support offsets without limits.
- The query builder now supports select queries without a table.
- Added new syntax for default values in templates.
- The production web error handler no longer requires a view factory instance.
- It is now easier to override the storage path of compiled templates and log files using the new
application.storage_path
config key. - Added
ErrorHandler::dontLog()
method. - It is now possible to disable logging of specific exceptions types using the new
application.error_handler.dont_log
config key.
-
The
{{$foo || 'Default}}
and{{$foo or 'Default}}
template syntax has been deprecated and will be removed in7.0
use the{{$foo, default: 'Default'}}
syntax instead. -
The
ErrorHandler::disableLoggingFor()
method has been deprecated and will be removed in7.0
. Use the newErrorHandler::dontLog()
method instead.
Check out the upgrade guide for details on how to upgrade from
6.0.*.
- Images will now be rotated in the same direction when using ImageMagick and GD.
The major version bump is due to dropped support for PHP 7.0
and 7.1
and a several breaking changes. Most applications built using Mako 5.7.0
should run on Mako 6.0.0
with just a few simple adjustments.
- Added
optional
validation rule. - Added
time_zone
validation rule. - Added
Validator::validate()
method that returns the validated input on success and throws anValidationException
on failure. - The container will now inject
null
when unable to resolve a nullable or optional class dependency. - Added
Logger
class that extends the monolog logger with functionality to set global log context parameters (the gatekeeper user id will automatically be added if possible). - Added the
mako\cli\Environment
class with the following methods:Environment::getDimensions()
Environment::getWidth()
Environment::getHeight()
Environment::hasAnsiSupport()
- Added
Output::getEnvironment()
method. - Added
JSON::setCharset()
method. - Added
Stream::setType()
method. - Added
Stream::setCharset()
method. - Added
scope
method to the ORM query builder. - Added
UUID::toBinary()
method. - Added
UUID::toHexadecimal()
method. - Added
UUID::sequential()
method. - Added
Output::dump()
method. - Added authorization to the gatekeeper library.
- Removed the deprecated
FileSystem::mime()
method. - Removed the deprecated
FileSystem::hash()
method. - Removed the deprecated
FileSystem::hmac()
method. - The ORM query builder no longer supports "magic" scope methods. Use the
scope
method instead. - The
RequestException
class has been renamed toHttpException
. - Removed the
Constraint
base class. Constraints should implement theConstraintInterface
instead. - Constraints parameters are now injected through the constructor.
- Removed the
Middleware
base class. Middleware should implement theMiddlewareInterface
instead. - Middleware parameters are now injected through the constructor.
- Validator rule parameters are now injected via the constructor.
- Removed the
Output::hasAnsiSupport()
method. - The
mako\gatekeeper\Authentication
class has been renamed tomako\gatekeeper\Gatekeeper
. - Several of the
mako\http\Request
methods have been renamed for consistency:- The
Request::contentType()
method has been renamed toRequest::getContentType()
. - The
Request::scriptName()
method has been renamed toRequest::getScriptName()
. - The
Request::ip()
method has been renamed toRequest::getIp()
. - The
Request::basePath()
method has been renamed toRequest::getBasePath()
. - The
Request::baseURL()
method has been renamed toRequest::getBaseURL()
. - The
Request::path()
method has been renamed toRequest::getPath()
. - The
Request::language()
method has been renamed toRequest::getLanguage()
. - The
Request::languagePrefix()
method has been renamed toRequest::getLanguagePrefix()
. - The
Request::method()
method has been renamed toRequest::getMethod()
. - The
Request::realMethod()
method has been renamed toRequest::getRealMethod()
. - The
Request::username()
method has been renamed toRequest::getUsername()
. - The
Request::password()
method has been renamed toRequest::getPassword()
. - The
Request::referer()
method has been renamed toRequest::getReferrer()
.
- The
- Several of the
mako\http\request\Headers
methods have been renamed for consistency:- The
Headers::acceptableContentTypes()
method has been renamed toHeaders::getAcceptableContentTypes()
. - The
Headers::acceptableLanguages()
method has been renamed toHeaders::getAcceptableLanguages()
. - The
Headers::acceptableCharsets()
method has been renamed toHeaders::getAcceptableCharsets()
. - The
Headers::acceptableEncodings()
method has been renamed toHeaders::getAcceptableEncodings()
.
- The
- Several of the
mako\http\Response
methods have been renamed for consistency:- The
Response::body()
method has been renamed toResponse::setBody()
. - The
Response::charset()
method has been renamed toResponse::setCharset()
. - The
Response::status()
method has been renamed toResponse::setStatus()
. - The
Response::type()
method has been renamed toResponse::setType()
. - The
Response::cache()
method has been renamed toResponse::enableCaching()
. - The
Response::compress()
method has been renamed toResponse::enableCompression()
. - The
JSON::status()
method has been renamed toJSON::setStatus()
. - The
Redirect::status()
method has been renamed toRedirect::setStatus()
.
- The
- The
ExtendableTrait::extend()
method has been renamed toExtendableTrait::addMethod()
.
Check out the upgrade guide for details on how to upgrade from
5.7.*.
- Added optional
--exit-code
option tomigrate.status
command.
- It is now possible to eager load relations on a loaded model using the
ORM::include()
method. - It is now possible to eager load relations on a result set using the
ResultSet::include()
method. - Added
ORM::includes()
method that returnstrue
if a relation has been loaded andfalse
if not. - Added
PaginationInterface::toArray()
method. - Added
PaginationInterface::toJSON()
method. - The
PaginationInterface
interface now extends theJsonSerializable
interface. - The query builder now supports basic tuple comparisons.
- It is now possible to provide a list of superglobal keys to blacklist from the Whoops error view
- It is now possible to set raw cookies.
- Added
FileInfo
class that extendsSplFileInfo
with the following methods:FileInfo::getMimeType()
.FileInfo::getMimeEncoding()
.FileInfo::getHash()
.FileInfo::validateHash()
.FileInfo::getHmac()
.FileInfo::validateHmac()
.
- Added
FileSystem::info()
method that returns aFileInfo
object. - Added new validation rules:
- Added
hash
rule. - Added
hmac
rule. - Added
aspect_ratio
rule. - Added
exact_dimensions
rule. - Added
max_dimensions
rule. - Added
min_dimensions
rule.
- Added
- Removed the deprecated
mako\security\Password
class. - Removed the deprecated
ORM::$exists
property. - Removed the deprecated
ORM::exists()
method. - The gatekeeper
forceLogin
method now returnstrue
if the login is successful and a status code if not. - The JSON representation of a result set returned by the
Query::paginate()
method will now be an object where the results are available asdata
and pagination information will be available aspagination
({"data":[...], "pagination":{...}}
). - An exception will be thrown when trying to set a secure session or gatekeeper cookie over a non-secure connection.
- The URL builder will now separate query string parameters with
&
instead of&
. - The URL builder will now encode query string parameters using PHP_QUERY_RFC3986.
- Deprecated the
FileSystem::mime()
method. - Deprecated the
FileSystem::hash()
method. - Deprecated the
FileSystem::hmac()
method.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
5.6.*.
- Added
Request::basePath()
method. - Added
BelongsToPolymorphic
relation. - Added
ORM::$isPersisted
property. - Added
ORM::isPersisted()
method. - Added
Query::sharedLock()
convenience method. - It is now possible to use aggregate methods (
count
,min
,max
, etc...) in a subquery context. - Migrations are now executed in a transaction if possible (Postgres, SQLite).
- Added multi database support to migrations.
- Added an option to opt out of atomic
getOrElse
for APCU caching. Use theatomic_get_or_else
key. - Added
ConnectionManager::close()
method. - Added
ConnectionManager::executeAndClose()
method. - Added
Connection::close()
method (to the database base connection class). - Added new
json
validation rule. - Added new
array
validation rule. - You can now specify which IP version you're validating when using the
ip
validation rule. - Added
FileSystem::rename()
method. - It is now possible to set a custom timeout for Redis connections.
- Added new password hashing library:
- Added new
Bcrypt
hasher class. - Added new
Argon2i
hasher class. - Added new
Argon2id
hasher class.
- Added new
- Removed the global
--database
reactor option.
- Deprecated the
ORM::$exists
property. - Deprecated the
ORM::exists()
method. - Deprecated the
mako\security\Password
class.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
5.5.*.
- The
Str::slug()
method no longer strips dashes from the input string. - Added
hardware
,software
andfurniture
to the list of irregular words used byStr::pluralize()
.
- Improved handling of invalid i18n keys.
- Fixed issue where the
unique
rule would fail when used with case-insensitive databases.
- You can now use
or
in addition to||
when printing template variables. - You can now prefix variable names with a
$
in template capture blocks.
- The pagination factory no longer requires the view and http services.
- Added
Validator::rule()
helper method.
- Migrations will no longer fail with empty description.
- Added
Validator::extend()
method. - Added
Validator::addRules()
method. - Added
Validator::addRulesIf()
method. - Added
ValidatorFactory::extend()
method. - Added new validation rules:
- Added
mimetype
rule. - Added
max_filesize
rule. - Added
is_uploaded
rule.
- Added
- Removed
Response
methods that where deprecated in 5.4:- Removed the
Response::header()
method. - Removed the
Response::hasHeader()
method. - Removed the
Response::removeHeader()
method. - Removed the
Response::clearHeaders()
method. - Removed the
Response::cookie()
method. - Removed the
Response::signedCookie()
method. - Removed the
Response::deleteCookie()
method. - Removed the
Response::hasCookie()
method. - Removed the
Response::removeCookie()
method. - Removed the
Response::clearCookies()
method.
- Removed the
- Removed
Validator::registerPlugin()
method. - Removed
ValidatorFactory::registerPlugin()
method.
- New and improved input validation with support for nested arrays and file validation.
Check out the upgrade guide for details on how to upgrade from
5.4.*.
- Added
Application::startTime()
method. - The container now supports replacing previously registered/resolved items:
- Added
Container::replace()
method. - Added
Container::replaceSingleton()
method. - Added
Container::replaceInstance()
method. - Added
Container::onReplace()
method.
- Added
- Added
Request::contentType()
method. - Added
Response::reset()
method. - Added
mako\cli\output\Output::hasAnsiSupport()
method. - Added
mako\cli\output\Output::clearLine()
method. - Added
mako\cli\output\Output::clearLines()
method. - Added
mako\cli\output\formatter\Formatter::stripSGR()
method. - Added
mako\cli\output\formatter\FormatterInterface::stripTags()
method. - Added
mako\cli\output\helpers\ProgressBar::remove()
method. - Added
mako\cli\output\helpers\ProgressBar::setPrefix()
method.- Added optional
$prefix
parameter to theCommand::progressBar()
method.
- Added optional
- Added optional
$priority
parameter to themako\http\routing\Dispatcher::registerMiddleware()
method.
- The
Container::factory()
method is now public. - The
Request::getBody()
method now returns an instance ofmako\http\request\Body
. - Removed
Request
methods that where deprecated in 5.3:- Removed the
Request::get()
method. - Removed the
Request::post()
method. - Removed the
Request::put()
method. - Removed the
Request::patch()
method. - Removed the
Request::delete()
method. - Removed the
Request::cookie()
method. - Removed the
Request::signedCookie()
method. - Removed the
Request::file()
method. - Removed the
Request::server()
method. - Removed the
Request::has()
method. - Removed the
Request::data()
method. - Removed the
Request::whitelisted()
method. - Removed the
Request::blacklisted()
method. - Removed the
Request::header()
method. - Removed the
Request::acceptableContentTypes()
method. - Removed the
Request::acceptableLanguages()
method. - Removed the
Request::acceptableCharsets()
method. - Removed the
Request::acceptableEncodings()
method.
- Removed the
- Removed
Response
filters:- Removed the
Response::filter()
method. - Removed the
Response::getFilters()
method. - Removed the
Response::clearFilters()
method.
- Removed the
- The
Response::getHeaders()
method now returns a response header collection. - The
Response::getCookies()
method now returns a response cookie collection. - Removed the
mako\cli\output\formatter\Formatter::hasAnsiSupport()
method. - Removed the
mako\cli\output\formatter\FormatterInterface::strip()
method. - Arguments are now converted to camel case before being passed to the
execute
method of reactor commands.
- Deprecated the
Response::header()
method. - Deprecated the
Response::hasHeader()
method. - Deprecated the
Response::removeHeader()
method. - Deprecated the
Response::clearHeaders()
method. - Deprecated the
Response::cookie()
method. - Deprecated the
Response::signedCookie()
method. - Deprecated the
Response::deleteCookie()
method. - Deprecated the
Response::hasCookie()
method. - Deprecated the
Response::removeCookie()
method. - Deprecated the
Response::clearCookies()
method.
- Unit tests now run using PHPUnit 6.
- Removed unnecessary function calls in Redis client.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
5.3.*.
- The
Request::getData()
method will now return the parsed body for POST requests that do not contain form data.
- The
GD
image processor will no longer fail when using uppercase file extensions when saving.
- The
GD
image processor now usesimagecopyresampled
instead ofimagecopyresized
when resizing images.
- Columns with
null
values will no longer be updated unnecessarily when usingORM::save()
.
- Added
Connection::pairs()
method. - Added
Query::pairs()
method. - Added
Collection::merge()
method. Collection::map()
callables can now accept the item key as a second argument.Collection::filter()
callables can now accept the item key as a second argument.- It is now possible to auto assign variables to views using the
ViewFactory::autoAssign()
method. - JSON responses can now set the response status code.
- It is now possible to capture output in a template using the new
{% capture:name %}...{% endcapture %}
blocks. - Added
{% nospace %}...{% endnospace %}
blocks to template syntax that will remove all whitespace between HTML tags. - Added
PaginationInterface::isValidPage()
method. - Mako is now using Whoops for displaying exception details.
- It is now possible to register route constraints with the router.
- It is now possible to set and update junction attributes.
- Added
Request::getQuery()
method. - Added
Request::getPost()
method. - Added
Request::getHeaders()
method. - Added
Request::getCookies()
method. - Added
Request::getBody()
method. - Added
Request::getData()
method. - Added
Request::getFiles()
method. - Added
Request::getServer()
method. - Added
Parameters::whitelisted()
method. - Added
Parameters::blacklisted()
method.
- Moved the
ContainerAwareTrait
trait to themako\syringe\traits
namespace. - Moved the
ControllerHelperTrait
trait to themako\http\routing\traits
namespace. - Moved the
ConfigurableTrait
trait to themako\common\traits
namespace. - Moved the
ExtendableTrait
trait to themako\common\traits
namespace. - Moved the
FunctionParserTrait
trait to themako\common\traits
namespace. - Moved the
NamespacedFileLoaderTrait
trait to themako\common\traits
namespace. - The
Str::slug()
method now usesrawurlencode
instead ofurlencode
. - All HTTP middleware must now implement the
mako\http\routing\middleware\MiddlewareInterface
. - HTTP middleware is now registered with the route dispatcher.
- The
Route::when()
method has been renamed topatterns
. - Renamed the
Request::body()
method togetRawBody
. - Renamed the
Request::bodyAsStream
methodgetRawBodyAsStream
.
- Deprecated the
Request::get()
method. - Deprecated the
Request::post()
method. - Deprecated the
Request::put()
method. - Deprecated the
Request::patch()
method. - Deprecated the
Request::delete()
method. - Deprecated the
Request::cookie()
method. - Deprecated the
Request::signedCookie()
method. - Deprecated the
Request::file()
method. - Deprecated the
Request::server()
method. - Deprecated the
Request::has()
method. - Deprecated the
Request::data()
method. - Deprecated the
Request::whitelisted()
method. - Deprecated the
Request::blacklisted()
method. - Deprecated the
Request::header()
method. - Deprecated the
Request::acceptableContentTypes()
method. - Deprecated the
Request::acceptableLanguages()
method. - Deprecated the
Request::acceptableCharsets()
method. - Deprecated the
Request::acceptableEncodings()
method.
Deprecated methods will be removed in 5.4.0.
Check out the upgrade guide for details on how to upgrade from
5.2.*.
- Fixes issue that prevents accidental login after logout. The issue would occur if the
mako\gatekeeper\adapters\Session::getUser()
method got called after themako\gatekeeper\adapters\Session::logout()
method if the user had a "remember me" cookie.
- The
Memcache::putIfNotexists()
andMemcached::putIfNotexists()
methods will now support TTLs longer than 30 days.
- Errors will now be logged even if the default error handler isn't called.
ManyToMany::synchronize()
will no longer execute unnecessary and invalid queries that cause exceptions.
- Package config overrides will now merge properly with original config.
- Package config overrides now merges with original config.
- Now possible to insert databases rows with only default values.
- Added
ManyToMany::alongWith()
method.
- Batch queries will no longer fail when having criteria.
- Will now automatically unlock locked used accounts when the lock time has expired.
- Fixed language cache bug that was introduced in 5.2.0.
- Added
putIfNotexists()
method to all cache adapters. - The
apcu
,memcached
,memory
,null
andredis
cache stores now implement the newmako\cache\stores\IncrementDecrementInterface
interface. - Added
Collection::getValues()
method. - Added
Collection::each()
method. - Added
Collection::map()
method. - Added
Collection::filter()
method. - It is now possible to pass custom PDO options to a connection.
- It is now possible to format numbers in i18n strings using the
<number>
tag.
- The
Gatekeeper
library has been rewritten. It is now possible to implement custom authentication adapters. - The
Gatekeeper::basicAuth()
method will now always return a boolean value. - Headers will now be set with the case that they where defined with.
- The
CacheManager::instance()
method now returns amako\cache\stores\StoreInterface
instance instead of amako\cache\Cache
instance.
- The reactor
--env
flag now works as expected.
- The ORM will now use fully qualified column names in the relation query criterion.
- Various improvements and optimizations.
Check out the upgrade guide for details on how to upgrade from
5.1.*.
- Request::getParsed() no longer fails if the content type header contains a character set.
- The function parser is now less strict when it comes to function names.
- JSONP responses are now handled by the JSON response builder.
- Added a optional
NullableTrait
to the ORM. - Added
Command::STATUS_SUCCESS
constant. - Added
Command::STATUS_ERROR
constant. - Added
cache.remove
command. - Added
cache.clear
command. - Added
application.base_url
config key. - Now possible to set middleware priority.
- The ORM now allows you to configure the foreign key name using the
$foreignKeyName
property.
- The response class will no longer auto render views. Views should be rendered in the controller.
- Removed the query convenience trait.
- Removed support for "piped" validation rules.
- New syntax for passing parameters to middleware.
- New syntax for passing parameters to validation rules.
- ORM::getForeignKey() now uses Str::camel2underscored() instead of strtolower().
Check out the upgrade guide for details on how to upgrade from
5.0.*.
- Query compiler will now properly escape JSON path segments.
- MySQL query compiler will now unquote extracted JSON values.
- The query builder now supports set operations.
- Now possible to customize the width of progressbars.
- Deprecated the query convenience trait. It will be removed in Mako 5.1.0.
- The image library will now show an error when trying to open a unsupported image type.
- Various optimizations.
- Now possible to return a status/exit code from reactor commands.
- Reverted breaking changes to compiled templates that were introduced in 5.0.17.
- CLI error handler will no longer fail when displaying a generic error message.
- Now possible to update JSON values using the unified JSON query syntax.
- Now possible to bind parameters to raw SQL when using the query builder.
- Various optimizations.
- Now possible to access route parameters outside route actions.
- Migration rollback now works as expected.
- Various optimizations.
- Don't resolve singletons multiple times when using the container aware trait.
- Fixed an issue where strict reactor commands would fail when called with a "global" option.
- Fixed issue with
Gatekeeper::forceLogin()
.
- Error handler now supports
xdebug.overload_var_dump
.
ORM::toArray()
will no longer try to convertfalse
to an array.
- Corrected the return type of the
View::assign()
method.
- The
$shouldTouchOnInsert
,$shouldTouchOnUpdate
and$shouldTouchOnDelete
properties of theTimestampedTrait
now work as expected.
- The redis client now supports dash-separated commands.
- Checking a ORM relation with
isset()
will now lazy load it if it hasn't already been loaded.
- The redis client will no longer assume that it has recieved the data it asked for.
- The Redis client now reads data in 4096 byte chunks to avoid issues with large values.
Request::file()
now returnsUploadedFile
objects.
- Redis cache store is now instantiated with the configured class whitelist.
- Added
Connection::yield()
andQuery::yield()
methods that allow you to iterate over result sets using a generator.
- Fixed
Query::first()
fetch mode bug.
- Query pagination now works as expected with distinct selections.
Query::countDistinct()
now supports an array of columns names.
- Simplified stack trace for JSON error responses.
- Query pagination now works as expected with grouping.
- The output escaper now accepts null values.
- Fixed validation bug.
- The query builder now supports row-level locking.
- The query builder now has a unified syntax for querying JSON fields.
- New and simplified pagination functionality when using the query builder.
- Added
Query::havingRaw()
method. - Added
Query::orHavingRaw()
method. - Added
Query::columns()
method. - Added
Query::countDistinct()
method. - Added support for transaction savepoints.
- Added
Collection::extend()
method. - Added cluster support to the Redis client.
- Added IPv6 support to the Redis client.
- Added support for persistent connections to the Redis client.
- Now possible to define verbatim template blocks.
- Now possible to pass extra variables to included templates.
- Custom cache stores can be added using the
CacheManager::extend()
method. - Custom encrypters can be added using the
CryptoManager::extend()
method. - Added IPv4 and IPv6 utilities.
- You can now set a subnet when setting the IP adresses of trusted proxies.
- The character set will automatically be added to RSS and ATOM content-type headers.
- Added support for contextual dependency injection.
- You now have to whitelist the classes you want the framework to deserialize (cache and session stores).
- Added
FileSystem::hash()
method. - Added
FileSystem::hmac()
method. - Added
app.generate_key
command that can be used to generate secure encryption keys. - Added unordered list CLI output helper.
- Added ordered list CLI output helper.
- Added
Output::clear()
method. - Reactor will now suggest a task or option name if an invalid one is used.
- Added support for strict commands.
- Added FireTrait that makes it easier to call a command from within a command.
Query::null()
has been renamed toQuery::isNull()
.Query::orNull()
has been renamed toQuery::orIsNull()
.Query::notNull()
has been renamed toQuery::isNotNull()
.Query::orNotNull()
has been renamed toQuery::orIsNotNull()
.Query::all()
now returns a result set instead of an array.- ORM read-only functionality is now handled using a trait.
- The
ORM::isReadOnly()
method has been removed. - ORM records will no longer be made read-only when using joins.
- ORM values can now be casted to intergers using
int
instead ofinteger
. - ORM values can now be casted to booleans using
bool
instead ofboolean
. - An exception will be thrown when trying to get a non-existing item from collection.
- The
HTML::registerTag()
method has been removed. UseHTML::extend()
instead. - Routing middleware replaces route filters.
- The
Routes::methods()
method has been renamed toRoutes::register()
. - The
Route::setNamespace()
method has been renamed toRoute::namespace()
. - The
Controller::beforeFilter()
has been renamed toController::beforeAction()
. - The
Controller::afterFilter()
has been renamed toController::afterAction()
. - Custom view renderers must now be added using the
ViewFactory::extend()
method. - Removed the
APC
andXCache
cache stores. - Removed the
Response::file()
method. - Removed the
Response::stream()
method. - Removed the
Response::redirect()
method . - Removed the
Response::back()
method. - Added a ControllerHelperTrait with the following methods:
fileResponse
,streamResponse
,redirectResponse
,jsonResponse
andjsonpReponse
. - Removed the MCRYPT encrypter.
- Removed the
Crypto::encryptAndSign()
andCrypto::validateAndDecrypt()
methods. All encrypted data is now signed and validated by default. - Renamed
FileSystem::includeFile()
toFileSystem::include()
. - Renamed
FileSystem::requireFile()
toFileSystem::require()
. - Renamed
FileSystem::includeFileOnce()
toFileSystem::includeOnce()
. - Renamed
FileSystem::requireFileOnce()
toFileSystem::requireOnce()
. - Renamed
FileSystem::isDirectoryEmpty()
toFileSystem::isEmpty()
. - Renamed
FileSystem::exists()
toFileSystem::has()
. - Renamed
FileSystem::delete()
toFileSystem::remove()
. - Renamed
FileSystem::getContents()
toFileSystem::get()
. - Renamed
FileSystem::putContents()
toFileSystem::put()
. - Renamed
FileSystem::prependContents()
toFileSystem::prepend()
. - Renamed
FileSystem::appendContents()
toFileSystem::append()
. - Renamed
FileSystem::truncateContents()
toFileSystem::truncate()
.
- Miscellaneous improvements and optimizations.
Mako 5.0 is a major version update that contains a few minor breaking changes. Make sure to read the upgrade instructions!
- Fixed the docblock return type for
CacheManager::instance()
.
Container::call()
now supports function calls in addition to closure and method calls.
URLBuilder::toRoute()
will now allow falsy parameters (0, 0.0, '0').
- Fixed a leap year related bug in the
Time
class.
- Less restrictive version requirements of third party libraries.
- Cache will now throw an exception if the store is unavailable.
- ETag caching will now work as expected when using mod_deflate with Apache > 2.4.0.
- Better support for routes containing multibyte characters.
- PHP7 compatibility.
- The query builder can now generate working SQLite queries with an
IN
clause where the values come from a subquery. - The
before
andafter
validation filters will now work as expected.
- The query builder now supports joins with nested conditions.
- The
before
andafter
validation filters will now work as expected.
- Only include
pages
array in pagination data whenmax_page_links
> 0.
- Clean URLs should now work as expected when using the local development server.
- The progress bar will no longer fail when
0
is passed as the item count.
- Better parameter binding for prepared statements.
This update requires you to change the data type of the
users.banned
andusers.activated
fields fromSET
toBOOL
(orTINYINT(1)
).
- The
Pagination::paginate()
method is now public.
- Eager loading criteria now work as expected when eager loading in chunks.
- Now possible to eager load more than 1000 unique ids when using SQLite and Oracle (#151).
- Now possible to send multiple headers with the same field-name.
- Added
Request::getRoute()
method. - Added
Response::hasHeader()
method. - Added
Response::hasCookie()
method. - Added
Response::removeCookie()
method. - Added
Image::getHeight()
method. - Added
Image::getWidth()
method. - Added
Image::getDimensions()
method. - Added brute force throttling to the Gatekeeper library.
- Added a command bus library #138.
- New and improved event handler.
Str::slug()
will now encode non-ascii characters as recommened by RFC-3986.- Minor changes in the application and package directory structures.
- Added brute force throttling settings to the
app/config/gatekeeper.php
configuration file. - Added 3 new fields to the gatekeeper users table.
- Now possible to select a custom set of columns through a many-to-many relation.
- Various optimizations.
This release comes with a few minor breaking changes. Check out the migration guide here.
- Fixed bug in
app.routes
command.
- Fixed language cache issue.
Query::column()
andQuery::first()
will now generate a more optimized query.
- The command line error handler will now include the error location in the output.
- Added
Output::setFormatter()
method. - Added
Output::isMuted()
method.
- The redis client will no longer try to authenticate when no password is provided.
- Controllers no longer need to extend the Mako base controller.
- Global reactor options are now sorted alphabetically.
- You can now separate package booting into
core
,web
andcli
.
This update requires a small change to the
app/config/application.php
configuration file.
- Brand new reactor command line tool.
- Added optional
$column
parameter to theQuery::column()
method. - Added Mako core class.
- Added
Password::needsRehash()
method. - Added
Request::isSafe()
method. - Added
Session::getToken()
method. - Added
Session::regenerateToken()
method. - Added
Session::validateToken()
method. - Added
token
validation rule. - Gatekeeper will automatically rehash passwords if needed.
- Added
attribute
,css
,url
andjs
escaping filters. - Escape filters are now also available in plain PHP views.
- Moved
init.php
file from the framework core to the application. - Removed the
MAKO_VERSION
constant (useMako::VERSION
instead). - Removed the
Password::isLegacyHash()
method. - Removed the
$legacyCheck
parameter from thePassword::validate()
method. - Renamed
Session::generateToken()
method toSession::generateOneTimeToken
. - Renamed
Session::validateToken()
method toSession::validateOneTimeToken
. - Renamed
token
validation rule toone_time_token
.
This release comes with a few minor breaking changes. Check out the migration guide here.
- Gatekeeper will use the provided "auth_key" configuration value.
- Fixed validation bug.
- Fixed routing bug.
- Added
ViewFactory::exists()
method. - Views are now cascading. This means that you can override package views in your application.
- Language files are now cascading. This means that you can override package language files in your application.
- Mako now includes default 403, 404, 405 error views that can easily be overriden.
- The ORM will now also forward non-static calls to the query builder.
- Added
Connection::table()
convenience method. - Added
Container::call()
method (#116). - Route actions are now executed by the
Container::call()
method (#118). - Route filters are now executed by the
Container::call()
method (#119). - Added a session NULL store.
- Moved all http exceptions to the
mako\http\exceptions
namespace. - Renamed the
PageNotFoundException
toNotFoundException
. - Controllers, Tasks and Migrations now use the
ContainerAwareTrait
trait by default. - The
ORM::builder()
method is now public. - The
Route::constraints()
method has been renamed toRoute::when()
.
This release comes with a few minor breaking changes. Check out the migration guide here.
- Fixed query builder bug.
- Fixed MCrypt autoloading issue (#120).
- Added
Time::formatLocalized
method. - Added
TimeZone
class. - Added a Stopwatch class (#113).
- Added support for nested template extension.
- Added optional migration descriptions.
- Added
render
shortcut method to the view factory class. - It is now possible to configure Gatekeeper to identify users using their username instead of their email.
- The
Time
class has been moved to the tomako\chrono
namespace. - The
locale
config option has been removed. You now have to set the appropriate locale for each language instead. - The
ViewFactory::create
method will now return an instance ofmako\view\View
instead of an implementation ofmako\view\renderers\RendererInterface
. - Moved
app/routes.php
toapp/routing/routes.php
. - Filters must now be defined in
app/routing/filters.php
. - You can now use class filters in addition to closures.
- The
UrlBuilder::current
method will now include the current query parameters by default. - Default Mcrypt encryption mode changed from ECB to CBC.
- Removed the
app/packages
directory. Packages will now be installed in the packagist vendor directory. - Removed the global helper functions. They have been replaced with a trait and a class (NamespacedFileLoaderTrait and ClassInspector).
This release comes with a few minor breaking changes. Check out the migration guide here.
- Fixed issue with date casting in the ORM.
- Added missing returns in gatekeeper user implementation.
- Added sepia filter to the image library.
- Added negate filter to the image library.
- Added pixelate filter to the image library.
- Added brightness adjustment to the image library.
- Added sharpening to the image library.
- Now possible to create and restore temporary snapshots when using the image library.
- Added support for language caching.
- Added Connection::isAlive() method.
- Added Connection::reconnect() method.
- Added Connection::beginTransaction() method.
- Added Connection::commitTransaction() method.
- Added Connection::rollBackTransaction() method.
- Added Connection::getTransactionNestingLevel() method.
- Added Connection::inTransaction() method.
- It is now possible to configure the ORM to automatically typecast values.
- PageNotFoundExceptions now includes the request method and path (#108).
- Now possible to register custom view renderers without having to implement a custom view factory.
- Added Application::isCommandLine() method.
- Added ErrorHandler::disableLoggingFor() method.
- The logger and errorHandler services are no longer required for an application to work.
- Removed the the ORM::$dateTimeColumms property. Use the new typecast feature instead.
- Selecting specific columns when using the ORM will no longer make the records read-only. Joining however, will do.
You must also add the
language_cache
key to your application configuration file.
- Now possible to configure the date output format when converting ORM records to array and/or json.
- Escape exception message in debug template.
- Improved ORM::toArray() and ORM::toJson methods.
- Fixed bug in the file based cache store.
- Image library now uses the correct image quality when saving.
- Image library watermarking now works as expected.
- The error handler is no longer loading external JavaScript libraries.
- Namespaced the helper functions to avoild naming collisions with global functions.
- Added
mako\get_class_traits()
helper function to improve detection of trait usage.
- Fixed bug where User::isMemberOf would return NULL if group id was used instead of group name.
Mako 4.0.0 is a complete rewrite where the main focus has been on improving testability, extensibility, security and the overall quality of the framework.
Mako 4 also includes a bunch of new features. Here are some of them:
- A new and improved RESTful routing system
- A brand new authentication library
- A smart and easy to use dependecy injection container
- Timestamped and OptimisticLocking traits for the ORM
- An image manipulation library that supports both GD and ImageMagick
Check out the documentation for the full list of changes.
Note that this is
NOT
a one step upgrade but the API changes have been kept to a minimum so upgrading a project from Mako 3.6.x shouldn't pose too many problems.