Blog and News

Hello everyone!

We are happy to announce that we have released Phalcon 3.4.1.

This a minor release, focused on bugs and performance.

Changelog

  • Changed Phalcon\Cache\Backend\Redis to support connection timeout parameter
  • Fixed Phalcon\Validaiton\Validator\Uniqueness::isUniquenessModel to properly get value of primary key when it has different name in column map #13398
  • Fixed bad performance for repeated Phalcon\Mvc\Router::getRouteByName and Phalcon\Mvc\Router::getRouteById calls for applications with many routes
  • Fixed incorrect tinyblob bind type in Phalcon\Db\Adapter\Pdo\Mysql::describeColumns #13423
  • Fixed Phalcon\Http\Request::getPut to provide json content-type support #12892, #13418

Update/Upgrade

Phalcon 3.4.1 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Our packaging system not longer supports Ubuntu 15.10 due to difficulties installing dependencies, updates and major security patches. Ubuntu 15.10 reached its end of life in July 28, 2016. We strongly recommend you upgrade your installation. If you cannot, you can always build the latest stable version of Phalcon from the source code.
NOTE: Windows DLLs are now available in our Github Release page.

We encourage existing Phalcon 3 users to update to this version and as always a big thank you to our contributors!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Dear friends,

We have started an evaluation of all of our github repositories as part of a cleanup process. Some of our repositories were experimental, just to see if things would work. Some are proofs of concept and some are working examples.

However, as our project moves on, it is very often that those experiments proved good or bad, and no longer serve a purpose. Additionally, example repositories tend to not move forward as the project does, and thus become obsolete, or have deprecated code.

Our time and resources are very limited. No matter how much we try, we cannot devote time to maintain all the existing repositories and projects that we currently have. We prefer to concentrate on a smaller number of repositories that contain projects and example code, so that we can offer a much better service to our community. We strongly believe that this move will allow us to provide projects/repositories with a higher quality of code to our community.

As a result, we will be looking at all the repositories we have and add DEPRECATED in the project description. If you wish to keep a repository for your own purposes, please fork it and/or download it. Repositories marked as DEPRECATED will be completely removed on the 31st of August 2018.

We always appreciate the help of our community in our project. If you feel that a particular project should not be deprecated and can be updated (with your help) for all to use, by all means reach out to us on our discord server https://phalcon.link/discord.

The list of the projects that are marked as deprecated are:

  • ansible-role-ngrok
  • ansible-role-zephir
  • blog-tutorial
  • box
  • maker
  • panthea
  • phalcon-api-reference
  • phalcon-compose
  • php-site
  • skeleton
  • skeleton-single
  • try-phalcon

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!

We are happy to announce that we have released Phalcon 3.4.0.

This is going to be the last major release in the 3.x series. We will continue bug fixes and release some minor releases in the future, but we are now going to concentrate fully on version 4.0.

