CakePHP 3.0 and PHP 5.4

791 views
Skip to first unread message

José Lorenzo Rodríguez

unread,
May 26, 2012, 11:12:49 PM5/26/12
to cakeph...@googlegroups.com
I know this has being brought up in internal channel a bunch of times, but I think it is relevant discussing it again. CakePHP 3.0 won't be release for at least the next 6 months in the most optimistic case, which would be the time when people start adopting 5.4 or start shopping for good frameworks supporting it.

CakePHP leaded PHP innovation for many years, but it is not doing so anymore despite it is on par with other frameworks and can be considered better in a lot of different metrics. I vote we should target next release for the current stable PHP version. What do you think?

Graham Weldon

unread,
May 26, 2012, 11:26:14 PM5/26/12
to cakeph...@googlegroups.com
I agree.
I think the past was a wash of developers and hosts stuck on old PHP versions.
The scenery in terms of developers and hosts has changed dramatically, and PHP support is even more widespread.
Finding 5.4 is dead easy already on hosts, and is supported by all the big players, even MS has their build sorted out.

Cheers,
Graham Weldon
Skype: grahamweldon

Saleh Souzanchi

unread,
May 27, 2012, 2:35:28 AM5/27/12
to cakeph...@googlegroups.com

 most  companies web hosting,now are  using of 2.5.17 or 5.3, because:

1 - Stable version of WebHost Manager scripts (Sypnl, Direct Admin) do not support new versions of PHP.

2 - Most customers of these companies, use of scripts  which  are not  incompatible with the old 5.3. Like jomla 1.5, WordPress,...
And can not force customers to upgrade to.

I consider these tips for choosing which version of PHP.


     Best Regards
   Saleh  Sozanchi
 * * * * * * * * * * * * *
Phone : +98 811 823 4448

William Golden

unread,
May 27, 2012, 12:32:39 AM5/27/12
to cakeph...@googlegroups.com
Totally agree. Aim for the future! 


William Golden
http://codebomber.com

Cauan Cabral

unread,
May 27, 2012, 3:39:28 PM5/27/12
to cakeph...@googlegroups.com
ZF 2 and Symfony 2 did that, why Cake won't? Totally agree.
If someone need a version supported by PHP 5.2, they use 2.x.
--
Cauan Cabral
----------------
Como falar comigo: Google Talk: cau...@gmail.com Skype: CauanCabral MSN: cau...@gmail.com
Onde me encontrar: LinkedinFacebookWordpressTwitterOrkut


mark_story

unread,
May 27, 2012, 10:43:01 PM5/27/12
to cakeph...@googlegroups.com
I'm in favor of aiming for 5.4 as well.  We get access to traits which greatly simplify concepts like behaviors.  In addition to that Closure::bindTo() is pretty powerful .

I think we can continue to release small enhancement releases on the 2.x series as well to continue to support applications/hosting setups where 5.4 isn't available yet.

-Mark

Thiago Belem

unread,
May 27, 2012, 10:50:58 PM5/27/12
to cakeph...@googlegroups.com
I'm not saying that you guys should use them, but what's your thoughts about namespaces in CakePHP? There's a plan about supporting it?

Graham Weldon

unread,
May 27, 2012, 11:29:21 PM5/27/12
to cakeph...@googlegroups.com
We do plan on supporting namespaces.
In fact Mark has already been tinkering. :)
 
Cheers,
Graham Weldon
http://grahamweldon.com
e. gra...@grahamweldon.com
p. (+61) 0407 017 293

Skype: grahamweldon




shama

unread,
May 29, 2012, 1:50:39 AM5/29/12
to cakeph...@googlegroups.com
+1 for PHP 5.4.
Rackspace Cloud Sites currently only support 5.3 but they plan to have 5.4 available in Q3 of 2012. So yay.

Kyle

AD7six

unread,
May 29, 2012, 5:19:52 AM5/29/12
to cakeph...@googlegroups.com
+1

