Blog and News

This is a guest post from Scott Anderson at Nanobox.

Nanobox is a portable, micro platform for developing and deploying apps. When working locally, Nanobox uses Docker to spin up and configure a virtual development environment configured to your specific needs. When you're ready to deploy to live servers, Nanobox will take that same environment and spin it up on your cloud provider of choice, where you can then manage and scale your app through the Nanobox dashboard.

In this post, we'll walk through getting a brand new Phalcon app up and running locally, with nothing installed other than Nanobox. First create a free Nanobox account, then download and run the Nanobox installer.

Create a New Project

Create a project folder and cd into it:

mkdir nanobox-phalcon && cd nanobox-phalcon

Add a boxfile.yml

Nanobox uses the boxfile.yml to build and configure your app's runtime and environment. In the root of your project, create a boxfile.yml with the following:

run.config:
  engine: php  
  engine.config:    
    runtime: php-7.1    
    document_root: public    
    extensions:
      - phalcon  
  extra_steps:
    - echo "alias phalcon=\'phalcon.php\'" >> /data/var/home/gonano/.bashrc

This tells Nanobox to:

  • Use the PHP engine, a set of scripts that build your app's runtime.
  • Use PHP 7.1.
  • Set the Apache document root to public.
  • Include the Phalcon extension. Nanobox takes a bare-bones approach to extensions, so you'll likely need to include other extensions. More information can be found here.
  • Add a bash alias for Phalcon Devtools so you can just use the phalcon command.

Add Phalcon Devtools to your composer.json

Create a composer.json file in the root of your project and add the phalcon/devtools package to your dev requirements:

{
    "require-dev": {
        "phalcon/devtools": "~3.0.3"
    }
}
NOTE: The version of Phalcon Devtools depends on which PHP version you're using

Start Nanobox and Generate a New Phalcon App

From the root of your project, run the following commands to start Nanobox and generate a new Phalcon app. As Nanobox starts, the PHP engine will automatically install and enable the Phalcon extension, run a composer install which will install Phalcon Devtools, then drop you into an interactive console inside the virtual environment. Your working directory is mounted into the /app directory in the VM, so as changes are made, they will be reflected both in the VM and in your local working directory.

# start nanobox and drop into a nanobox console
nanobox run

# cd into the /tmp directory
cd /tmp

# generate a new phalcon app
phalcon project myapp

# change back to the /app dir
cd -

