Phalcon v4.1.0 Release Notes
Release Date: 2020-10-31 // about 4 years ago-
๐ Supported PHP Versions: 7.2, 7.3, 7.4
โ Added
- โ Added JWT (JSON Web Tokens) support under
Phalcon\Security\JWT
. Offers support for:- Token
- Parser
- Builder
- Validator
- Signers (None, HMAC)
- Base64 encode/decodeUrl helper class
#13856
- โ Added additional HTML helpers under
Phalcon\Html\Helper
:Anchor
,Base
,Body
,Button
,Close
,Element
,Form
,Img
,Input\Color
,Input\Date
,Input\DateTime
,Input\DateTimeLocal
,Input\Email
,Input\File
,Input\Hidden
,Input\Image
,Input\Input
,Input\Month
,Input\Numeric
,Input\Password
,Input\Range
,Input\Select
,Input\Search
,Input\Submit
,Input\Tel
,Input\Text
,Input\Textarea
,Input\Time
,Input\Url
,Input\Week
,Label
,Link
,Meta
,Ol
,Script
,Style
,Title
,Ul
#14696 - โ Added
Phalcon\Http\Request::getPreferredIsoLocaleVariant()
to return the base language if this is a specific one (en
vsen-US
) #3135 - โ Added
preload
for Volt, which will send a HTTP/2 preload header #13128 - โ Added
Phalcon\Helper\Arr::blackList()
to exclude elements of an array by the keys obtained from the elements of a blacklist #14801 @TimurFlush - โ Added
Phalcon\Debug::renderHtml()
to get a HTML representation of the exception #14794 @TimurFlush - โ Added
Phalcon\Mvc\Router\Annotations->setActionPreformatCallback($callback)
to set a callback which pre-formats actions to custom pattern #14819 - โ Added new PDO wrapper for the Data Mapper implementation, with decorated instance, locator and profiler
Phalcon\DataMapper\Pdo\Connection
Phalcon\DataMapper\Pdo\Connection\Decorated
Phalcon\DataMapper\Pdo\Profiler\Profiler
Phalcon\DataMapper\Pdo\Profiler\MemoryLogger
Phalcon\DataMapper\Pdo\ConnectionLocator
This component will be used in the Data Mapper implementation but can be used as a stand alone component for PDO connections. #14733
- โ Added new Query Builder, as well as a factory, for the Data Mapper implementation supporting CRUD with bound parameters
Phalcon\DataMapper\Query\Bind
Phalcon\DataMapper\Query\Delete
Phalcon\DataMapper\Query\Insert
Phalcon\DataMapper\Query\Select
Phalcon\DataMapper\Query\Update
Phalcon\DataMapper\Query\QueryFactory
๐ This component can be used to create SQL statements using a fluent interface. Optionally the statements can be executed from the builder itself using theDataMapper\Pdo
connection. #14734
- โ Added
Phalcon\Mvc\Micro\LazyLoader::getHandler()
to return real handler when using lazy loaded controllers forPhalcon\Mvc\Micro
#14871 @Jurigag - โ Added
Phalcon\Collection\CollectionInterface
andPhalcon\Config\ConfigInterface
to use as typehints when extending or implementing custom classes #15106 @BeMySlaveDarlin - โ Added
Phalcon\Db\Adapter\AdapterInterface::getDefaultValue()
andsupportsDefaultValue()
methods to properly support theDEFAULT
keyword #15180 - โ Added
Phalcon\Db\Adapter\AbstractAdapter::supportsDefaultValue()
method to properly support theDEFAULT
keyword #15180
๐ Changed
- โ Added service checks for the session. Now cookies will be saved in the session only when the
session
service is defined #11770, #14649 - ๐ Changed
Phalcon\Db\Adapter\*::getRawSQLStatement()
to return the full SQL query with parameters #12196 - ๐ Changed
Phalcon\Filter::sanitize
to throw aE_USER_NOTICE
when a filter does not exist. #14679 - ๐จ PHQL now supports the use of any printable characters from the extended ASCII table for escaped identifiers. The exception characters are
[
and]
. To use[
and]
escape they (\[
,\]
) #14535 - โ Removed UTF-8 charset when using
Phalcon\Http\Response::setJsonContent
to apply with rfc7159 - ๐ Changed the visibility of properties in
Phalcon\Http\Message\Uri
to work withclone
. #15040 - ๐ Change
Phalcon\Validation\AbstractValidator::__construct
. Save custom validator message in options. #15053 @ivan-zolotavin - โ Add proxy methods without
_
prefix in methods names:getRelatedRecords()
,groupResult()
,exists()
,preSaveRelatedRecords()
,preSave()
,doLowUpdate()
,postSaveRelatedRecords()
,postSave()
,cancelOperation()
,doLowInsert()
,getConnection()
,getConnectionService()
,getVersion()
,getSpecial()
#14971 - Modified
Phalcon\Mvc\Model\Relation
to accept callable params for model relations. #15158
๐ Fixed
- ๐ Fixed
Phalcon\Db\Dialect\Mysql::getColumnDefinition
to recognizesize
forDATETIME
,TIME
andTIMESTAMP
columns #13297 - ๐ Fixed
Phalcon\Events\Manager
to provide callable support #13322, #15045 - ๐ Fixed
Phalcon\Validation\Validator\Uniqueness
fixed except query #15084 - ๐ Fixed
Phalcon\Mvc\Model
to also check the params option in cascade relations when deleting #15098 - ๐ Fixed
Phalcon\Mvc\Model
to also check the params option in restricted relations when deleting #15172 - ๐ Fixed
Phalcon\Mvc\Model::findFirst()
to return correct value #15077 - ๐ Fixed
Phalcon\Mvc\Model\CriteriaInterface::where()
parameters #15144 - ๐ Fixed
Phalcon\Http\Response\Cookies::set()
to utilize the options parameter correctly #15129 - ๐ Fixed
Phalcon\Http\Cookie::send()
to defineoptions
parameter #15142 - ๐ Fixed
Phalcon\Crypt
performance issues. #15118 - ๐ Fixed
Phalcon\Mvc\Router\Route
unicode support in patterns #15102 - Fixed fatal error in
Phalcon\Mvc\Model::cloneResultMap()
when column map is used withorm.cast_on_hydrate
turned on. #14617 - ๐ Fixed
Phalcon\Mvc\Model::sum()
,average()
,minimum()
,maxmium()
,count()
to utilize the transaction parameter. #15113 - ๐ Fixed
Phalcon\Mvc\Model::__set()
to cleardirtyRelated
when empty array is set. #14822 - ๐ Fixed
Phalcon\Mvc\Model
to skip columns with default values when theDEFAULT
keyword is not supported by the database adapter (SQLite) #15180 - ๐ Fixed
Phalcon\Mvc\Router
to handle numeric routes properly #14926 - ๐ Fixed
Phalcon\Session\Adapter\Redis
andPhalcon\Session\Adapter\Libmemcached
to utilize the prefix option #15184 - ๐ Fixed
Phalcon\Mvc\Model
to save the modified properties of previously queried single related records. #15148
โ Removed
- โ Removed
Phalcon\Http\Cookie
binding to session #11770Phalcon\Http\Cookie
no longer depends on the session service and data will not be duplicated in the session. This made it difficult to use cookies in stateless applications (SPA).
- โ Removed unused property
Phalcon\Mvc\Router::uriSource
. #15123
- โ Added JWT (JSON Web Tokens) support under
Previous changes from v4.0.6
-
๐ Supported PHP Versions: 7.2, 7.3, 7.4
๐ Changed
- ๐ Changed
Volt::convertEncoding
to no longer usingiconv
for a fallback since it causes issues with macOS #14912 - ๐ Changed schema manipulation in
Phalcon\Db\Dialect\Mysql
- unquote numerical defaults #14888, #14974 - ๐ Changed the default ACL access level from boolean
FALSE
toEnum::DENY
#14974 - ๐ Changed the way
Phalcon\Http\Response::__construct
checkscontent
data type. Now aTypeError
will be thrown if incompatible data type was passed #14983 - ๐ Changed return type hints of the following
Phalcon\Flash\FlashInterface
's methods:error
,message
,notice
,success
andwarning
#14994 - ๐ Changed return type hint for
Phalcon\Mvc\ModelInterface::sum
#15000 - ๐ Changed return type for
Phalcon\Mvc\Model\Criteria::getLimit
so that integer, NULL or array will be returned #15004 - ๐ Changed return type hint for
Phalcon\Mvc\Model\Manager::getCustomEventsManager
to return NULL instead of boolean FALSE if there is no special events manager #15008 - ๐ Changed
Phalcon\Mvc\Model\MetaData::getDI
so that now it will throw aPhalcon\Mvc\Model\Exception
if there is noDiInterface
instance #15011 - ๐ Changed
Phalcon\Http\Request::getJsonRawBody
to usejson_decode
instead ofPhalcon\Json::decode
#14936 - ๐ Changed
Phalcon\Factory\AbstractFactory
to exposegetService
which will throw an exception if it does not exist. RemovedcheckService
and adjusted all references innewInstance()
calls. #15038 - ๐ Changed the visibility of methods and properties in
Phalcon\Http\Message\Response
,Phalcon\Http\Message\ServerRequest
andPhalcon\Http\Message\Uri
to work withclone
. #15040
๐ Fixed
- ๐ Fixed
Phalcon\Mvc\Model\Query\Builder::getPhql
to add single quote between string value on a simple condition #14874 - ๐ Fixed recognizing language operators inside Volt's echo mode (
{{ ... }}
) #14476 - ๐ Fixed
Tag::friendlyTitle
to correctly convert titles under MacOS and Windows #14866 - ๐ Fixed the Volt compiler to no longer parse
cache
fragments and thus searching for theviewCache
service (deprecated for v4) #14907 - ๐ Fixed
IN
operator precedence in Volt #14816 - ๐ Fixed testing suite to work with PHPUnit 9 when we upgrade #14837
- ๐ Fixed return type hints of the following
Phalcon\Acl\AbstractAdapter
's methods:getActiveAccess
,getActiveRole
andgetActiveComponent
#14974 - ๐ Fixed default value of the following
Phalcon\Annotations\Annotation
's properties:$arguments
and$exprArguments
#14977 - ๐ Fixed return type hints of the following
Phalcon\Annotations\Annotation
's methods:getArgument
,getName
andgetNamedArgument
#14977 - ๐ Fixed incorrect return type hint for
Phalcon\Http\Response\Cookies::setSignKey
#14982 - ๐ Fixed return type hints for
Phalcon\Config\ConfigFactory::load
andPhalcon\Config\ConfigFactory::newInstance
to explicitly indicate the return type asPhalcon\Config
instance #14978 - ๐ Fixed return type hints for the following methods #14987:
Phalcon\Dispatcher\AbstractDispatcher::dispatch
Phalcon\Dispatcher\DispatcherInterface::dispatch
Phalcon\Filter::get
Phalcon\Http\Message\AbstractCommon::cloneInstance
Phalcon\Http\Message\AbstractCommon::processWith
Phalcon\Http\Message\AbstractMessage::withAddedHeader
Phalcon\Http\Message\AbstractMessage::withBody
Phalcon\Http\Message\AbstractMessage::withHeader
Phalcon\Http\Message\AbstractMessage::withProtocolVersion
Phalcon\Http\Message\AbstractMessage::withoutHeader
Phalcon\Http\Message\AbstractRequest::withMethod
Phalcon\Http\Message\AbstractRequest::withRequestTarget
Phalcon\Http\Message\AbstractRequest::withUri
Phalcon\Mvc\Model\Binder::findBoundModel
Phalcon\Validation::getEntity
Phalcon\Validation\ValidationInterface::getEntity
- ๐ Fixed default value of
Phalcon\Crypt::$key
to satisfy the interface #14989 - ๐ Fixed return type hint for
Phalcon\Di::getInternalEventsManager
#14992 - ๐ Fixed return type hints of the following
Phalcon\Flash\AbstractFlash
's methods:error
,notice
,success
andwarning
#14994 - ๐ Fixed return type hint for
Phalcon\Translate\InterpolatorFactory::newInstance
#14996 - ๐ Fixed return type hint for
Phalcon\Mvc\Model::sum
#15000 - ๐ Fixed return type hint for
Phalcon\Mvc\Model\CriteriaInterface::getLimit
andPhalcon\Mvc\Model\Criteria::getLimit
to follow documentation and original purpose #15004 - ๐ Fixed return type hint for
Phalcon\Mvc\Model::count
andPhalcon\Mvc\ModelInterface::count
to reflect original behavior #15006 - ๐ Fixed return type hint for
Phalcon\Mvc\Model::getEventsManager
to reflect original behavior #15008 - ๐ Fixed return type hint for
Phalcon\Mvc\Model::average
andPhalcon\Mvc\ModelInterface::average
to reflect original behavior #15013 - ๐ Fixed return type hint for
Phalcon\Mvc\Model\MetaData::getColumnMap
andPhalcon\Mvc\Model\MetaData::getReverseColumnMap
to reflect original behavior #15015 - ๐ Fixed return type hint for
Phalcon\Mvc\Model\MetaDataInterface::getColumnMap
andPhalcon\Mvc\Model\MetaDataInterface::getReverseColumnMap
to reflect original behavior #15015 - ๐ Fixed return type hint for
Phalcon\Mvc\Model\CriteriaInterface::getColumns
andPhalcon\Mvc\Model\Criteria::getColumns
to reflect original behavior #15017 - ๐ Fixed return type hint for
Phalcon\Db\Column::getSize
andPhalcon\Db\ColumnInterface::getSize
to reflect original behavior #15019 - ๐ Fixed return type hint for
Phalcon\Db\Column::getAfterPosition
andPhalcon\Db\ColumnInterface::getAfterPosition
to reflect original behavior #15021 - ๐ Fixed return type hint for
Phalcon\Mvc\Model\Manager::executeQuery
andPhalcon\Mvc\Model\Manager::ManagerInterface
to reflect original behavior #15024 - ๐ Fixed return type hint for
Phalcon\Mvc\Model\Resultset::getFirst
andPhalcon\Mvc\Model\ResultsetInterface::getFirst
to reflect original behavior #15027 - โช Rollback the regression changes for
Phalcon\Mvc\Model\Query::_prepareSelect
to properly prepare a SQLSELECT
statement from a PHQL one #14657 - ๐ Fixed
SerializerInterface
usage forPhalcon\Mvc\Model\Resultset\Complex::unserialize
as well asPhalcon\Mvc\Model\Resultset\Complex::unserialize
#14942
โ Removed
- โ Removed
Phalcon\Translate\InterpolatorFactory::$mapper
as well asPhalcon\Translate\InterpolatorFactory::$services
in favor ofPhalcon\Factory\AbstractFactory
ones #15036
- ๐ Changed