The Phalcon Team is happy to announce the release of v4.0.0 Alpha 5! Github Tag.
As always, we cannot thank your community enough! We said this before but it is worth repeating: our community rocks! For this release alone we had 605 commits and 6,244 files were changed! A lot of the changes were formatting but a great number of them was performance based.
Phalcon v4 Alpha 5 is the last of our Alpha series. The next release will be a beta one! With the help of our community, we pushed through and are happy to report that with this release we only have 13 cards left in our project and will soon address all those remaining issues.
The biggest addition in this release is the PSR-16 Cache implementation. This was a full rewrite for our Cache classes.
We first introduced Phalcon\Storage\Serializer, a set of classes designed to serialize and unserialize data. Phalcon\Storage\Adapter contains now a set of classes that connect to potential storages such as Redis, Memcached etc.
Phalcon\Cache\Adapters extends those classes and allows for the storage of any information that needs to be cached or is cached. The main component is Phalcon\Cache\Cache and accepts the relevant adapter for your cache.
We have also introduced factory classes to allow for an easier instantiation of the component.
Added more methods to Phalcon\Helper\Arr as well as Phalcon\Helper\Str for those quick checks we all have in our code and much more!
Thank you again to everyone that has engaged us through social media, as well as our Discord server. Our community is the drive that makes Phalcon better with every release.
Changelog
Added
- Added
Phalcon\Cli\Router\Route::setDescription()to sets the route’s description #13936 - Added
Phalcon\Cli\Router\Route::getDescription()returns the route’s description #13936 - Added
Phalcon\Image\Adapter\Gd::getVersion(). - Added
chunk(),first(),firstKey(),flatten(),group(),isUnique(),last(),lastKey(),order(),pluck(),sliceLeft(),sliceRight(),split(),tail(),validateAll(),validateAny()toPhalcon\Helper\Arr#13954 - Added
camelize(),concat(),countVowels(),decapitalize(),dynamic(),endsWith(),firstStringBetween(),includes(),increment(),isAnagram(),isLower(),isPalindrome(),isUpper(),lower(),random(),reduceSlashes(),startsWith(),uncamelize(),underscore(),upper()toPhalcon\Helper\Str#13954 - Added
Phalcon\Mvc\Model\Query\BuilderInterface::getModels()returns the models involved in the query - Added
addConnect(),addPurge()andaddTrace()toPhalcon\Mvc\Router\Groupand its interface. #14001 - Added
Phalcon\Mvc\Model\Transaction::throwRollbackException()which allows a transaction to throw an exception or not on a rollback. #13949 - Added
Phalcon\Cache\Cacheclass implementing PSR-16. Introducing:Phalcon\Cache\AdapterPhalcon\Cache\Adapter\ApcuPhalcon\Cache\Adapter\LibmemcachedPhalcon\Cache\Adapter\MemoryPhalcon\Cache\Adapter\RedisPhalcon\Cache\Adapter\Stream
Phalcon\Cache\AdapterFactory: Factory to create adaptersPhalcon\Cache\CacheFactory: Factory to create cache objects #13439
- Added
Str::dirSeparator()to ensure a path has a trailing slash #13439 - Added assets versioning
Phalcon\Assets\Manager:addCss,Phalcon\Assets\Manager::addJs,Phalcon\Assets\Collection:addCss,Phalcon\Assets\Collection:addJsaccepts two additional parameters -versionandautoVersion#12591 - Added setting
orm.resultset_prefetch_recordsinstructing the ORM (resultset) to prefetch the rows if the rows returned are less or equal to the setting. #13387 - Added
Phalcon\Mvc\View::toString()to return the rendered view as a string #13825 - Added
Phalcon\Helper\Arr::arrayToObject()to convert arrays to objects. - Added
Phalcon\Firewallcomponent #13648 - Added
orm.cast_last_insert_id_to_intoption forPhalcon\Mvc\Model::setup()(castLastInsertIdToInt) to cast thelastInsertIdonsave()toint#13002 - Added
Attributescollection class like a new Html component #13646 - Added
AttributesintoPhalcon\Forms\Form#13646
Changed
- Refactored
Phalcon\Events\Managerto only useSplPriorityQueueto store events. #13924 Phalcon\Translate\InterpolatorInterfacenow only accepts placeholder arrays. #13939Phalcon\Dispatcher::forward()andPhalcon\Dispatcher::setParams()now require an array as a parameter. #13935- CLI Routes with bad class names (eg.
MyApp\\Tasks\\) now throw an exception instead of suppressing the error. #13936 - Refactored
Phalcon\Mvc\Collection\Behavior\SoftDeleteandPhalcon\Mvc\Model\Behavior\SoftDelete. #13930 - Model methods that extend Model Manager functionality are now
final. #13950 - Changed
Phalcon\Textto call methods fromPhalcon\Helper\Str#13954 - Setting the views directory no longer requires a trailing slash when using Simple View.
Phalcon\Mvc\View\Simple::viewParamsis now always an array.Phalcon\Mvc\View\Simple::render()paramsproperty is now always an array.Phalcon\Mvc\Model\CriteriaInterface::limit()now takesoffsetas an integer. #13977- Changed
Phalcon\Mvc\Model\Manager::getModelSource()to usesetModelSource()internally instead of setting the source manually #13987 - The property
optionsis always an array inPhalcon\Mvc\Model\Relation. #13989 Phalcon\Logger\Adapter\AbstractAdapter::process()is now actually abstract. #14012Phalcon\Mvc\ModelInterface::getRelated()return type declaration has changed (not alwaysResultsetInterface) #14035- In
Phalcon\Mvc\Model, relations fetched using magic methods are now handled byPhalcon\Mvc\Model::getRelated()internally. #14035 - Changed
Phalcon\Mvc\Model\Transaction::rollback()to not throw a transaction by default. #13949 - Changed
Phalcon\Cachenamespace and relevant classes to handle storing data to different stores. Introducing:Phalcon\Storage\Serializeroffering classes that implement the\Serializableinterface.Phalcon\Storage\Serializer\Base64Phalcon\Storage\Serializer\IgbinaryPhalcon\Storage\Serializer\JsonPhalcon\Storage\Serializer\MsgpackPhalcon\Storage\Serializer\NonePhalcon\Storage\Serializer\PhpPhalcon\Storage\Serializer\SerializerInterface
Phalcon\Storage\SerializerFactory: Factory to create serializersPhalcon\Storage\Adapteroffering classes that implement thePhalcon\Storage\Adapter\AdapterInterfaceinterface.Phalcon\Storage\Adapter\ApcuPhalcon\Storage\Adapter\LibmemcachedPhalcon\Storage\Adapter\MemoryPhalcon\Storage\Adapter\RedisPhalcon\Storage\Adapter\Stream
Phalcon\Storage\AdapterFactory: Factory to create adapters #13439
- Changed
Phalcon\Mvc\Model\Queryto not callnumRowswhen selecting data #13387 - Bind parameters and bind types are now always arrays in
Phalcon\Mvc\Model\Query. - Changed
Phalcon\Validation\Validator\Urlto work with passed options. (FILTER_FLAG_PATH_REQUIRED,FILTER_FLAG_QUERY_REQUIRED) #13548 Phalcon\Mvc\Model\Query\Builderwill now omit offsets if they are set as 0.Phalcon\Mvc\Model\Transaction::__construct()service parameter must be a string or omitted.Phalcon\Logger\Formatter\Line::__construct()service parameters must be a string or omitted.Phalcon\Logger\Formatter\Json::__construct()service parameters must be a string or omitted.- Removed deprecated code from
Phalcon\Forms\Form::getMessages(). - Loading a Module (either MVC or CLI) now throws an exception if the path does not exists regardless of whether the class is already loaded.
- Changed
Phalcon\Cryptto accept auth tag, tag length and data for “gcm” and “ccm” modes. Removed insecure algorithms with modes:des*,rc2*,rc4*,des*,*ecb#13869 - Changed
Phalcon\Mvc\Modelto copy the unset default values from theMetaDatato theModelafter a successful insert. #13781 - Changed
Phalcon\Mvc\Model::findFirst()now returnsnull.Phalcon\Mvc\Model::getRelated()for one to one relationships returnsnull#14044
Fixed
- Fixed
Mvc\Collection::isInitialized()now works as intended. #13931 - Update docblocks to show that we can no longer assign properties via
save()in models (as per #12317). #13945 - Fixed
Mvc\ModelandMvc\ModelInterfacefindFirstto returnModelInterfaceorbool#13947 Phalcon\Acl\Adapter\Memory::dropComponentAccess()now properly unsets values.- Volt options ‘separator’ and ‘extension’ now work again. #13971
- Query Builder’s
GROUP BYfield is now always an array. #13962 - Renamed
Phalcon\Paginator\Adapter::getPaginate()topaginate()in documentation/tests (originally renamed in 4.0.0-alpha.1). #13973 - Fixed the exception message in
Phalcon\Security::computeHmac()by removing"%s"from output. Phalcon\Mvc\Model\Relation::isForeignKey()now returns false if theforeignKeyoption is set tofalse.- Fixed
Phalcon\Flash\Session::output()not to throw an exception when there are no messages stored in session. #14023 - Fixed
Phalcon\Config\Adapter\Ini()to handle arrays correctly in .ini files. #14025 - Fixed non-reusable relations in
Phalcon\Mvc\Model, now returning fresh records. #13531 Phalcon\Mvc\Model::isRelationshipLoaded()is now working for every type of relations. #14035- Fixed
Phalcon\Mvc\Model::writeAttribute()to handle associative arrays correctly. #14021 - Fixed
Phalcon\Html\Tag::appendTitle()andPhalcon\Html\Tag::prependTitle()to mirrorPhalcon\Tag. #14039 - Fixed
Phalcon\Validation::validate()withcancelOnFail. The validator will validate all elements and will stop processing validators on a per element basis ifcancelOnFailis present. #13149 - Fixed
Phalcon\Mvc\Models\Manager::getRelations()to return the many-to-many relationships also. #10839 - Fixed
Phalcon\Validation\Validator\Numericality::validate()to parse nonenlocale numbers. #13843 - Fixed
Phalcon\Mvc\Model::save()failing after a successful insert when default database fields are not updated. #13781
Removed
- Removed
arrayHelpersproperty from the Volt compiler. #13925 - Removed legacy (PHP <5.5) code from GD image adapter.
- Removed support for HTTP_CONTENT_TYPE header (a bug in PHP 5). #14013
- Removed
Mvc\Model\MetaData\Sessionadapter (no longer supported) #13439 - Removed
Phalcon\Cache,Phalcon\Cache\Backend,Phalcon\Cache\BackendInterface,Phalcon\Cache\Backend\Apcu,Phalcon\Cache\Backend\Factory,Phalcon\Cache\Backend\File,Phalcon\Cache\Backend\Libmemcached,Phalcon\Cache\Backend\Memory,Phalcon\Cache\Backend\Mongo,Phalcon\Cache\Backend\Redis,Phalcon\Cache\Frontend,Phalcon\Cache\Frontend\Base64,Phalcon\Cache\Frontend\Data,Phalcon\Cache\Frontend\Factory,Phalcon\Cache\Frontend\Igbinary,Phalcon\Cache\Frontend\Json,Phalcon\Cache\Frontend\Msgpack,Phalcon\Cache\Frontend\None,Phalcon\Cache\Frontend\Output,Phalcon\Cache\FrontendInterface,Phalcon\Cache\Multiple#13439 - Removed caching from the view (simple/view)
Phalcon\Mvc\View::cache()Phalcon\Mvc\View::getCache()Phalcon\Mvc\View\Simple::cache()Phalcon\Mvc\View\Simple::getCache()#13439
- Removed multiple Cache Adapter
Phalcon\Cache\Multiple#13439 - Removed old cache classes
Phalcon\Cache\BackendPhalcon\Cache\BackendInterfacePhalcon\Cache\Backend\ApcuPhalcon\Cache\Backend\FactoryPhalcon\Cache\Backend\FilePhalcon\Cache\Backend\LibmemcachedPhalcon\Cache\Backend\MemoryPhalcon\Cache\Backend\MongoPhalcon\Cache\Backend\RedisPhalcon\Cache\FrontendPhalcon\Cache\FrontendInterfacePhalcon\Cache\Frontend\Base64Phalcon\Cache\Frontend\DataPhalcon\Cache\Frontend\FactoryPhalcon\Cache\Frontend\IgbinaryPhalcon\Cache\Frontend\JsonPhalcon\Cache\Frontend\MsgpackPhalcon\Cache\Frontend\NonePhalcon\Cache\Frontend\Output#13439
- Removed model namespace aliases.
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.0-alpha5. 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.
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