# copy the generated app into your project
cp -a /tmp/myapp/* .

# exit the console
exit

Run the App Locally

Before actually running your new Phalcon app, we recommend using Nanobox to add a DNS alias. This will add an entry to your local hosts file pointing to your dev environment and provide a convenient way to access your app from a browser.

nanobox dns add local phalcon.dev

Nanobox provides a php-server helper script that starts both Apache (or Nginx depending on your boxfile.yml config) and PHP. When passed with the nanobox run command, it will start the local dev environment and immediately run your app.

nanobox run php-server

Once running, you can visit your app at phalcon.dev.

Check Out the Environment

Your virtual environment includes everything you need to run your Phalcon app. Feel free to poke around.

# drop into a Nanobox console
nanobox run

# check the php version
php -v

# check that phalcon devtools are available
phalcon info

# check that your local codebase is mounted
ls

# exit the console
exit

Phalcon & Nanobox

Nanobox gives you everything you need develop and run your Phalcon app in an isolated virtual environment. With the boxfile.yml in your project, collaborators can get up and running in minutes simply by running nanobox run.

Nanobox has a Phalcon Quickstart that includes everything covered in this post. They also have as guides for using Phalcon with Nanobox. In future posts, we'd like to cover other aspects of using Phalcon with Nanobox, including adding and connecting to a database, deploying Phalcon into production, etc. If you're interested let us know on Twitter.

Resources

Nanobox

Phalcon

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!

Back in March, we asked our community to fill in a short survey, in order to gauge why people are using Phalcon, what we should be doing better etc.

The survey was very brief and consisted of the following questions:

  • Why did you choose to use Phalcon (main reason but also expand please)? *
  • Do you use Phalcon in production? (elaborate) *
  • Comments for the team (optional)
  • Github username (optional)

We received 103 replies and we thank you all of you that took the time to give us input.

Results

Why did you choose to use Phalcon

  • 90.29% (93/103) responses chose Performance which is one of the main attributes of Phalcon.
  • 61.17% (63/103) also chose Flexibility/Simplicity
  • 3.88% (4/103) chose the Community
  • 2.91% (3/103) stated that they liked it
Clearly the above percentages do not add to 100% because many users chose more than one attribute of Phalcon as the reason they chose it

Do you use Phalcon in production?

79.61% (82/103) replied Yes. There were also a frew "planning to in the future" and of course some "no".

The above was a welcomed surprise. Survey takers in some cases informed us of their websites, which was awesome to see.

This data makes us redouble our efforts to ensure that our users have a high quality and fast framework that can help them and their applications.

Thank you all!

Comments for the team (optional)

The comments ranged from praise to some complains about the documentation (we are working on it).

A sample is below:

Keep up the good work.
It's my favorite framework
With Phalcon comes great responsibility :)
View's file structure needs a bit more documentation. I had to look up on stackoverflow to get the gist of it's file structure.
Excellent work guys, I love you team
Add full features look like laravel, big project orm important and needed
Keep up the improvement of docs and tutorials
Better documentation
Follow Uncle Bob's clean code rules .. your class and methods are to damn long! Aside from that though, God bless you and thank you so much for the work you do! :)
They did a great job and I would love to complete what I am learning now and start contributing
Phalcon team is awesome. But i think, developments should be more frequent.
Please, improve documentation...
Great work guys! Everything works like a charm, with Postgres or MySQL, with Nginx or Apache, and the documentation is awesome!
Maybe you need a bigger team, more communication, less open bugs, shared hostings support, easier way to debug for beginners like me ...
Currently I am using BoltCMS for a new project (mostly because the backend and documentation is easy for me to use/understand) but I would really love to use a similar project if it was done using Phalcon. Another thing missing is a solid e-commerce platform based on Phalcon (I would gladly pay to use/support something like that)
In my mind you should concentrate on examples where are used good practices, maybe CQRS or other architecture solution. Important thing is multimodule architecutre. In my mind its way to make Phalcon more popular for serious projects. Currently are some issues in this architecture, for example dispatching and security check. Make it php 7.1 compatible :)
Maybe a more Laravel kind of documentation.
Documentation needs some work. A lot of the powerful features of phalcon are not well documented (eg the validation class). Some more extensive examples would be nice too...
I really miss a proper tutorial..and there are like 5 ways to bootstrap your application and all look amateurish and messy
Great work! Please continue to expand PHQL, its great but can be quite limiting in its capabilities sometimes.
Hopefully there's gonna be updated video tutorials.
Very nice job and a big thank you for your work!

Conclusion

We intend on having these user surveys in regular intervals (say every six months or so) in order to get feedback from our community.

Clearly from this survey two things stand out:

  1. Speed/Performance is very important
  2. The documentation needs a lot of work

We will ensure that speed/performance are number one in our priority list, while keeping the framework feature rich. Indeed our documentation has not been stellar and more importantly not uniformed. Work on this has already started in Q1 where a total revamp of the documentation is scheduled at the end of this quarter (Q2) or earlier if possible.

We are also working on our Q2 goals (new blog post coming shortly) which take the above in consideration.

Appendix

Raw data file

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Continuing from our yesterday's post, we are checking the benchmarks for micro PHP frameworks.

From feedback from the community, we intend to expand this test to be a bit more realistic, offering CRUD tests, JSON responses etc. We will work on this with the community in our repo so any help and suggestions are more than welcome!

Phalcon offers the Phalcon\Mvc\Micro application, used to create micro applications. Again we hope that this blog post will give an indication on what one can expect from a Phalcon Micro application. Note that this blog and our website both run using the Phalcon Micro application. Both sites run on an Amazon VM with 512Mb RAM and 1 vCPU.

Methodology

We used the same methodology as when benchmarking the full frameworks. A simple Hello World was displayed on the screen. Naturally, this is not a real life example, but it demonstrates the minimum resources needed to display a simple string on the screen.

As with the previous test, we are measuring the the time it takes for each framework to start, run each action, present the result needed and free up the resources at the end of the request. Any PHP application based on the said framework will need this time and resources. It is safe to assume that any implementations that will be much more complex than this one will require additional resources per request.

The ab benchmarking tool from Apache was used for these tests. 1,000 requests using 5 concurrent connections for each framework.

Results

We will start with the results of our benchmark. The hardware used, raw data as well as setup/configuration changes we did for each framework are further down in this post.

Included Files

We have used the get_included_files() function to figure out how many files have been included for one request. The call to the function was at the end of the entry point, usually index.php (lower is better). As one can expect, most micro frameworks can be dispatched in one file.

image

Memory used (KB)

We have used the memory_get_usage() function to figure out how many much memory was used for each request. The call to this function was at the end of the entry point, usually index.php. (lower is better).

image

Requests per Second (mean)

Using the ab tool, we measured the requests per second that each framework could handle. (higher is better).

image

Time to complete 1,000 requests

Again using the ab tool, we measured the time it took to complete 1,000 requests. (lower is better).

image

Conclusion

Just as our previous benchmark, Phalcon is outperforming any other framework in this test.

A couple of observations:

  • We modified Lumen and Silex moving services, routes etc. to the index.php file so that we can have a more realistic idea of how many files would be included for a simple request.
  • In the Requests per Second test, the requests are much closer between Phalcon, Limonade and FatFree. Still 100-300 requests per second slower, but this shows how these frameworks perform in the micro application world.
  • The Time to complete test is also close between Phalcon, Limonade and FatFree, between 0.1-0.2 seconds.

Again we will stress out that these are bare bones applications on Micro frameworks, intended to give you an idea of how fast your framework is, in a simple test. The results will definitely vary based on your installation and implementation. Adding more services as needed by the functionality of each application developed will significantly increase the values shown above (or decrease in the Requests per second test).

As mentioned in our previous post nothing beats a good design or better yet, the best design for the application needs. Phalcon offers a fast full stack framework as well as a micro one. The main difference (here comes the sales pitch ) is that since Phalcon is memory resident and loosely coupled, it offers a wealth of components ready to be used whenever needed, without having to slim down the framework itself i.e. speed vs. features. It is worth a look.

NOTE: If any of our readers have suggestions that we could implement to make this benchmark as realistic as possible, feel free to issue a pull request with your suggestions or your submission of another framework
The last benchmark that one can find is from TechEmpower which was conducted on November 16, 2016. According to their test schedule, we should have seen round 14 in February this year but that has not happened yet.

<3 Phalcon Team

Appendix

Github Repo

Framework Benchmarks

Hardware

I set up a virtual machine with Ubuntu Server 16.10. We stopped the X server and allocated 4GB of RAM and 50GB of hard drive space.

After the system was updated to the latest packages, Apache was installed on the virtual machine. For PHP and Phalcon we chose to use PHP 7.1 using the PPA from Ondřej Surý.

PHP

Version
PHP 7.1.3-3+deb.sury.org~yakkety+1 (cli) (built: Mar 25 2017 14:01:32) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.3-3+deb.sury.org~yakkety+1, Copyright (c) 1999-2017, by Zend Technologies
Modules

OPCache was enabled and the installation was the default one without any modifications in php.ini. The modules installed were:

calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gettext, hash, iconv, intl, json, libxml, mbstring, mcrypt, openssl, pcntl, pcre, PDO, phalcon, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets , SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zlib

Frameworks

The frameworks compared were:

Limonade has not been updated for nearly 4 years but is a fast micro framework that we thought would be great to include it in our tests

Installation and Changes

We tried to make this test as realistic as possible, ensuring that all frameworks behave in production mode. However, nobody is perfect so any suggestions that the community can provide to tweak each framework to its maximum potential, feel free to issue a pull request in our Github repository.

FatFree

index.php

<?php

$f3=require('lib/base.php');

$f3->route('GET /',
    function() {
        echo 'Hello World!';
    }
);
$f3->run();

Limonade

index.php

<?php

ini_set('display_errors', 0);

require_once __DIR__.'/vendor/lib/limonade.php';

dispatch('/', 'hello');
  function hello()
  {
      return 'Hello World!';
  }
run();

Lumen

public/index.php

<?php

require_once __DIR__.'/../vendor/autoload.php';

try {
    (new Dotenv\Dotenv(__DIR__.'/../'))->load();
} catch (Dotenv\Exception\InvalidPathException $e) {
    //
}

$app = new Laravel\Lumen\Application(
    realpath(__DIR__.'/../')
);

$app->get('/', function () use ($app) {
    return "Hello World!";
//    return $app->version();
});

$app->run();

Phalcon

index.php

<?php

$app = new Phalcon\Mvc\Micro();

$app->get(
    '/',
    function () {
        echo "Hello World!";
    }
);

$app->notFound(
    function() {
        echo "Not Found";
    }
);

$app->handle();

Silex

web/index.php

<?php

use Silex\Application;

ini_set('display_errors', 0);

require_once __DIR__.'/../vendor/autoload.php';

$app = new Application();

$app->get('/', function () use ($app) {
    return "Hello World!";
//    return $app['twig']->render('index.html.twig', array());
})
    ->bind('homepage')
;

$app->error(function (\Exception $e, Request $request, $code) use ($app) {
    return "Error: " . $e->getMessage();
});

$app->run();

ab results

FatFree

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /micro/fatfree/
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   0.811 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      420000 bytes
HTML transferred:       12000 bytes
Requests per second:    1233.71 [#/sec] (mean)
Time per request:       4.053 [ms] (mean)
Time per request:       0.811 [ms] (mean, across all concurrent requests)
Transfer rate:          506.01 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       3
Processing:     1    4   5.4      2      55
Waiting:        1    2   3.0      2      35
Total:          1    4   5.4      2      56

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      3
  75%      3
  80%      3
  90%      9
  95%     15
  98%     26
  99%     28
 100%     56 (longest request)

Limonade

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /micro/limonade/
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   0.631 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      404000 bytes
HTML transferred:       12000 bytes
Requests per second:    1584.79 [#/sec] (mean)
Time per request:       3.155 [ms] (mean)
Time per request:       0.631 [ms] (mean, across all concurrent requests)
Transfer rate:          625.25 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       1
Processing:     1    3   5.3      1      46
Waiting:        0    2   1.4      1      25
Total:          1    3   5.3      2      47

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      3
  90%      4
  95%     14
  98%     24
  99%     30
 100%     47 (longest request)

Lumen

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /micro/lumen/public/
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   1.328 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      213000 bytes
HTML transferred:       12000 bytes
Requests per second:    752.89 [#/sec] (mean)
Time per request:       6.641 [ms] (mean)
Time per request:       1.328 [ms] (mean, across all concurrent requests)
Transfer rate:          156.61 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       2
Processing:     1    6   6.8      3      43
Waiting:        1    5   6.0      3      43
Total:          1    7   6.8      4      44

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      5
  75%      7
  80%     11
  90%     17
  95%     23
  98%     27
  99%     31
 100%     44 (longest request)

Phalcon Micro

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /micro/phalcon/
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   0.591 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      179000 bytes
HTML transferred:       12000 bytes
Requests per second:    1691.97 [#/sec] (mean)
Time per request:       2.955 [ms] (mean)
Time per request:       0.591 [ms] (mean, across all concurrent requests)
Transfer rate:          295.76 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.2      0       1
Processing:     0    3   7.0      1      83
Waiting:        0    2   5.1      1      80
Total:          1    3   7.0      2      84

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      2
  75%      2
  80%      2
  90%      3
  95%      9
  98%     25
  99%     31
 100%     84 (longest request)

Silex

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /micro/silex/web/
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   1.663 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      251000 bytes
HTML transferred:       12000 bytes
Requests per second:    601.48 [#/sec] (mean)
Time per request:       8.313 [ms] (mean)
Time per request:       1.663 [ms] (mean, across all concurrent requests)
Transfer rate:          147.43 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.5      0       4
Processing:     1    8   9.0      4      57
Waiting:        1    6   7.4      3      48
Total:          1    8   9.0      4      57

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      7
  75%     11
  80%     13
  90%     21
  95%     28
  98%     37
  99%     44
 100%     57 (longest request)
01010000011010000110000101101100011000110110111101101110010100000100100001010000

It has been quite a while since we run our benchmarks against other networks. Actually the last time we had the benchmarks in our documentation was for Phalcon 1.3! Yes we know, we have been neglecting this.

Hopefully this post will offer some perspective on what you can expect from Phalcon and your application. It goes without saying that every application needs the best design for its needs, but using Phalcon can also push your application's performance even further.

Methodology

We have installed the stock application for each framework. We have ensured that there is one route, one controller and one view that will allow us to display Hello World on the screen. Naturally, this is not a real life example, but it demonstrates the minimum resources needed to display a simple string on the screen.

Note: These are the stock applications that each framework offers. The only thing that we changed is to put each framework in Production mode.

This benchmark only measures the time it takes for each framework to start, run each action, present the result needed and free up the resources at the end of the request. Any PHP application based on the said framework will need this time and resources. It is safe to assume that any implementations that will be much more complex than this one will require additional resources per request.

The ab benchmarking tool from Apache was used for these tests. 1,000 requests using 5 concurrent connections for each framework.

Results

We will start with the results of our benchmark. The hardware used, raw data as well as setup/configuration changes we did for each framework are further down in this post.

Included Files

We have used the get_included_files() function to figure out how many files have been included for one request. The call to the function was at the end of the entry point, usually index.php (lower is better).

image

Memory used (KB)

We have used the memory_get_usage() function to figure out how many much memory was used for each request. The call to this function was at the end of the entry point, usually index.php. (lower is better).

image

Requests per Second (mean)

Using the ab tool, we measured the requests per second that each framework could handle. (higher is better).

image

Time to complete 1,000 requests

Again using the ab tool, we measured the time it took to complete 1,000 requests. (lower is better).

image

Conclusion

Phalcon is clearly outperforming any other framework in this test.

Again we will stress out that these are just the stock applications that come with each framework. The results will definitely vary based on your installation. For instance a developer could remove services from a particular framework which will speed it up (at least the included files) but could also add more services which would slow it down.

Nothing beats a good design or better yet, the best design for the application needs. However, if you can gain some performance and lower your memory consumption by just using Phalcon, it is worth a look and a try if you haven't done so already .

NOTE: If any of our readers have suggestions that we could implement to make this benchmark as realistic as possible, feel free to issue a pull request with your suggestions.
The last benchmark that one can find is from TechEmpower which was conducted on November 16, 2016. According to their test schedule, we should have seen round 14 in February this year but that has not happened yet.

<3 Phalcon Team

Appendix

Github Repo

Framework Benchmarks

Hardware

I set up a virtual machine with Ubuntu Server 16.10. We stopped the X server and allocated 4GB of RAM and 50GB of hard drive space.

After the system was updated to the latest packages, Apache was installed on the virtual machine. For PHP and Phalcon we chose to use PHP 7.1 using the PPA from Ondřej Surý.

PHP

Version
PHP 7.1.3-3+deb.sury.org~yakkety+1 (cli) (built: Mar 25 2017 14:01:32) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.3-3+deb.sury.org~yakkety+1, Copyright (c) 1999-2017, by Zend Technologies
Modules

OPCache was enabled and the installation was the default one without any modifications in php.ini. The modules installed were:

calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gettext, hash, iconv, intl, json, libxml, mbstring, mcrypt, openssl, pcntl, pcre, PDO, phalcon, Phar, posix, readline, Reflection, session, shmop, SimpleXML, sockets , SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zlib

Frameworks

The frameworks compared were:

Installation and Changes

We tried to make this test as realistic as possible, ensuring that all frameworks behave in production mode. However, nobody is perfect so any suggestions that the community can provide to tweak each framework to its maximum potential, feel free to issue a pull request in our Github repository.

FuelPHP

curl https://get.fuelphp.com/oil | sh
oil create fuelphp

fuelphp/fuel/app/bootstrap.php

\Fuel::$env = \Arr::get($_SERVER, 'FUEL_ENV', \Arr::get($_ENV, 'FUEL_ENV', \Fuel::PRODUCTION));
// \Fuel::$env = \Arr::get($_SERVER, 'FUEL_ENV', \Arr::get($_ENV, 'FUEL_ENV', \Fuel::DEVELOPMENT));

fuelphp/fuel/app/views/welcome/index.php

Hello World!

Kohana

wget https://github.com/kohana/kohana/releases/download/v3.3.6/kohana-v3.3.6.zip
unzip kohana-v3.3.6.zip

kohana/application/bootstrap.php

if (isset($_SERVER['KOHANA_ENV']))
{
    Kohana::$environment = constant('Kohana::'.strtoupper($_SERVER['KOHANA_ENV']));
}
Kohana::$environment = Kohana::PRODUCTION;

kohana/application/classes/Controller/Welcome.php

<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Welcome extends Controller_Template {
        public $template = 'welcome';
        public function action_index()
        {
                $this->template->message = 'Hello, World!';
        }

} // End Welcome

kohana/application/views/welcome.php

<?php echo $message; ?>

Laravel

composer create-project --prefer-dist laravel/laravel laravel

laravel/.env

APP_DEBUG=false

laravel/config/app.php

    ...
    'env' => env('APP_ENV', 'production'),
    'debug' => env('APP_DEBUG', false),
    ...

laravel/resources/views/welcome.blade.php

Hello World!

Nette

composer create-project nette/web-project nette
cd nette
chmod -R a+rw temp log

nette/app/presenters/templates/Homepage/default.latte

Hello World!

Phalcon

Downloaded sample from the MVC repository.

phalcon/app/views/index.phtml

Hello World!

Symfony

composer create-project symfony/framework-standard-edition symfony

symfony/app/Resources/views/base.html.twig

Hello World

Yii

composer global require "fxp/composer-asset-plugin:^1.2.0"
composer create-project --prefer-dist yiisoft/yii2-app-basic yii

yii/web/index.php

<?php

// comment out the following two lines when deployed to production
//defined('YII_DEBUG') or define('YII_DEBUG', true);
//defined('YII_ENV') or define('YII_ENV', 'dev');

yii/config/web.php

/**
if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
        // uncomment the following to add your IP if you are not connecting from localhost.
        //'allowedIPs' => ['127.0.0.1', '::1'],
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        // uncomment the following to add your IP if you are not connecting from localhost.
        //'allowedIPs' => ['127.0.0.1', '::1'],
    ];
}
*/
return $config;