Changelog

  • Added Phalcon\Mvc\Router::attach to add Route object directly into Router #13326
  • Added the ability to listen request:beforeAuthorizationResolve and request:afterAuthorizationResolve events. This ability enables using custom authorization resolvers #13327
  • Added call event afterFetch in Phalcon\Mvc\Model:refresh #12220
  • Added Phalcon\Http\Response::getReasonPhrase to retrieve the reason phrase from the Status header #13314
  • Added Phalcon\Loader::setFileCheckingCallback to set internal file existence resolver #13360
  • Added ability to pass aggregation options for Phalcon\Mvc\Collection::aggregate #12302
  • Added Phalcon\Crypt::setHashAlgo to set the name of hashing algorithm used to the calculating message digest #13379
  • Added Phalcon\Crypt::getHashAlgo to get the name of hashing algorithm used to the calculating message digest #13379
  • Added Phalcon\Crypt::useSigning to set if the calculating message digest must used (NOTE: This feature will be enabled by default in Phalcon 4.0.0) #13379
  • Added Phalcon\Crypt::getAvailableHashAlgos to get a list of registered hashing algorithms suitable for calculating message digest #13379
  • Added Phalcon\Crypt::__construct so now the cipher can be set at object construction and the calculating message digest can be enabled without the need to call setCipher or useSigning explicitly #13379
  • Added Phalcon\Crypt\Mismatch. Exceptions thrown in Phalcon\Crypt will use this class #13379
  • Added Phalcon\Http\Cookie::setSignKey to set sign key used to generate a message authentication code (eg. message digest)
  • Added Phalcon\Http\Response\Cookies::setSignKey to set sign key used to generate a message authentication code (eg. message digest)
  • Changed Phalcon\Crypt::setCipher so that IV length will be reconfigured during setting the cipher algorithm
  • Changed Phalcon\Crypt::setCipher so that method will throw Phalcon\Crypt\Exception if a cipher is unavailable
  • Fixed regression (#13308) for Phalcon\Debug\Dump::output to correctly work with detailed mode #13315
  • Fixed Phalcon\Mvc\Model\Query\Builder::having and Phalcon\Mvc\Model\Query\Builder::where to correctly merge the bind types #11487
  • Fixed Phalcon\Mvc\Model::setSnapshotData to properly sets the old snapshot
  • Do not throw Exception when superglobal does not exist #13252, #13254, #12918

Update/Upgrade

Phalcon 3.4.0 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Our packaging system not longer supports Ubuntu 15.10 due to difficulties installing dependencies, updates and major security patches. Ubuntu 15.10 reached its end of life in July 28, 2016. We strongly recommend you upgrade your installation. If you cannot, you can always build the latest stable version of Phalcon from the source code.
NOTE: Windows DLLs are now available in our Github Release page.

We encourage existing Phalcon 3 users to update to this version and as always a big thank you to our contributors!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!

We are happy to announce that we have released Phalcon 3.3.2.

This release contained some bug fixes.

Changelog

  • Fixed Phalcon\Db\Dialect\Mysql::modifyColumn to produce valid SQL for renaming the column #13012
  • Fixed Phalcon\Forms\Form::getMessages to return back previous behaviour: return array of messages with element name as key #13294
  • Fixed Phalcon\Mvc\Model\Behavior\SoftDelete::notify to solve the exception that soft deletion renamed model #13302, #13306
  • Fixed E_DEPRECATED error for each() in Phalcon\Debug\Dump #13253

Update/Upgrade

Phalcon 3.3.2 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Our packaging system not longer supports Ubuntu 15.10 due to difficulties installing dependencies, updates and major security patches. Ubuntu 15.10 reached its end of life in July 28, 2016. We strongly recommend you upgrade your installation. If you cannot, you can always build the latest stable version of Phalcon from the source code.
NOTE: Windows DLLs are now available in our Github Release page.

We encourage existing Phalcon 3 users to update to this version and as always a big thank you to our contributors!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!

It has been a while since we last posted an update regarding Phalcon. We apologize for this. As you all know this is an open source project and all of us in the community contribute using our free time and enthusiasm for the project. However sometimes, other tasks need more immediate attention such as work and family.

Workload

Due to the team's increased workload (family/work), we reached out to a C developer that can help us with some Zephir and Phalcon related bugs. We are working on compensation at the moment as well as the priority of bugs that need to be squashed so that we can move the project forward. We are going to use the funds that all of our supporters have graciously donated to the project in OpenCollective. We are very careful about those funds and only use them when needed, so we have decided that this would be a great way to help the project.

Github issues

Again, related to the workload, we have a number of Github issues that have been opened and are stale. Some of those issues have been open for months and are no longer valid because either they have been fixed but never updated and some have never been followed up (requesting information/examples).

In an effort to clean up our issue list as well as be able to focus on valid issues, we have installed the stale bot in Github, which will mark issues that have not been active for the last 90 days as stale. This process is automated.

This new bot will allow us to shorten the list of issues and focus in fixing and closing valid issues from the list.

NOTE: The bot is not part of any Artificial Intelligence code, so it is going to close issues that have been inactive the last 90 days. This could very well close valid issues that we have not had the time to address yet. If your issue has been automatically closed and it is valid, please help us by reopening it or creating a new one.

We would like to once more thank our contributors as well as sponsors for helping us make Phalcon awesome!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!

Phalcon 3.3.1 has been released, addressing some bugs.

The release tag can be found here: 3.3.1

Changelog

  • Fixed a boolean logic error in the CSS minifier and a corresponding unit test so that whitespace is stripped #13200
  • Fixed default Volt filter #13242, #13244
  • Fixed Phalcon\Validation\Validator\Date to return code in validation message

Update/Upgrade

Phalcon 3.3.1 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Our packaging system not longer supports Ubuntu 15.10 due to difficulties installing dependencies, updates and major security patches. Ubuntu 15.10 reached its end of life in July 28, 2016. We strongly recommend you upgrade your installation. If you cannot, you can always build the latest stable version of Phalcon from the source code.
NOTE: Windows DLLs are now available in our Github Release page.

We encourage existing Phalcon 3 users to update to this version and as always a big thank you to our contributors!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

image

The Phalcon Team wishes all of our friends, contributors, developers and users of the framework a Merry Christmas!. We hope that the new year will bring health and happiness to you and your loved ones!

As a small gift for this holiday/celebration, we are releasing Phalcon 3.3.0.

This release concentrated on support for PHP 7.2, new features and fixing some bugs,

A huge thank you to all of our contributors and the community!!

The release tag can be found here: 3.3.0

Changelog

  • Added support of PHP 7.2 and initial support of PHP 7.3
  • Added support for switch/case syntax to the Volt Engine #13107
  • Added Phalcon\Logger\Adapter\Blackhole #13074
  • Added Phalcon\Http\Request::hasHeader to check if certain header exists
  • Added support of 103 (Early Hint) HTTP status code
  • Added router:beforeMount event to Router::mount #13158
  • Added Phalcon\Mvc\Application::sendHeadersOnHandleRequest to enable or disable sending headers by each request handling #13101
  • Added Phalcon\Mvc\Application::sendCookiesOnHandleRequest to enable or disable sending cookies by each request handling #13101
  • Added ability to use PDO option aliases on database connect #13010
  • Added Phalcon\Mvc\Model\MetaData\Apcu #13078
  • Added ability to use string(file path) as a argument in Phalcon\Config\Factory::load()
  • Added Phalcon\Mvc\Mico\Collection::mapVia to map routes via methods
  • Added Phalcon\Mvc\Model::setOldSnapshotData to set old snapshot data separately to current snapshot data
  • Added Phalcon\Http\Response::removeHeader to remove specific header from response
  • Added Phalcon\Mvc\Query::setTransaction to enable an override transaction #13226
  • Fixed Phalcon\Mvc\Model\Query\Builder::getPhql to correct generate PHQL in argument's array when using order DESC or ASC #11827
  • Fixed Phalcon\Db\Dialect\Postgresql::createTable to produce valid SQL for table definition with BOOLEAN types #13132
  • Fixed Phalcon\Db\Dialect\Postgresql::_castDefault to return correct value for BOOLEAN type #13132, phalcon/phalcon-devtools#1118
  • Fixed Phalcon\Mvc\Model::_doLowInsert to correct save snapshot on creation/save identityless models #13166
  • Fixed Phalcon\Mvc\Model::_doLowUpdate to correctly work with Phalcon\Db\RawValue #13170
  • Fixed Phalcon\Mvc\Model::allowEmptyStringValues to correct works with saving empty string values when DEFAULT not set in SQL
  • Fixed Phalcon\Mvc\Model\Behavior\SoftDelete to correctly update snapshots after deleting item
  • Fixed Phalcon\Mvc\Model to set old snapshot when no fields are changed when dynamic update is enabled
  • Fixed Phalcon\Acl\Adapter\Memory::isAllowed to properly pass role and resource objects to custom function if they are objects of the same class
  • Changed Phalcon\Mvc\Model to allow to pass a transaction within the query context #13226

Highlights

The most notable additions are support for switch/case syntax in Volt, hasHeader in Request and the addition of the router:beforeMount event.

switch/case

You can now use the switch statement in Volt

{% switch foo %}
    {% case 0 %}
    {% case 1 %}
    {% case 2 %}
        "foo" is less than 3 but not negative
        {% break %}
    {% case 3 %}
        "foo" is 3
        {% break %}
    {% default %}
        "foo" is {{ foo }}
{% endswitch %}

The switch statement executes statement by statement, therefore the break statement is necessary in some cases. Any output (including whitespace) between a switch statement and the first case will result in a syntax error. Empty lines and whitespaces can therefore be cleared to reduce the number of errors see here.

case without switch

{% case EXPRESSION %}

Will throw Fatal error: Uncaught Phalcon\Mvc\View\Exception: Unexpected CASE.

switch without endswitch

{% switch EXPRESSION %}
Will throw `Fatal error: Uncaught Phalcon\Mvc\View\Exception: Syntax error, unexpected EOF in ..., there is a 'switch' block without 'endswitch'`.

default without switch

{% default %}

Will not throw an error because default is a reserved word for filters like {{ EXPRESSION | default(VALUE) }} but in this case the expression will only output an empty char '' .

nested switch

{% switch EXPRESSION %}
  {% switch EXPRESSION %}
  {% endswitch %}
{% endswitch %}

Will throw Fatal error: Uncaught Phalcon\Mvc\View\Exception: A nested switch detected. There is no nested switch-case statements support in ... on line ....

a switch without an expression

{% switch %}
  {% case EXPRESSION %}
      {% break %}
{% endswitch %}

Will throw Fatal error: Uncaught Phalcon\Mvc\View\Exception: Syntax error, unexpected token %} in ... on line ....