I think these were both good decisions:
  • Cake 1.x as php4 compatible
  • Cake 2.x as php 5.2
But, time moves on and the changes introduced in 5.4 aren't as (potentially) confusing as the changes introduced in 5.3. It's not necessary to hold back as we did in the past, it makes sense to me to aim for the current version of php by the time 3.x is released, and not restrict ourselves to "just" the benefits of namespaces.

AD

Pierre Martin

unread,
May 29, 2012, 12:53:12 AM5/29/12
to cakephp-core
+1 for PHP5.4+ compatibility.
Traits are something that would make both performance boost and
implementation simple for things like Behaviors, even though there are
still some flaws in the implementation.

Th array syntax would make the core code more readable too imo. And
PHP5.4 also brings high performance improvements.
Pierre

On May 28, 5:29 am, Graham Weldon <gra...@grahamweldon.com> wrote:
> We do plan on supporting namespaces.
> In fact Mark has already been tinkering. :)
>
> Cheers,
> Graham Weldonhttp://grahamweldon.com
> e. gra...@grahamweldon.com
> p. (+61) 0407 017 293
>
> Skype: grahamweldon
>

Pierre Martin

unread,
May 29, 2012, 1:38:23 AM5/29/12
to cakephp-core
Another (smaller) advantage for the project towards 5.3 would be the
short syntax "<?=" for PHP opening tags.
Since the framework made the choice to use PHP as its templating
language, promoting the use of "<?=" over "<?php echo" would be of
interest. It is imo a logic suite to the change of the __() signature
in 2.0.

On a daily basis having PHP for template makes views very verbose,
which is one of the reasons why developers are moving towards
templating engines such as Twig. Baking views with the PHP short tag
would reduce this feeling.

Pierre

On May 28, 5:29 am, Graham Weldon <gra...@grahamweldon.com> wrote:
> We do plan on supporting namespaces.
> In fact Mark has already been tinkering. :)
>
> Cheers,
> Graham Weldonhttp://grahamweldon.com
> e. gra...@grahamweldon.com
> p. (+61) 0407 017 293
>
> Skype: grahamweldon
>

Juan Basso

unread,
May 29, 2012, 8:47:13 AM5/29/12
to cakeph...@googlegroups.com

+1 to php 5.4. Performance and new features definitely will helps a lot. With traits it will also help to fix some "issues" caused by namespace.

Juan Basso

Carlos Gant

unread,
May 29, 2012, 4:57:50 PM5/29/12
to cakeph...@googlegroups.com
+1 to php 5.4

William Golden

unread,
May 29, 2012, 9:05:17 AM5/29/12
to cakeph...@googlegroups.com
Pierre, on 5.4 short open tags will always be enabled: http://marc.info/?t=123964298400001&r=1&w=2


William Golden

Graham Weldon

unread,
May 29, 2012, 7:31:09 PM5/29/12
to cakeph...@googlegroups.com
I'm pretty sure thats what he was getting at.
--
Cheers,
Graham Weldon

José Lorenzo Rodríguez

unread,
May 29, 2012, 7:58:22 PM5/29/12
to cakeph...@googlegroups.com
So 5.4 it is!

I think we'll make an official announcement right after releasing 2.2 stable :)

Thanks all for contributing

William Golden

unread,
May 29, 2012, 8:46:09 PM5/29/12
to cakeph...@googlegroups.com
Misread his email -- sorry Pierre!


William Golden
615-753-9484

Thomas Ploch

unread,
May 30, 2012, 7:45:37 AM5/30/12
to cakeph...@googlegroups.com
I am pretty much excited that the decision was made for PHP 5.4.

Being a client-oriented service provider it got harder and harder convincing people to choose CakePHP over other frameworks.
This will most likely change for the good with this decision!

Regards,
Thomas

Daniel Pakuschewski

