The Phalcon Team is happy to announce the release of v4.0.0 Beta 1! 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 369 commits and 2,787,950 additions and 2,690,303 deletions! A lot of the changes were formatting, tests as well as refactoring.
Phalcon v4 Beta 1 is one step closer to our stable release. As mentioned in our previous blog post, we have a handful of cards left for this release and we are focusing on documentation as well as the sample applications now.
You can see the remaining cards for v4 in our project page.
Also rewriting and reviewing the documentation can be tracked in this issue.
https://github.com/phalcon/docs/issues/2322
Some highlights:
- Prefixed (almost all) abstract classes with
Abstract - Introduced many more factory classes for components
- Aligned interfaces
- Moved classes to their natural namespaces (i.e.
Adapter*classes are now in theAdapter\*namespace - Fixed 20 bugs
- Removed
__set_state()from classes that implemented it.
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\Factory\Exceptionfor factory exceptions. #13672 - Added
Phalcon\Filter\FilterInterfacefor custom filter implementations. #13672 - Added
Phalcon\Db\Adapter\PdoFactory: Factory to create PDO adapters. #13672 - Added
Phalcon\Image\ImageFactory: Factory to create image adapters. #13672 - Added
Phalcon\Logger\LoggerFactory: Factory to create logger objects. #13672 - Added
Phalcon\Translate\InterpolatorFactory: Factory to create interpolator objects. #13672 - Added
Phalcon\Translate\TranslateFactory: Factory to create translate objects. #13672 - Added
Phalcon\Domain\Payloadto help in transferring messages between layers of the application. #14123 - Added
Phalcon\Domain\PayloadFactory: Factory to create payload objects. #14123 - Added
Phalcon\Http\Message\ServerRequestFactory::load: Method to create aServerRequestobject from globals. #14154 - Added
saslAuthDataas option toPhalcon\Storage\Adapter\Libmemcachedto authenticate using SASL #13394 - Added
Phalcon\Collection\ReadOnly: Read only collection. #14154 - Added
whiteList()toPhalcon\Helper\Arr#13954 - Added
Phalcon\Config\ConfigFactory::newInstance(): Factory to create config objects. #13201, #13768 - Added
Phalcon\Db\Enum#14213 - Added
Phalcon\Dispatcher\Exception#14213
Changed
- Renamed
Phalcon\Annotations\Adapter\FilestoPhalcon\Annotations\Adapter\Stream. #13672 - Renamed
Phalcon\Annotations\AdaptertoPhalcon\Annotations\Adapter\AbstractAdapter. #13672 - Renamed
Phalcon\Annotations\AdapterInterfacetoPhalcon\Annotations\Adapter\AdapterInterface. #13672 - Renamed
Phalcon\Annotations\FactorytoPhalcon\Annotations\AnnotationsFactory. #13672 - Renamed
Phalcon\Config\FactorytoPhalcon\Config\ConfigFactory. #13672 - Renamed
Phalcon\Filter\FilterLocatortoPhalcon\Filter. #13672 - Renamed
Phalcon\Filter\FilterLocatorFactorytoPhalcon\Filter\FilterFactory. #13672 - Renamed
Phalcon\Image\AdaptertoPhalcon\Image\Adapter\AbstractAdapter. #13672 - Renamed
Phalcon\Image\AdapterInterfacetoPhalcon\Image\Adapter\AdapterInterface. #13672 - Renamed
Phalcon\Paginator\AdaptertoPhalcon\Paginator\Adapter\AbstractAdapter. #13672 - Renamed
Phalcon\Paginator\AdapterInterfacetoPhalcon\Paginator\Adapter\AdapterInterface. #13672 - Renamed
Phalcon\Paginator\FactorytoPhalcon\Paginator\PaginatorFactory. #13672 - Renamed
Phalcon\Translate\AdaptertoPhalcon\Translate\Adapter\AbstractAdapter. #13672 - Renamed
Phalcon\Translate\AdapterInterfacetoPhalcon\Translate\Adapter\AdapterInterface. #13672 Phalcon\Pluginis now abstract.- Moved
methodparameter inPhalcon\Mvc\Model\Manager::getRelationRecords()to the last position. #14115 - Moved
methodparameter inPhalcon\Mvc\Model\Manager::getBelongsToRecords()to the last position. #14115 - Moved
methodparameter inPhalcon\Mvc\Model\Manager::getHasOneRecords()to the last position. #14115 - Moved
methodparameter inPhalcon\Mvc\Model\Manager::getHasManyRecords()to the last position. #14115 - Validator messages were moved into each validator. #13208
Phalcon\Paginator\Repository::getProperty()now usesPhalcon\Helper\Arr::get().- Refactored
Phalcon\Collectionto allow conditional key case sensitivity. #14154 - Refactored
Phalcon\Registryto align with thePhalcon\Collectioninterface. #14154 Phalcon\Mvc\Micro::setModelBinder()now uses the Factory Default DI if none is set. #14171Phalcon\Mvc\Model\ValidationFailednow works withModelInterface.- Refactored
Phalcon\Configto extendPhalcon\Collection#13201, #13768 - Renamed
Phalcon\Configto extendPhalcon\Config\Config#13201, #13768 - Renamed
Phalcon\AcltoPhalcon\Acl\Enum#14213 - Renamed
Phalcon\Acl\AdaptertoPhalcon\Acl\Adapter\AbstractAdapter#14213 - Renamed
Phalcon\Acl\AdapterInterfacetoPhalcon\Acl\Adapter\AdapterInterface#14213 - Renamed
Phalcon\ApplicationtoPhalcon\Application\AbstractApplication#14213 - Renamed
Phalcon\CryptInterfacetoPhalcon\Crypt\CryptInterface#14213 - Renamed
Phalcon\Db\AdaptertoPhalcon\Db\Adapter\AbstractAdapter#14213 - Renamed
Phalcon\Db\AdapterInterfacetoPhalcon\Db\Adapter\AdapterInterface#14213 - Renamed
Phalcon\DbtoPhalcon\Db\AdapterDb#14213 - Renamed
Phalcon\Db\Adapter\PdotoPhalcon\Db\Adapter\Pdo\AbstractPdo#14213 - Renamed
Phalcon\DispatchertoPhalcon\Dispatcher\AbstractDispatcher#14213 - Renamed
Phalcon\DispatcherInterfacetoPhalcon\Dispatcher\DispatcherInterface#14213 - Renamed
Phalcon\EscaperInterfacetoPhalcon\Escaper\EscaperInterface#14213 - Renamed
Phalcon\Firewall\AdaptertoPhalcon\Firewall\Adapter\AbstractAdapter#14213 - Renamed
Phalcon\Firewall\AdapterInterfacetoPhalcon\Firewall\Adapter\AdapterInterface#14213 - Renamed
Phalcon\FlashtoPhalcon\Flash\AbstractFlash#14213 - Renamed
Phalcon\FlashInterfacetoPhalcon\Flash\FlashInterface#14213 - Renamed
Phalcon\Forms\ElementtoPhalcon\Forms\Element\AbstractElement#14213 - Renamed
Phalcon\Forms\ElementInterfacetoPhalcon\Forms\Element\ElementInterface#14213 - Renamed
Phalcon\ImagetoPhalcon\Image\Enum#14213 - Renamed
Phalcon\Mvc\View\EnginetoPhalcon\Mvc\View\Engine\AbstractEngine#14213 - Renamed
Phalcon\Mvc\View\EngineInterfacetoPhalcon\Mvc\View\Engine\EngineInterface#14213 - Renamed
Phalcon\UrlInterfacetoPhalcon\Url\UrlInterface - Renamed
Phalcon\ValidatortoPhalcon\Validator\Validator#14213 - Renamed
Phalcon\Validator\ValidatortoPhalcon\Validator\AbstractValidator#14213 - Renamed
Phalcon\Validator\ValidatorCompositetoPhalcon\Validator\AbstractValidatorComposite#14213 - Renamed
Phalcon\Validator\CombinedFieldsValidatortoPhalcon\Validator\AbstractCombinedFields#14213 - Renamed
Phalcon\Validator\Validator\File\FileAbstracttoPhalcon\Validator\Validator\File\AbstractFile#14213
Fixed
- Fixed
Phalcon\Mvc\View::getRender()to callview->finish()instead ofob_end_clean(). #14095 - Fixed
Phalcon\Cache\Adapter\Libmemcachedfailing to set values whenPhalcon\Mvc\Model\MetaData\Libmemcachedwas in use. #14100 - Fixed
Phalcon\Db\Columnto recognizetinyint,smallint,mediumint,integeras valid autoIncrement columns. #14102 - Fixed
methodparameter inPhalcon\Mvc\Model\Manager::getRelationRecords(), it’s not always a string, null by default. #14115 - Fixed
methodparameter inPhalcon\Mvc\Model\Manager::getBelongsToRecords(), it’s not always a string, null by default. #14115 - Fixed
methodparameter inPhalcon\Mvc\Model\Manager::getHasOneRecords(), it’s not always a string, null by default. #14115 - Fixed
methodparameter inPhalcon\Mvc\Model\Manager::getHasManyRecords(), it’s not always a string, null by default. #14115 - Fixed
handlersproperty inPhalcon\Mvc\Micro\Collectionto now always an array. - Fixed crash in
Phalcon\Mvc\Model::save()when saving a circular model relation. #13354 - Fixed
Phalcon\Db\Dialect\Postgresql::truncateTable()to now escape table names. #14125 - Fixed
Phalcon\Mvc\Model\MetaData::write()to throw an exception iform.exception_on_failed_metadata_saveis set to true. #13433 - Fixed
Phalcon\Image\Adapter\Gdto throw an error withimagecolorat. #14139 Phalcon\Mvc\Model\Criteria::limit()now corrects negative offsets.Phalcon\Di\FactoryDefault\Clican now use the new Filter system.- Fixed
Phalcon\Mvc\Routernow parses and uses path. #14087 - Fixed various areas in
Phalcon\Acl\AdapterandPhalcon\Acl\Adapter\Memoryincluding comments, logic,denyComponentAccessandAdapterInterface. Added tests. #13870 - Fixed
Phalcon\Config::merge()not merging numeric values properly #13201, #13768 - Fixed
Phalcon\Validation\Validator\File\AbstractFilemissing the resolution of thevalueproperty #14198 - Fixed
Phalcon\Storage\Adapter\Stream#14190 Phalcon\Form\Form::clear()now correctly clears single fields. #14217- Fixed
Phalcon\Form\Form::getValue()not to callgetAttributes()when an element is named “attributes” #14226 - Fixed
Phalcon\Model::delete()array to string conversion #14080 - Fixed segfault in
Phalcon\Mvc\Micro\LazyLoader::callMethod()when handler contains syntax error.
Removed
- Removed
Phalcon\Session\Factory. #13672 - Removed
Phalcon\FactoryandPhalcon\FactoryInterface. #13672 - Removed
Phalcon\Translate. #13672 - Removed
Phalcon\Db\Column::getSchemaName()as its not relevant or settable. - Removed
Phalcon\Config::__set_state()as it does not serve any purpose and skipped the constructor. #13201, #13768 - Removed
Phalcon\Annotations\Reflection::__set_state(),Phalcon\Db\ColumnInterface::__set_state(),Phalcon\Db\Column::__set_state(),Phalcon\Db\IndexInterface::__set_state(),Phalcon\Db\Index::__set_state(),Phalcon\Db\ReferenceInterface::__set_state(),Phalcon\Db\Reference::__set_state(),Phalcon\Di\ServiceInterface::__set_state(),Phalcon\Di\Service::__set_state(),Phalcon\Http\Response\HeadersInterface::__set_state(),Phalcon\Http\Response\Headers::__set_state(),Phalcon\Http\Request::__set_state(),Phalcon\Messages\Message::__set_state()#14212
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-beta1. 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