hasHeader in Phalcon\Http\Request

You can now use the hasHeader method, to check if a header has been set in the incoming request.

if ($request->hasHeader('myheader')) {
    echo 'Yay! Header was set!!';
}

router:beforeMount

Sometimes it is necessary to attach some logic to our application, before the routes are mounted in our Router object. The beforeMount event is perfect in these cases. You can now use it if your application requirements dictate so.

Update/Upgrade

Phalcon 3.3.0 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Our packaging system not longer supports Ubuntu 15.10 due to difficulties installing dependencies, updates and major security patches. Ubuntu 15.10 reached its end of life in July 28, 2016. We strongly recommend you upgrade your installation. If you cannot, you can always build the latest stable version of Phalcon from the source code.
NOTE: Windows DLLs are now available in our Github Release page.

We encourage existing Phalcon 3 users to update to this version.

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!!!

We are releasing Phalcon 3.2.3 today, addressing several bugs.

Release

The release tag can be found here: 3.2.3. The Windows DLLs are in the releases Github page.

Changelog

  • Fixed Phalcon\Mvc\Model\Query::_executeSelect threw RuntimeException, if db:beforeQuery() returned false
  • Internal cookies property is now always an array #12978
  • Fixed Phalcon\Validation\Validator\File::validate to work properly with parameter message #12947
  • Fixed Phalcon\Mvc\View::render to render a view with params #13046
  • Fixed Phalcon\Mvc\Model\Manager::getRelationRecords to work properly with provided columns #12972
  • Mark as deprecated no longer used Phalcon\Mvc\Model\Query\Builder::$_with parameter #13023
  • Fixed Phalcon\Dispatcher::dispatch to ensure proper flow for all forward/exception/dispatch event hooks #12931