unread,
May 30, 2012, 9:05:30 AM5/30/12
to cakeph...@googlegroups.com
Wow good news \o/

Short array syntax s2

Daniel Luiz Pakuschewski
Desenvolvedor Web
(w) www.danielpk.com.br
(c) 41 9630 0293


2012/5/30 Thomas Ploch <profi...@googlemail.com>

mark_story

unread,
May 30, 2012, 1:20:32 PM5/30/12
to cakeph...@googlegroups.com
I don't know if we'll start off changing every array in all of cakephp as there are ~29000 uses of array(.  That alone is a huge amount of work, and I'd rather we focus on actual changes :)

-Mark

Jamie Nay

unread,
May 30, 2012, 1:30:47 PM5/30/12
to cakeph...@googlegroups.com
I'd like to know which mainstream hosting providers offer 5.4. I've yet to come across it... 5.3 is just getting 'out there' as far as default PHP versions go. I know a lot of people who will be sticking with Cake 2 if 3 requires 5.4. Oh well.

- Jamie

Larry E. Masters

unread,
May 30, 2012, 1:40:13 PM5/30/12
to cakeph...@googlegroups.com
Jamie,

We are not abandoning 2.x and we will back port anything we can to 2.x. With the cost of cloud servers running very close to shared hosting you can configure PHP any version you like, this is what we do for all of the project apps. I will get some information from a few hosting providers and even try to work on some special pricing for CakePHP developers who want to take advantage of them.


--
Larry E. Masters

Thomas Ploch

unread,
May 30, 2012, 1:42:10 PM5/30/12
to cakeph...@googlegroups.com
As we all know,

time is running fast with these kind of things.

I think that by the time Cake 3 is born into arms of alpha, there will be a lot of hosters as well as self-compiled root servers out there which will scream out the name CakePHP very loud ;-)

As a side note:
Closures can now use the object scope 'this' as well, which makes it one of the best changes together with traits.

Some funny comment I came across on the Closures PHP page:
http://www.php.net/manual/en/functions.anonymous.php#106046

Will there be some topics/talk about possible new implementations in Cake 3 at cakefest?

Regards,
Thomas

Jamie Nay

unread,
May 30, 2012, 1:54:16 PM5/30/12
to cakeph...@googlegroups.com
Hi Larry,

I appreciate it. As much as I'd love to do bleeding edge stuff, both my workplace and my freelance projects deal with hosts who will likely not move to 5.4 anytime soon. In particular, at my work we have over 100 Cake-based websites (using a CMS we developed), growing almost daily. The host we use for all of these sites runs 5.2 and likely won't even be on 5.3 for a couple of years. So I envy all of you who get to work with 5.3 and 5.4. :)

- Jamie

José Lorenzo Rodríguez

unread,
May 30, 2012, 2:00:22 PM5/30/12
to cakeph...@googlegroups.com
Why not switch hosts? Using a cloud based solution is both cheap and easy to setup.

Cauan Cabral

