We are very happy to announce the release of Phalcon v4.1.0!
This release offers new features requested by the community as well as bug fixes reported by the community.
As per our blog post The future of Phalcon, this will be the last version we release for Phalcon as a PHP extension.
Huge thanks to our contributors that reported issues, offered input as well as submitted pull requests with additions and corrections!
NOTE : You can always check our roadmap and the status of our active sprint for v5 in our project page: https://github.com/orgs/phalcon/projects/5
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 (envsen-US) #3135 - Added
preloadfor 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\ConnectionPhalcon\DataMapper\Pdo\Connection\DecoratedPhalcon\DataMapper\Pdo\Profiler\ProfilerPhalcon\DataMapper\Pdo\Profiler\MemoryLogger-
Phalcon\DataMapper\Pdo\ConnectionLocatorThis 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\BindPhalcon\DataMapper\Query\DeletePhalcon\DataMapper\Query\InsertPhalcon\DataMapper\Query\SelectPhalcon\DataMapper\Query\Update-
Phalcon\DataMapper\Query\QueryFactoryThis component can be used to create SQL statements using a fluent interface. Optionally the statements can be executed from the builder itself using theDataMapper\Pdoconnection. #14734
- Added
Phalcon\Mvc\Micro\LazyLoader::getHandler()to return real handler when using lazy loaded controllers forPhalcon\Mvc\Micro#14871 @Jurigag - Added
Phalcon\Collection\CollectionInterfaceandPhalcon\Config\ConfigInterfaceto use as typehints when extending or implementing custom classes #15106 @BeMySlaveDarlin - Added
Phalcon\Db\Adapter\AdapterInterface::getDefaultValue()andsupportsDefaultValue()methods to properly support theDEFAULTkeyword #15180 - Added
Phalcon\Db\Adapter\AbstractAdapter::supportsDefaultValue()method to properly support theDEFAULTkeyword #15180
Changed
- Added service checks for the session. Now cookies will be saved in the session only when the
sessionservice is defined #11770, #14649 - Changed
Phalcon\Db\Adapter\*::getRawSQLStatement()to return the full SQL query with parameters #12196 - Changed
Phalcon\Filter::sanitizeto throw aE_USER_NOTICEwhen 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::setJsonContentto apply with rfc7159 - Changed the visibility of properties in
Phalcon\Http\Message\Urito 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\Relationto accept callable params for model relations. #15158
Fixed
- Fixed
Phalcon\Db\Dialect\Mysql::getColumnDefinitionto recognizesizeforDATETIME,TIMEandTIMESTAMPcolumns #13297 - Fixed
Phalcon\Events\Managerto provide callable support #13322, #15045 - Fixed
Phalcon\Validation\Validator\Uniquenessfixed except query #15084 - Fixed
Phalcon\Mvc\Modelto also check the params option in cascade relations when deleting #15098 - Fixed
Phalcon\Mvc\Modelto 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 defineoptionsparameter #15142 - Fixed
Phalcon\Cryptperformance issues. #15118 - Fixed
Phalcon\Mvc\Router\Routeunicode support in patterns #15102 - Fixed fatal error in
Phalcon\Mvc\Model::cloneResultMap()when column map is used withorm.cast_on_hydrateturned on. #14617 - Fixed
Phalcon\Mvc\Model::sum(),average(),minimum(),maxmium(),count()to utilize the transaction parameter. #15113 - Fixed
Phalcon\Mvc\Model::__set()to cleardirtyRelatedwhen empty array is set. #14822 - Fixed
Phalcon\Mvc\Modelto skip columns with default values when theDEFAULTkeyword is not supported by the database adapter (SQLite) #15180 - Fixed
Phalcon\Mvc\Routerto handle numeric routes properly #14926 - Fixed
Phalcon\Session\Adapter\RedisandPhalcon\Session\Adapter\Libmemcachedto utilize the prefix option #15184 - Fixed
Phalcon\Mvc\Modelto save the modified properties of previously queried single related records. #15148
Removed
- Removed
Phalcon\Http\Cookiebinding to session #11770-
Phalcon\Http\Cookieno 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
Installation/Upgrade
The packages in packagecloud.io are being updated (at the time of this post) and will be ready soon. You will need to use the mainline repository to install v4.0.6. You can also download the zip file, as well as DLLs for Windows, from our release page here.
You can also clone the repository and checkout the tag, and then run
zephir fullclean
zephir build
to install the new extension. Detailed installation instructions can be found in our documentation page.
Note: It might take a bit of time for the DEB and RPM packages to be built from when this blog post is published.
Thank you
Once again a huge thank you to all of our contributors! You guys have helped us a lot. You can help us even more by installing this version and testing it. If you find bugs, please report them in our Github Issues page. Alternatively you can always join us in our Discord server or our Forum.
Chat - Q&A
Support
Social Media
Videos
<3 Phalcon Team
Top comments (0)