yii/views/site/index.php

Hello World!

yii/views/layouts/main.php

<?= $content ?>

Zend Framework

composer create-project zendframework/skeleton-application zf

zf/public/index.php

// Retrieve configuration
$appConfig = require __DIR__ . '/../config/application.config.php';
//if (file_exists(__DIR__ . '/../config/development.config.php')) {
//    $appConfig = ArrayUtils::merge($appConfig, require __DIR__ . '/../config/development.config.php'); 
//}

zf/module/Application/view/layout/layout.phtml

<?= $this->content ?>

ab results

FuelPHP

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /fuelphp/public/
Document Length:        13 bytes

Concurrency Level:      5
Time taken for tests:   1.827 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      180000 bytes
HTML transferred:       13000 bytes
Requests per second:    547.28 [#/sec] (mean)
Time per request:       9.136 [ms] (mean)
Time per request:       1.827 [ms] (mean, across all concurrent requests)
Transfer rate:          96.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.6      0       4
Processing:     1    9  10.0      4      72
Waiting:        1    7   8.6      3      61
Total:          2    9  10.0      4      75
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      8
  75%     12
  80%     15
  90%     23
  95%     31
  98%     40
  99%     45
 100%     75 (longest request)

Kohana

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /kohana/
Document Length:        13 bytes

Concurrency Level:      5
Time taken for tests:   1.100 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      180000 bytes
HTML transferred:       13000 bytes
Requests per second:    908.72 [#/sec] (mean)
Time per request:       5.502 [ms] (mean)
Time per request:       1.100 [ms] (mean, across all concurrent requests)
Transfer rate:          159.74 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.5      0       4
Processing:     1    5   5.1      3      45
Waiting:        1    4   4.6      3      45
Total:          1    5   5.0      4      46

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      4
  75%      5
  80%      6
  90%     12
  95%     16
  98%     22
  99%     27
 100%     46 (longest request)

Laravel

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /laravel/public/
Document Length:        13 bytes

Concurrency Level:      5
Time taken for tests:   4.803 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      997232 bytes
HTML transferred:       13000 bytes
Requests per second:    208.22 [#/sec] (mean)
Time per request:       24.013 [ms] (mean)
Time per request:       4.803 [ms] (mean, across all concurrent requests)
Transfer rate:          202.77 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       6
Processing:     4   24  21.0     21     280
Waiting:        4   20  20.2     16     280
Total:          4   24  21.0     21     281

Percentage of the requests served within a certain time (ms)
  50%     21
  66%     29
  75%     33
  80%     36
  90%     43
  95%     54
  98%     71
  99%     99
 100%    281 (longest request)

Nette

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /nette/www/
Document Length:        13 bytes

Concurrency Level:      5
Time taken for tests:   1.876 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      264000 bytes
HTML transferred:       13000 bytes
Requests per second:    533.14 [#/sec] (mean)
Time per request:       9.378 [ms] (mean)
Time per request:       1.876 [ms] (mean, across all concurrent requests)
Transfer rate:          137.45 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.6      0       4
Processing:     1    9   9.0      5      73
Waiting:        1    7   7.7      4      49
Total:          1    9   9.0      5      73
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%      5
  66%      9
  75%     13
  80%     16
  90%     22
  95%     28
  98%     35
  99%     43
 100%     73 (longest request)

Phalcon

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /phalcon/
Document Length:        13 bytes

Concurrency Level:      5
Time taken for tests:   0.712 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      180000 bytes
HTML transferred:       13000 bytes
Requests per second:    1403.86 [#/sec] (mean)
Time per request:       3.562 [ms] (mean)
Time per request:       0.712 [ms] (mean, across all concurrent requests)
Transfer rate:          246.77 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.3      0       4
Processing:     1    3   3.9      2      33
Waiting:        0    2   1.7      2      28
Total:          1    4   4.0      3      33

Percentage of the requests served within a certain time (ms)
  50%      3
  66%      3
  75%      3
  80%      3
  90%      6
  95%     11
  98%     19
  99%     24
 100%     33 (longest request)

Symfony

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /full/symfony/web/
Document Length:        13 bytes

Concurrency Level:      5
Time taken for tests:   4.602 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      252000 bytes
HTML transferred:       13000 bytes
Requests per second:    217.31 [#/sec] (mean)
Time per request:       23.008 [ms] (mean)
Time per request:       4.602 [ms] (mean, across all concurrent requests)
Transfer rate:          53.48 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       4
Processing:     4   23  21.3     21     277
Waiting:        3   15  20.2      9     276
Total:          4   23  21.3     22     277

Percentage of the requests served within a certain time (ms)
  50%     22
  66%     27
  75%     30
  80%     32
  90%     38
  95%     46
  98%     55
  99%     72
 100%    277 (longest request)

Yii

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /yii/web/
Document Length:        12 bytes

Concurrency Level:      5
Time taken for tests:   1.073 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      179000 bytes
HTML transferred:       12000 bytes
Requests per second:    932.10 [#/sec] (mean)
Time per request:       5.364 [ms] (mean)
Time per request:       1.073 [ms] (mean, across all concurrent requests)
Transfer rate:          162.94 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0       4
Processing:     1    5   7.5      2      54
Waiting:        1    4   6.3      2      42
Total:          1    5   7.5      2      54

Percentage of the requests served within a certain time (ms)
  50%      2
  66%      3
  75%      4
  80%      6
  90%     15
  95%     23
  98%     32
  99%     38
 100%     54 (longest request)

Zend Framework

This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 10.4.6.123 (be patient)

Server Software:        Apache/2.4.18
Server Hostname:        10.4.6.123
Server Port:            80

Document Path:          /zf/public/
Document Length:        24 bytes

Concurrency Level:      5
Time taken for tests:   3.731 seconds
Complete requests:      1000
Failed requests:        0
Total transferred:      191000 bytes
HTML transferred:       24000 bytes
Requests per second:    268.05 [#/sec] (mean)
Time per request:       18.654 [ms] (mean)
Time per request:       3.731 [ms] (mean, across all concurrent requests)
Transfer rate:          50.00 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.6      0       4
Processing:     3   18  18.4      8     101
Waiting:        3   13  15.0      5     101
Total:          3   19  18.4      8     101

Percentage of the requests served within a certain time (ms)
  50%      8
  66%     23
  75%     31
  80%     35
  90%     46
  95%     55
  98%     67
  99%     76
 100%    101 (longest request)

Revisions

2017-04-13 18:22 Symfony: changed $kernel = new AppKernel('prod', false); and rerun the results. Kudos (@msvrtan).

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hey everyone!!

As part of our restructuring and working towards a better more robust framework in terms of features as well as organization, we have removed the IDE stubs from the Phalcon DevTools repository and moved to its own repository.

Since Phalcon is a module that is loaded in memory and always available, there is no way for an IDE such as PHPStorm to interrogate the sources of the framework and offer autocomplete features for namespaces, classes, methods etc.

To work around this issue, the Phalcon team has been generating IDE stubs that can be used with such IDEs.

You can now find those stubs in Packagist:

https://packagist.org/packages/phalcon/ide-stubs

The installation is extremely simple.

Composer

Install Composer in a common location or in your project:

curl -s http://getcomposer.org/installer | php

Create the composer.json file as follows:

{
    "require-dev": {
        "phalcon/ide-stubs": "*"
    }
}

Run the composer installer:

php composer.phar install

Git

Clone the Phalcon IDE Stubs repository in a location of your choosing.

git clone https://github.com/phalcon/ide-stubs.git

Setup your IDE.

For PHPStorm users, you can:

  • Right mouse click on the External Libraries in the Project listing pane
  • Click Configure PHP Include Paths
  • Click the green + button and click Specify Other...
  • Navigate to the folder where the stubs are located
  • Click the Phalcon folder and click OK
  • Click Apply and then OK
Note: The video above shows how to enable the IDE stubs cloning the DevTools. The installation is the same, all you have to do is locate the Phalcon project

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!!

We are extremely happy today to announce the release of our newest Phalcon version: 3.1.2.

This release fixes a few bugs, but one of them has been one of the most sought after by the community: PHP 7.1 support.

The release tag can be found here: 3.1.2

Imagick::getVersion()

Fixed Imagick::getVersion() error in some systems #12729. In certain systems, extending Imagick::getVersion() cannot be called and is correctly called now using Imagick->getVersion().

Object of class Phalcon\Db\RawValue could not be converted to float

Fixed Phalcon\Mvc\Model::_doLowInsert to properly set snapshot when having default values and public properties #12766

PHP 7.1 Support

Fixed PHP 7.1 issues #12055.

This issue took us a lot longer to address than we would have liked. We had to tackle issues with Zephir as well as our code generation scripts along with this one.

The wait is over though! Phalcon can be installed with PHP 7.1 installations, so enjoy it!

Q1 update

Regarding our goals, we are a bit behind on our Zephir Milestone with 50% done. We are working however hard to fix all the issues remaining. The documentation revamp also is moving along nicely.

Community

A huge thank you and kudos to our community for the patience and support all this time. Also huge thank you to our contributors for making this release possible!

Update/Upgrade

Phalcon 3.1.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 that the 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

Good morning everyone!

We would like to update you on our funding campaign. As most know, we started a funding campaign a few months back, in an effort to raise capital which will help us offer a better, faster and more feature rich framework to our community.

The funds would be used to hire specialists in C, sponsor bug fixes and features, cover expenses for potential conferences etc.

In order to increase transparency and so that everyone knows how much money we have, who the backers are and where we spent it, it was suggested that we switch our funding vendor to Open Collective.

Our Patreon campain therefore has been suspended, and replaced with Open Collective. You can find our new funding page here:

https://opencollective.com/phalcon

With Open Collective, any expense has to be approved by the team and everyone can see who spent how much and on what.

If you have been supporting us through Patreon, we have already sent you an email asking you to cancel your patronage there and continue (if you wish) in Open Collective.

If you are considering in supporting us, feel free to visit our OpenCollective page and support us!

A big thank you to our supporters, backers as well as users!!

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hey everyone.

We are releasing a hotfix today 3.1.1 that addresses some urgent issues with the framework. We strongly recommend that you upgrade your Phalcon version to the latest release 3.1.1.

As with any software, we have the you broke it scenario here. Thanks to the quick reporting from the community, we managed to fix the issues that came up, and therefore issue the hotfix today.

The release tag can be found here: 3.1.1

Undefined indexes in models

After the upgrade to 3.1.0, all models were issuing warnings:

Undefined index: keepSnapshots in Users.php on line 61
Undefined index: keepSnapshots in Groups.php on line 57

The issue would be rectified after clearing the query cache but still not a perfect solution. We have fixed it with PR-12737.

doLowUpdate() - First argument is not array

After the upgrade we have experienced the following issue:

$robot = Robots::findFirst();

$robot2 = new Robot($robot->toArray(), $di, $modelsManager);
$robot2->setNewValueForField(100);

try {
    $robot2->setDirtyState($robot2::DIRTY_STATE_PERSISTENT); 
    $robot2->save();
} catch (\Exception $exception) {
   echo "ERROR: " . $exception->getMessage();
}
Results in:
ERROR: First argument is not an array

It was reported in #12742 and it was fixed with PR-12739.

Expanding on 3.1.0 Version highlights

  • Added Phalcon\Validation\Validator\Callback, Phalcon\Validation::getData [NEW]

    We added new validator Phalcon\Validation\Validator\Callback where you can execute any logic you want. It should return true, false or new Validator which should be used to validate your field.

<?php

use Phalcon\Validation;
use Phalcon\Validation\Validator\Callback;
use Phalcon\Validation\Validator\PresenceOf;

$validation = new Validation();
$validation->add(
  "amount",
  new Callback(
      [
          'callback' => function($data) {
              return $data['amount'] % 2 == 0;
          },
          'message'  => 'Only even number of products are accepted',
      ]
  )
);

$messages = $validation->validate(['amount' => 1]); // will return a message from first validator

For more information read our documentation

  • Added Phalcon\Mvc\Model\Binder, class used for binding models to parameters in dispatcher, micro

  • Added Phalcon\Dispatcher::getBoundModels and Phalcon\Mvc\Micro::getBoundModels to getting bound models

  • Added Phalcon\Mvc\Micro\Collection\LazyLoader::callMethod

    In Phalcon 3 we introduced binding model instances in controller actions. In Phalcon 3.1 we decided to move the code controlling this to a separated class, optimize it a bit and offer a way to use the same functionality in Phalcon\Mvc\Micro as well. Since it's using Reflection API we also added way to cache it. In addition to this Phalcon\Dispatcher::setModelBinding() is now deprecated and will be removed in Phalcon 4. From Phalcon 3.2 usage of this method will trigger E_DEPRECATED

<?php

use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\Dispatcher;
use Phalcon\Mvc\Model\Binder;

$di = new FactoryDefault();
$di->set(
    'dispatcher', 
    function() {
        $dispatcher = new Dispatcher();
        $dispatcher->setModelBinder(new Binder(), 'cache');

        return $dispatcher;
    }
);

And you can type-hint your action parameters with class names. For more information read docs: using in micro, using in dispatcher

  • Added afterBinding event to Phalcon\Dispatcher and Phalcon\Mvc\Micro, added Phalcon\Mvc\Micro::afterBinding [NEW]

    We added new event to the dispatcher and micro application. afterBinding event (or middleware in micro) will trigger after binding model instances done by the Phalcon\Mvc\Model\Binder component but before executing an action.

  • Added the ability to set custom Resultset class returned by find() #12166 [NEW]

    By using this feature you can have your own custom Resultset classes with your own logic.

<?php

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Resultset\Simple;

class AgeStats extends Model
{
  public function getSource()
  {
      return 'stats';
  }

  public function getResultsetClass()
  {
      return 'MyResultset';
  }
}

class MyResultset extends Simple 
{
 // implement your custom logic here
}

$stats = AgeStats::find(); // it will return MyResultset instance
  • Clear appended and prepended title elements (Phalcon\Tag::appendTitle, Phalcon\Tag::prependTitle) [NEW]

    You can now clear and add multiple elements to appendTitle and prependTitle on the Phalcon\Tag component.

<?php

\Phalcon\Tag::setTitleSeparator(' - ');
\Phalcon\Tag::setTitle('Title');

// Somewhere in controller
\Phalcon\Tag::prependTitle('Category');
\Phalcon\Tag::prependTitle('Article');

// Same situation - clear and put just one prepend element
// (will be faster than clear all values)
\Phalcon\Tag::prependTitle(['Just article']);

// Or other - clear and put a few elements
\Phalcon\Tag::prependTitle(['Other category', 'Other article']);
  • Added the ability to specify what empty means in the 'allowEmpty' option of the validators. It now accepts also an array specifying what is considered empty, i.e. ['', false] [NEW]

    Previously allowEmpty option in validators would accept only true value, meaning it allows empty values. Right now you can provide an array with the values that are considered as empty for your validator.

<?php

use Phalcon\Validation;
use Phalcon\Validation\Validator\PresenceOf;

$validation = new Validation();
$validation->add(
    'description', 
    new PresenceOf(
        [
            'message'    => 'Description is required',
            'allowEmpty' => [null],
        ]
    )
);

$messages = $validation->validate(['description' => null]); // empty messages
$messages = $validation->validate(['description' => '']);   // will return message from validator
  • Added the ability to use Phalcon\Validation with Phalcon\Mvc\Collection, deprecated Phalcon\Mvc\Model\Validator classes [NEW]

    In Phalcon 3 we made changes to model validators so as to use the same classes as form validators. The same functionality was missing from the Phalcon\Mvc\Collection. We have addressed that issue and you can now use the Phalcon\Validation component for Mongo Collections. The required changes were also made in phlacon/incubator and PHP7 related classes. We encourage you to switch to the new validation as soon as you can, since in Phalcon 4 we will remove old Phalcon\Mvc\Model\Validator namespace. From Phalcon 3.2, usage of old classes will trigger E_DEPRECATED

<?php

use Phalcon\Mvc\Collection;
use Phalcon\Validation;
use Phalcon\Validation\Validator\PresenceOf;

class Robots extends Collection
{
  public function validation()
  {
      $validation = new Validation();
      $validation->add('name', new PresenceOf());

      return $this->validate($validation);
  }
}

$robots = new Robots();
$robots->create(); // returns false
$robots->name = 'Some Robot';
$robots->create(); // returns true

More information can be found in our documentation: validating collections, validation

Please note that Phalcon 3.1 is not compatible with PHP 7.1. If you want to use PHP 7, you will need to compile it with PHP 7.0. Full support for PHP 7.1+ will be introduced in our next version

Community

Again big kudos to our community for finding the bugs addressed in this hotfix and @jurigag for the help with this blog post.

Update/Upgrade

Phalcon 3.1.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.

Windows DLLs are available in the download page.

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

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

We are really excited to announce Phalcon's latest release: 3.1.0!

This release addresses several bug fixes and also introduces additional functionality to the framework

The release tag can be found here: 3.1.0

Highlights

  • Added Phalcon\Validation\Validator\Callback, Phalcon\Validation::getData
  • Added the ability to truncate database tables
  • Added Phalcon\Mvc\Model\Binder, class used for binding models to parameters in dispatcher, micro, added Phalcon\Dispatcher::getBoundModels and Phalcon\Mvc\Micro::getBoundModels to getting bound models, added Phalcon\Mvc\Micro\Collection\LazyLoader::callMethod
  • Added afterBinding event to Phalcon\Dispatcher and Phalcon\Mvc\Micro, added Phalcon\Mvc\Micro::afterBinding
  • Added the ability to set custom Resultset class returned by find() #12166
  • Added the ability to clear appended and prepended title elements (Phalcon\Tag::appendTitle, Phalcon\Tag::prependTitle). Now you can use array to add multiple titles. For more details check #12238.
  • Added the ability to specify what empty means in the 'allowEmpty' option of the validators. Now it accepts as well an array specifying what's empty, for example ['', false]
  • Added the ability to use Phalcon\Validation with Phalcon\Mvc\Collection, deprecated Phalcon\Mvc\Model\Validator classes
  • Added the value of the object intanceof Interface to Phalcon\Acl\Adapter\Memory
  • Added the ability to get original values from Phalcon\Mvc\Model\Binder, added Phalcon\Mvc\Micro::getModelBinder, Phalcon\Dispatcher::getModelBinder
  • Added prepend parameter to Phalcon\Loader::register to specify autoloader's loading order to top most
  • Fixes internal cache saving in Phalcon\Mvc\Model\Binder when no cache backend is used
  • Fixed Phalcon\Session\Bag::remove to initialize the bag before removing a value #12647
  • Fixed Phalcon\Mvc\Model::getChangedFields to correct detect changes from NULL to Zero #12628
  • Fixed Phalcon\Mvc\Model to create/refresh snapshot after create/update/refresh operation #11007, #11818, #11424
  • Fixed Phalcon\Mvc\Model::validate to correctly set code message #12645
  • Fixed Phalcon\Mvc\Model to correctly add error when try to save empty string value to not null and not default column #12688
  • Fixed Phalcon\Validation\Validator\Uniqueness collection persistent condition
  • Fixed Phalcon\Loader::autoLoad to prevent PHP warning #12684
  • Fixed Phalcon\Mvc\Model\Query::_executeSelect to correctly get the column map #12715
  • Fixed params view scope for PHP 5 #12648
Please note that Phalcon 3.1 is not compatible with PHP 7.1. If you want to use PHP 7, you will need to compile it with PHP 7.0. Full support for PHP 7.1+ will be introduced in our next version

Community

Big kudos to our community as always for reporting, suggesting and applying fixes and making our framework better with every release! A big thank you to all our backers and supporters that help us by joining our funding campaign. https://phalcon.link/fund

Team

We are making some changes to our team, bringing more people in to help with the organization, management as well as structure of the project. Our end goals are to produce timely releases with zero or minimal bugs, and to implement new features regularly. This is still work in progress, so once we have everything settled, we will explain everything with a relevant blog post.

Update/Upgrade

Phalcon 3.1.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.

Windows DLLs are available in the download page.

Linux packages will be available in a couple of hours after the posting of this blog post

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

<3 Phalcon Team

01010000011010000110000101101100011000110110111101101110010100000100100001010000

Hello everyone!

We would like to give you a quick update on the work done so far, trying to meet our Q1 goals.

Github

We have converted the Phalcon Github account to an organization. This move offers much better flexibility and organization for the project. Several contributors/members of the core team have been added to it, and more will follow soon.

We also started creating different groups in the organization, that will allow for a much better and streamlined process of assigning bugs and issues, merging pull requests, maintaining documentation etc. We are also investigating viable options for NFRs, where we can get a feel of which NFRs are mostly requested so that we can address them first.

We believe that this move will allow us to maintain a proper workflow, something that Phalcon and our community deserve.

We have also started moving some of the satellite repositories into the organization (such as link, phalcon-compose etc.) to help with resources and the organization of the project.

PHP 7.1

Work is continuing on fixing some PHP 7.1 blocking bugs with Phalcon and Zephir. We have managed so far to compile Phalcon with PHP 7.1 but it is not ready yet for release.

Additionally we reached out to some very talented members of the community with advanced C knowledge to help with this process. As things stand, we are still on track to have PHP 7.1 support by the end of Q1, most likely earlier.

Documentation

Admittedly our documentation needs a big revamp, adding more examples, tutorials, proper explanations for each component and keeping consistency throughout.

We have already started the effort with rewriting some of the documentation, which will be in the form of .md files using Markdown for the formatting. Everyone is welcome to join our effort in our Slack channel, where we discuss and collaborate on the content.

Sites

We started refactoring all the sites with different implementations. In recent blog posts, we explained how we refactored our website using a Micro application and middleware. The blog posts (links below) will become part of our documentation in an effort to bring real life examples to the community.

The next site to be revamped will be the builtwith.

Survey

We recently asked the community to take a short survey, so that we can assess why developers use Phalcon, if it is used in production and also asked for any additional input they want to give us.

If you have not taken the survey yet, feel free to visit this form

We will post the results of the survey in a week or so, when we get more replies. So far we have over 100 replies. Thank you all for your valuable input!!!

Thank you

Once more a big thank you to our amazing community! You guys rock!

<3 Phalcon Team

References

01010000011010000110000101101100011000110110111101101110010100000100100001010000