Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Joe Ferguson:
Using Homestead with CakePHP Framework
Jul 03, 2017 @ 09:10:09

In a new post to his site Joe Ferguson shows you how to use the Homestead VM to run a CakePHP instance for local testing and development needs.

Interested in checking out CakePHP? You can easily spin up a new CakePHP project and add Homestead just as easy as any other modern PHP project.

He then walks you through the setup process:

  • Creating a new project
  • Starting up Homestead
  • Changing the webroot to match CakePHP's needs
  • Bringing up the VM
  • Configuring the database

Each step is accompanied by screenshots and/or console output to help you ensure you're on the right track.

tagged: homestead cakephp framework tutorial install configure

Link: https://www.joeferguson.me/using-homestead-with-cakephp-framework/

The Bakery:
Welcoming Phinx to the CakePHP family!
Jun 23, 2017 @ 09:54:02

On The Bakery (the CakePHP site) an official announcement has been posted welcoming Phinx to the CakePHP family. The Phinx library is a popular tool for framework-agnostic database migration handling.

We are very excited to announce that Phinx has joined the CakePHP team. The Github project has already been moved to the CakePHP organisation. The project itself will stay MIT-licensed but be gradually transformed into a Cake Software Foundation project. Other great news is that the current way to install and update Phinx remains unchanged.

As you are aware, CakePHP has been using Phinx since 3.0.0 for database migrations. The CakePHP Core team welcomes the opportunity to look after and maintain the project and will now start making changes to bring the code in line with the CakePHP (our) coding standards. As well as cleaning up issues and PR’s soon. We will be following up with our plans for the code and setting roadmaps in the coming weeks.

Rob Morgan, the original author of the library has also added some of his own commentary in a post to his site:

I’ve been busy lately. Juggling startups and open source work is no easy feat. I managed to do it for the past 5 years, but beyond 30 its proving to be more difficult. Phinx is not accelerating at the pace I’d like it to be. In fact so far this year we’ve only managed to ship 6 releases. I decided that the best strategy moving forwards is to find a new home for Phinx. One that has an active and loyal community and one that delivers great software. I’m pleased to announce that I’ve found the right fit.

He points out that the only real thing changing for now is the location of the repository. He looks back on the journey that got him and the project to where it is today and how much the support from the PHP community meant during that time.

tagged: cakephp phinx database migration robmorgan library project foundation

Link: https://bakery.cakephp.org/2017/06/23/welcoming-phinx-to-the-cakephp-family.html

Voices of the ElePHPant:
Interview with Larry E. Masters
May 24, 2017 @ 11:17:07

The Voices of the ElePHPant podcast has posted their latest interview with a member of the PHP community. In this latest show host Cal Evans talks with Larry Masters

In this episode Cal and Larry talk about Cake PHP and some of the backstory on how it was started and where it is now. They also talk about some of the features of the framework (including built-in internationalization support). Larry also talks about the interchangeable pieces of the framework and how the Cake PHP Development Corporation fits into the overall picture. He also shares about some of the training resources the group provides and the conference they host.

You can listen to this latest show either using the in-page audio player or you can download the mp3 for listening at your leisure. If you enjoy the show, be sure to subscribe to their feed and follow them on Twitter to get updates when new shows are released.

tagged: voicesoftheelephpant community interview podcast larrymasters calevans cakephp

Link: https://voicesoftheelephpant.com/2017/05/23/interview-with-larry-e-masters/

Zumba Tech Blog:
Caching CakePHP 2.x routes
Oct 28, 2014 @ 10:47:02

On the Zumba Tech Blog today there's a new post with some helpful hints around caching routes in CakePHP 2.x to help optimize the requests and response time even further.

At Zumba we are continuously looking for optimization in our applications. These optimizations help to reduce the server loads, consequently reducing the number of servers and saving money. Besides that, it gives a better user experience for the end user by serving content faster and in some cases saving on consumer bandwidth (specially for mobile users). This week we profiled our app using Xdebug profiler and we identified the router was responsible for a big part of the request time. [...] In order to optimize the routing time, we started looking at options to optimize our routing process. After some research and deep checking in our codebase as well as CakePHP’s code, we found we could cache the routes easily.

Taking a cue from how FastRoute does their caching, their implementation uses a temporary file with the routes completely resolved and written out for easier handling. Since the routing is relatively static, this method works well and can be much faster than resolving them every time. They talk about some of the work done to optimize their method and some of the issues they came across during the process.

tagged: cakephp framework cache route file resolve

Link: http://tech.zumba.com/2014/10/26/cakephp-caching-routes/

Sanisoft Blog:
Themes in CakePHP 3, A step by step HowTo
Aug 21, 2014 @ 11:45:38

On the Sanisoft blog there's a recent post that gives you a step-by-step guide to working with themes in the upcoming version 3 release of the CakePHP framework.

Almost every application I code has themes which either the end user can change or the admin can set or can be changed on the fly. Doing all these things was easy in CakePHP 2.x. With the first alpha release of CakePHP 3.x I was naturally keen to try out how theming worked with V3.

He shows how to convert an existing theme into one that will be compatible with the 3.x version of the framework. He breaks it down into seven steps (well, technically eight) to make it easier to follow along:

  • Step 0: Make the "posts" table
  • Step 1: Bake the model, controller and views for the Posts
  • Step 2: Bake in the "Twit" plugin
  • Step 3: Download and install the Twitter Bootstrap
  • Step 4: Create the "default.ctp" file with the content given
  • Step 5: Make the "index.ctp" template with the given content
  • Step 6: Add the line to the AppController to use the new theme
  • Step 7: Reload and verify the results
