Phalcon 2.1.0 RC1 released
We are excited to announce the immediate availability of Phalcon 2.1 RC 1!
This version is our first LTS version and it will be supported 3 years from its final release date. Also, this will be our last release candidate before the final version of Phalcon 2.1.
Phalcon 2.1 introduces a great number of improvements, striving to make Phalcon even a better framework. Final version will be available in two weeks.
NOTE: Some of these changes will break existing Phalcon 2.x applications. Please ensure that you have tested your application sufficiently before migrating your application to 2.1 for production purposes.
Changes in Phalcon 2.1
- PHP 5.3 is no longer supported
Phalcon\Mvc\Model\Validationis now deprecated in favor of
- The default encrypt mode in
Phalcon\Cryptis now changed to
- Changed default hash algorithm in
- Changed constructor of
Phalcon\Mvc\Modelallowing you to pass an array of initialization data
- Removed support for prefixes strategy in
Phalcon\Mvc\Viewnow supports many views directories
- An absolute path can now be used for
- Fixed odd view behavior #1933 related to
Phalcon\Diis now bound to service closures allowing use
$thisto access services within the closures
- If an object is returned after firing the event
Phalcon\Diit overrides the default service localization process
Mvc\Routernow default to
PCRE_UTF8) is now the default in regex based routes in
falsefrom an action disables the view component (same as
- Return a string from an action takes it as the body of the response (same as return
- Return a string from an
Mvc\Microhandler takes it as the body of the response
Mvc\Router\Routenow escapes characters such as
+to avoid unexpected behaviors
- Closures used as handlers in
Mvc\Microare now bound to the
- Routes now can have an associated callback that can override the default dispatcher and view behavior
JsonSerializablemaking easy serialize model instances
- When destructing a
Mvc\Model\ManagerPHQL cache is cleared
Phalcon\Validation\ValidatorInterfacemarked as deprecated. You can now use
- Added internal check
allowEmptybefore calling a validator. If it option is true and the value of empty, the validator is skipped
- Added default header:
Content-Type: "application/json; charset=UTF-8"in method
Phalcon\Events\Manager::dettachAllin favor of
Phalcon\Mvc\Model\Criteria::getOrderis renamed to
- Added method
- Added ability to spoof the HTTP request method
FULLTEXTindex type to
- Fixed the use of the annotation router with namespaced controllers
Phalcon\Acl\ResourceAwareInterfaces. You can now pass objects to
resourceName, which will be automatically passed to the function defined in
Phalcon\Acl\AdapterInterface::denyhave now a 4th argument -
function, which will be called when using
Phalcon\Acl\AdapterInterface::isAllowedhas now a 4th argument -
parameters; You can pass arguments for
Phalcon\Acl\AdapterInterface::denyas associative array where
keyis the argument name
- Added method
- CLI parameters are now handled consistently
Phalcon\Mvc\Controller\BindModelInterfaceand associated model type hint loading through dispatcher.
afterFetchevent not being sent to behaviors
- Fixed issue with radio not being checked when default value is 0 #11358
- Fixed issue with
Model::__setthat was bypassing setters #11286
- Fixed issue with
Model::__setthat was setting hidden attributes directly when setters are not declared #11286
__constructfrom all interfaces #11410
- Fire the
dispatch:beforeExceptionevent when there is an exception during dispatching #11458
- Fixed bug of
Phalcon\Cache\Backend\Memcache::addServersto enable pool of servers for memcache
Mcryptis replaced with openssl in
- Removed methods
Phalcon\Assets\Manager::exists()to check if collection exists
PHP 7 support
Phalcon 2.1.x has beta PHP7 support, we expect to fix any blocking bug in the next two weeks before the final release. You can try Phalcon running on PHP7 by compiling from the 2.1.x branch using Zephir:
git clone http://github.com/phalcon/cphalcon cd cphalcon git checkout 2.1.x zephir build --backend=ZendEngine3
After this, you only have to add
extension=phalcon.so to your
New Package Infrastructure
We would like to share with you, our community, our plans for moving forward with regards to packaging and distributing Phalcon.
We have been researching many options to make the whole process easy, transparent and automated as possible. Our goal is to be able to use a continuous delivery system that will compile and package Phalcon immediately after each release. To achieve this, we chose to use the Packagecloud service to distribute Phalcon binaries.
This move will increase the availability of Phalcon in more Linux operating systems than currently available, and users will be able to use any built-in package manager of their operating system to install the framework. The available operating systems will be:
- Amazon Linux
- Oracle Linux
- Scientific Linux
- elementary OS
In addition to the above, automation will reduce the human interaction currently needed to create each Phalcon distribution.
For the time being, each distribution will be manually compiled by the Phalcon Team. Our goal is not to change the framework and the way it works for the community, but rather the way it is distributed. For that we will ensure that the new delivery mechanism is tested sufficiently, before we fully switch to Packagecloud and deprecate our Launchpad repository.
This move will make Phalcon available to a much wider variety of Linux based operating systems and reduce the time needed to produce those packages.
We will announce in our blog when this change will happen, so for the time being you can keep getting new versions as you have been in the past.
Phalcon 2.1 RC1 can be installed from the 2.1.x branch, if you don't have Zephir installed follow these instructions:
git clone http://github.com/phalcon/cphalcon cd cphalcon/build git checkout 2.1.x sudo ./install
If you have Zephir installed:
git clone http://github.com/phalcon/cphalcon cd cphalcon git checkout 2.1.x zephir build
Note that running the installation script will replace any version of Phalcon installed before.
Windows DLLs are available in the download page.
As always, many thanks to everyone involved in this release and thanks for choosing Phalcon!
<3 Phalcon Team