Update/Upgrade

Phalcon 3.2.3 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Our packaging system not longer supports Ubuntu 15.10 due to difficulties installing dependencies, updates and major security patches. Ubuntu 15.10 reached its end of life in July 28, 2016. We strongly suggest you upgrade your installation. If you cannot, you can always build the latest stable version of Phalcon from the source code.
NOTE: Windows DLLs are now available in our Github Release page.

We encourage existing Phalcon 3 users to update to this version.

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!!!

We are releasing Phalcon 3.2.2 today, addressing several bugs.

Release

The release tag can be found here: 3.2.2. The Windows DLLs are in the releases Github page.

Changelog

  • Fixed Phalcon\Db\Adapter\Pdo\Postgresql::describeColumns to work properly with DOUBLE PRECISION and REAL data types #12842
  • Fixed Phalcon\Paginator\Adapter\QueryBuilder::getPaginate to use the db connection service of the model #12957
  • Fixed Phalcon\Paginator\Adapter\QueryBuilder::getPaginate to escape reserved words #12950
  • Fixed Phalcon\Dispatcher::dispatch to correct forward with the modified action suffix #12988
  • Fixed Phalcon\Forms\Element::_construct to prevent create form element with empty name #12954

Update/Upgrade

Phalcon 3.2.2 can be installed from the master branch, if you don't have Zephir installed follow these instructions:

git clone http://github.com/phalcon/cphalcon
cd cphalcon/build
sudo ./install