unread,
May 30, 2012, 2:07:24 PM5/30/12
to cakeph...@googlegroups.com
Jaime, PHP 5.2 EOL is from December/2010, nearly 2 years ago ( http://www.php.net/archive/2010.php#id2010-12-16-1 ).
I think keeping support don't make sense.

Jamie Nay

unread,
May 30, 2012, 2:11:19 PM5/30/12
to cakeph...@googlegroups.com
I don't write the cheques. I'm not the boss - just a programmer. Our company has about 500 websites hosted with this particular hosting company (which is local), and isn't in a rush to switch. So, it's not a choice - just what I have to work with.

- Jamie

William Golden

unread,
May 30, 2012, 2:13:46 PM5/30/12
to cakeph...@googlegroups.com
Jamie, you could always spin up a new cloud server for 5.4 and leave the old sites on the current host -- this would offer you a pretty nice migration plan from 5.2 as you upgrade the older sites to the new codebase as needed.


William Golden

Jamie Nay

unread,
May 30, 2012, 2:18:41 PM5/30/12
to cakeph...@googlegroups.com
Like I said - I'm not in charge. Believe me, I've made these points many times. But from a business standpoint we've decided to stay put for now.

What is more likely, actually, is buying our own servers and using a colocation service. But that likely won't happen for a while.

- Jamie

Ceeram

unread,
May 30, 2012, 5:21:34 PM5/30/12
to cakeph...@googlegroups.com
@Jamie

If you are stuck with PHP 5.2 then it does not really matter to you if CakePHP 3 will be using PHP 5.3 or 5.4.

Op woensdag 30 mei 2012 20:18:41 UTC+2 schreef Jamie het volgende:

Miah Gregory

unread,
May 31, 2012, 4:00:25 AM5/31/12
to cakeph...@googlegroups.com
For what it's worth, Zend Guard doesn't yet support 5.4, and going by
its usual release cycle, probably won't until the end of this year at
the earliest: http://www.zend.com/products/guard/downloads

Probably not an issue for many, but might be a show stopper for some,
and therefore a reason for hosters to not upgrade to 5.4 too rapidly.

--
Regards,

Miah
> > Como falar comigo: Google Talk: cau...@gmail.com
> > Skype: CauanCabral MSN: cau...@gmail.com
> > Onde me encontrar:
> >
> >
>
>
>
>



Juan Basso

unread,
Jun 30, 2012, 11:20:31 PM6/30/12
to cakeph...@googlegroups.com
Yes, the biggest benefit of namespaces is collision, but it helps with many others things like easier autoload (affecting directly in the performance) and consistency of your app when you have many classes. An analogy is: Why do you use folders in your computer? Just because you cannot have the same file name in the same folder?

About the use of the classes, it will be abstracted by the core in many situations. For example, you will be able to use short classnames in configurations like 'components' in controllers. You can use 'MyComp' and it will referrer to \App\Controller\Component\MyComp automatically. 
Some situations will require full name (or using 'use'), mostly when you instantiate the class directly, like libs.

Juan Basso

On Sat, Jun 30, 2012 at 9:38 PM, Simon East <si...@surfacedigital.com.au> wrote:
Can someone explain the benefits of namespaces?  And do they outweigh any extra code required?  Is it just to reduce naming collisions?

One of my fears is that Cake might become like Symfony where in every controller/model I write I had to type 4-8 overly-long namespace lines (that I could never seem to memorize), it felt like such a drag.  Love being able to create a new model or controller in Cake in only a matter of seconds by simply declaring the class, a method and often requiring little else (maybe occasionally an App::uses()).  Hoping that won't change too much.  :-S


A really simple Symfony example (it's usually worse than this)...  Urghh....

use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\MinLength;
class Author
{
    public $name;

    public static function loadValidatorMetadata(ClassMetadata $metadata)
    {
        $metadata->addPropertyConstraint('name', new NotBlank());
    }
}

Simon.




On Monday, 28 May 2012 13:29:21 UTC+10, Graham Weldon wrote:
We do plan on supporting namespaces.
In fact Mark has already been tinkering. :)
 
Cheers,
Graham Weldon
http://grahamweldon.com
p. (+61) 0407 017 293

Skype: grahamweldon




Simon East

unread,
Jul 1, 2012, 6:52:22 PM7/1/12
to cakeph...@googlegroups.com
OK, thanks for the reply Juan.  How does it help performance exactly?  Is it because PHP doesn't have to recursively search a library folder because it's given a full path to a class?


Simon East  
 Technical Lead  |  surfacedigital
Level 1, 60 Hardware Lane, Melbourne VIC 3000 Australia



Juan Basso

unread,
Jul 2, 2012, 10:49:32 AM7/2/12
to cakeph...@googlegroups.com

Yes. And in cake avoid read/write the map to the cache.

Reply all
Reply to author
Forward
0 new messages