tagged: theme cakephp framework version3 update template

Link: http://www.sanisoft.com/blog/2014/07/21/themes-in-cakephp-3-howto/

Piotr Pasich:
CakePHP with Symfony’s2 router
Aug 13, 2014 @ 09:46:27

Piotr Pasich has a new post to his site today showing you how you can use the Symfony2 router with CakePHP, another popular PHP framework. He talks about some of his own experiences using CakePHP and how one module "left a bitter aftertaste" when using it - the route handling.

The second version of CakePhp still has a lot old-fashioned patterns, singletons or lack of tests, but I can live with that. I saw a lot of better or worse frameworks in my life.

He goes through an example of the CakePHP routing including some sample code and a walk-through of the code that actually handles the request. He points out some of the "clean code" violations it makes and gets started integrating the Symfony2 router instead. He extends the CakePHP router and uses this plugin to bridge between the two. He then can call the Symfony router with only slight modifications to things like the "getPath" calls.

tagged: cakephp symfony2 router integrate plugin tutorial

Link: http://piotrpasich.com/cakephp-with-symfonys2-router/

Three Devs & A Maybe Podcast:
Delving into CakePHP with James Watts
Jul 16, 2014 @ 09:13:33

The Three Devs & A Maybe podcast has posted episode #34 of their podcast today featuring a chat with James Watts, a member of the core CakePHP development team. They talk about the framework, his own background and how he got into the project.

This week we are very lucky to have James Watts, a core member of the CakePHP project on the show. Initially starting off with his journey into programming, we move on to talk about the differences we find between junior and senior developers. We then touch upon his previous start-up experience and how that resulted in him thinking more about the product as a whole. CakePHP has been around for almost 10 years now, we discuss how he got into the project - along with the frameworks key goals. We then move on to highlight some of the key differences/features you will find in the next major release (3.0). Finally, we discuss his upcoming book, and his experiences with organising a large open-source community event.

Topics mentioned include CakeFest, the CakeDC presentation about git workflow and a few video interviews posted over on the CakePHP Youtube channel. You can listen to this latest episode either through the in-page player or by downloading the mp3 directly.

tagged: threedevsandamaybe podcast ep34 jameswatts cakephp project interview

Link: http://threedevsandamaybe.com/posts/delving-into-cakephp-with-james-watts/

Developer's Lane:
Top 20 CakePHP Interview Questions and Answers
Jul 04, 2014 @ 13:48:25

The Developer's Lane site has posted a top ten list of questions answered about the CakePHP framework. The idea is that they could be used as a part of an interview to see how well the candidate knows the framework.

Here there are many questions and answers about How CakePHP Framework works? and basic questions related to CakePHP framework functionality.

Questions include:

  • What are are drawbacks of Cakephp?
  • What is the name of Cakephp database configuration file name and its location?
  • What are commonly used components of Cakephp?
  • Why does Cakephp have two vendor folders?
  • Can you remember what is the directory structure when you download Cakephp?

The questions provide a good overview of the framework, but won't tell you if the developer is any good...you still need to figure out that one on your own.

tagged: cakephp framework interview questions developer overview

Link: http://www.developerslane.com/top-20-cakephp-interview-questions-and-answers/

Leonid Mamchenkov:
CakePHP 3, here we go again.
Jul 02, 2014 @ 13:18:55

In this new post Leonid Mamchenkov looks at the latest version of a PHP framework that's been around since the PHP4 days, CakePHP, and some of the improvements that will come with version three.

Currently, I am at the start of a couple of projects, which require a bit of the future support. CakePHP 2.x can handle the job now, but I’m looking more into the next 3-5 years. And that’s why I’m looking at CakePHP 3, which is still in the early development stage, with an alpha release coming not too long from now (have a look at the CakePHP 3 roadmap document). Let’s have a look at the high level goals for CakePHP 3.

Among the items he mentions are things like:

  • The adoption of broader PHP community standards
  • An increase in modularity
  • Developing for PHP 5.4+
  • Composer support (and using PSR-4 autoloading)
  • The removal of some more complex, brittle code in favor of simpler, easier to extend options

Check out the roadmap and migration guides for full information.

tagged: cakephp v3 framework refactor features roadmap goals

Link: http://mamchenkov.net/wordpress/2014/07/01/cakephp-3-here-we-go-again/

Suresh Ariya:
Integrate Zend Framework into CakePHP application
Feb 13, 2014 @ 13:04:22

Suresh Ariya has a new post today showing you how to integrate Zend Framework (v1) with CakePHP so you can use any Zend Framework class/component you might need via autoloading.

Today, we are going to see how we can integrate Zend Framework version (1.12) into CakePHP Application. In order to achieve this, i created an autoloader script which will load the Zend Framework class at the time of accessing the class (creating object). I used spl_autoload_register() function which will register a function as the __autoload() function.

He creates a basic "ZFLoader" class that handles the registration of the autoloader and the parsing of the class name to resolve the path to the file. Another basic loader script is included in the post with some setup and configuration the Zend Framework will need to operate. Finally, he shows how to get the CakePHP application to pull in the Zend Framework loader in the controller and make use of the Zend_Feed component.

tagged: integration zendframework cakephp application tutorial

Link: http://sureshdotariya.blogspot.in/2014/02/integrate-zend-framework-into-cakephp.html