Note that running the installation script will replace any version of Phalcon installed before.

PackageCloud.io has been updated to allow your package manager (for Linux machines) to upgrade to the new version seamlessly.

NOTE: Windows DLLs are now available in our Github Release page.
NOTE: PackageCloud (linux distributions) will be updated tomorrow 2017-08-14.

We encourage existing Phalcon 3 users to update to this version.

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!!

Often we get queries/requests on how someone can help with the documentation, and how they can set up the docs application on their local machine so as to see changes immediately on their screen before issuing a pull request with their changes.

This blog post outlines how to set up our docs app and how you can help with the documentation effort.

Overview

Our documentation is split into two repositories:

  • Docs App. This repo contains the application that handles our documentation (templates, CSS, etc.).
  • Docs. This repo contains the actual articles that are shown on screen (content).

These repositories have been set up to work together to offer an easy way to set up and maintain the documentation.

The docs repository has also been integrated with Crowdin, which handles all the translation efforts of our documentation.

Setup

So you want to set up the docs application to have the documents application running on your local machine. Great! The steps are:

  • Fork the docs-app repository
  • Fork the docs repository
  • Clone the docs-app to your machine.
  • Install nanobox if you don't have it
  • Setup the .env file
  • Setup the app using nanobox
  • Run the deploy script
  • Run the app with nanobox
  • Launch the app on your browser :)

Fork the repositories

If you haven't done so already, fork the repositories from the phalcon github organization page https://github.com/phalcon. You will need the docs-app and docs repositories.

Clone the docs-app repository

In a suitable location on your machine clone the docs-app repository (the fork)

$ git clone [email protected]:niden/docs-app
NOTE Your repository URL will be different than the above command

Install nanobox

If you haven't done so already, visit nanobox.io and download and install the application. It will ask you some basic questions (usually we use Docker as the engine instead of Virtualbox) as part of its setup. If you don't meet the following requirements you should use VirtualBox.

Docker Requirements

Setup the .env file

In the docs-app folder (or wherever you have cloned the docs-app repository), make a copy of the .env.example file and rename it to .env. Open the file and edit:

  • APP_URL entry with a local domain. In this example we use docs.phalcon.ld.
  • DOCS_REPO entry to your fork of the docs repo. For example it will be something like this:
[email protected]:niden/docs

Setup the app using nanobox

In your folder (where you cloned docs-app) run the following command in a terminal:

$ nanobox run

After a while you will see something like this:

$ nanobox run
Preparing environment :

docs-app (local) :
...

Preparing environment :
...

Building dev environment :
  ✓ Starting docker container
  ✓ Configuring

      **
   *********
***************   Your command will run in an isolated Linux container
:: ********* ::   Code changes in either the container or desktop are mirrored
" ::: *** ::: "   ------------------------------------------------------------
  ""  :::  ""     If you run a server, access it at >> 172.18.0.4
    "" " ""
       "

Once nanobox finishes its tasks, you will be "inside" the container. Your prompt will be:

/app $

Run the deploy script

In the same terminal, (root folder of docs-app) run the deploy script

$ ./deploy

This script will start cloning the docs repository branches needed under the ./docs folder of your docs-app application (mind boggling - too many docs! :D). The output on the terminal will provide information about the process.

Type exit to exit the container.

Run the following command to create a hosts entry for your environment so that you can use the local domain:

$ nanobox dns add local docs.phalcon.ld

This command will be different in your system, depending on the name you chose for your local domain.

Run the app with nanobox

Run the following command:

$ nanobox run php-server

Launch the app in your browser

Open the http://docs.phalcon.ld URL in your browser and voila!!!

Modifications

If you wish to make changes to the application (docs-app), stylesheets or layout, feel free to do so and issue a pull request in the docs-app Phalcon repository.

You can also help with some of the English text located in the en folder under each version folder (docs/3.2/en, docs/3.1/en, etc.). These changes will be sent to the docs Phalcon repository.

Changes to a docs file (markdown) in any language other than English will not be accepted

Translations

For languages other than English, you will need to use Crowdin Project for the documentation:

https://crowdin.com/project/phalcon-documentation

The translated strings will be brought into the documentation via pull requests from Crowdin.

Enjoy!!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000