CakeDC Blog

TIPS, INSIGHTS AND THE LATEST FROM THE EXPERTS BEHIND CAKEPHP

The Imagine plugin

The Imagine plugin for CakePHP, which has been available from the CakeDC account on GitHub, was written as a separate plugin, but complementary to my FileStorage plugin. In the past, the old CakePHP 1.3 times, we've had our Media plugin which we never released. The main purpose of the plugin was to deal with file uploads, but only to the local system and to process images. I've had to work with a few client projects that used phpthumb, which I've learned to dislike because it had its faults and issues. Before reinventing the wheel I simply tried to ask if somebody knows about something modern, OOP, PHP 5+, with unit tests, and had some luck. Imagine is a modern PHP 5.3 library that provides an interface to different image processing back-ends like gd, imagick and imagick shell. Others can be implemented as well. I really recommend this lib over phpthumb, and suggest you to replace it with Imagine if your project is moving on. The plugin for CakePHP is basically a wrapper around the Imagine library, that will autoload the library (because CakePHP 2.0 does not have it's own autoloader until 3.0) and make it available as a behavior. The behavior provides some methods that handle commonly used image operations, like cropping and thumbnails. Besides that, the plugin comes with a helper and a component, which allows it to generate versions of images on the fly. This was more done for backward compatibility for some apps, rather than being a concept that should be used. In fact, it is not the recommended way to handle this. I've written two other articles related to image processing and file storage that explain the issues with that. Instead of creating images on the fly, which is just putting load on the server all the time, you should create the versions of an image after upload. The Imagine plugin works together with the FileStorage plugin, which can use Imagine to generate whatever images you want, right after upload. I originally contributed this plugin, which I developed in my own free time, to CakeDC. But now, it is finally going back to my GitHub user, to pull some maintenance work away from the company. I'll continue to maintain it, and hope you take some time to check it out, and contribute if possible.

The future of the CakeDC plugins

It has been more than 3 years now that we released our internal plugins as open source for the CakePHP community. Some of the first plugins released are now our most popular, like Users, Migrations and Utils. Most of the plugins were developed for version 1.3 of the framework. The later ones were just for 2.x, with the older plugins upgraded to 2.0. It is true that we have sometimes not been happy ourselves with the current organization of the branches and versioning of the plugins. This has been a lot to do with the legacy of the code, which comes over 2 major versions of the framework, and many years of active development. It is probably obvious to experienced open source developers that it's not easy to maintain and test the code for all and every available version of CakePHP. But, we've now spent some time discussing this internally and we are finally able to propose a solution we're happy with. These are the changes that will be made over the next months, to take us to version 3.0 of the framework:

  • Repositories: The branches for the plugin repositories will be updated, and we will focus on tags for releases. Each major and minor version of the framework will also have a development branch, like 1.3 or 2.2. The main develop and master branches will be for the latest version of the plugin, for the latest version of the framework.
  • Versioning: Our current versions are limited to 1.3 and 2.0. This will change, as we will adopt semantic versioning (http://semver.org), and plugins will follow a new version style, that is the core version and plugin version, like 2.3/1.2.1. This would be version 1.2.1 of the plugin, for version 2.3 of the framework.
  • Documentation: We've been working on building a dedicated API site for the CakeDC plugins, very similar to the same one for CakePHP. This should help developers access the technical documentation more easily. We will also be revising the README files for each plugin, as over the years some of these have become less well structured.
  • Testing: As always we take unit testing very seriously. In order to confirm the functionality of the plugins we will be providing build test coverage for each of our plugins on the supported versions of CakePHP, as well as varied versions of the PHP language. This will allow coverage to be viewed by anyone using or contributing to our plugins.
We hope that these changes will help make the CakeDC plugins more accessible and dependable for the CakePHP community. This is the perfect moment to thank everyone who has contributed to the code, helped resolve issues, or even just joined the conversation and provided input or criticism. A contribution can be a bug report or even a feature request. So do not hesitate to tell us via an issue on GitHub that there is something wrong, or you would like to see something useful added to a plugin. A contribution can even be improving the documentation or adding examples for other developers. If you're using our plugins, but don't think the README or API documentation supports your problem, don't hesitate in creating an issue on GitHub, as sometimes other developers can help you out. However, you can also find community driven help and support from the channels listed over at the community center. To get an immediate response the best place is always the #cakephp IRC channel on Freenode. We are frequently available at these locations, but mostly in our free time. Finally, we estimated until today that we have spent more than 600 hours developing and maintaining the CakeDC plugins, not including the time we spend reviewing or discussing issues. We provide these plugins for free, under the MIT open source license, while also providing professional support, in the form of integration or development services. These are just some of the many ways we contribute back to the CakePHP community.

Making great things even greater

If you ever have the time, take a few seconds of your day to check this out: https://github.com/cakephp/cakephp/commit/1e6c7b9d902d6867e3b475bb437eabe98c0acce3 Though this may seem trivial to some, it was a very significant moment in the history of the CakePHP framework. Over 8 years ago now, on the 15th of May 2005, the source code for the project was released under the MIT open source license. So, why was this so important? Simply because it was the first major step which got the project to where it is today. It's also been over 6 years now since the Cake Development Corporation was established by Larry Masters, founder of CakePHP, along side the now departed Michal Tatarynowicz and Kamil Dzielinski. Many well respected developers, as well as contributors to the project, past and present, have set foot in the company, delivering the very best of CakePHP in some awesome projects, while leaving their footprint in the process. And it not only counts for those on the inside, but also the developers from the community, who openly collaborate on the CakeDC open source plugins. These have been a long and colorful six years, full of roller coaster ups and downs, twists and turns, but it's not so much the "when it was created" that counts here, but the "why". Rewind back to 2007, and Larry's proposal was simple: to create a commercial entity which allows people to live and breathe CakePHP, doing what they love day-to-day, while also providing them with a means to support their financial obligations. That's it. Sounds simple, right? Ha! That's much easier said than done, and you’ll soon find out why. Over the coming months we'll be taking an in-depth look at the history and internals of the Cake Development Corporation, giving you a unique insight through a series of posts into how this singular company does business very differently. Hope you enjoy the ride!

Working with a company that embraces o...

I've done my fair share of working for closed and "open" companies. I've recently (in July 2011) clocked over two years working here at the Cake Development Corporation, and while attending the Open Source Developers Conference (2011) in Canberra, I have had some time to reflect on my experiences with the company, and my feelings regarding my work here. Traditionally I have found that companies that claim to be pro-FOSS or open source companies are those that are making a profit, through the use of open source technologies. This is awesome. I love that the proliferation of open source software continues to grow and be adopted by traditionally closed, and proprietary software users. This produces better quality software for all of us. While CakeDC produces a large quantity of client projects that are closed source, what we do have control over is the common reusable components that we use to build and produce web applications for our clients. These are developed and refined over a number of years, and have been a pillar in our success as a company. To be able to draw on years of experience through various developers and quickly build high quality, high performance websites continues to draw attention, referrals and interest from businesses and the community alike. A decision made back in mid 2010, initially proposed by Larry Masters, our President, was to open source all of our plugins. This decision stirred a lot of discussion internally, and there were mixed opinions. While we each individually contribute to open source, speak about it at conferences, engage the community and promote open source, the concept of releasing all our internal code for public consumption for me was a little daunting. The decision was made, and we spent some time cleaning up code, making sure everything was documented and in a good state to release. You can now find all of our plugins and projects on the CakeDC Github Account. The initial load of dealing with issues and support questions, emails and contact from the public was somewhat overwhelming. We deal with issues and features very well internally, but as the process is different to open source projects we contribute to, this produced a somewhat less productive period of time for us while we adjusted our work structure and organisation to accommodate our new open source projects. We now action issues, support requests and other contact from users in a timely manner, and are receiving new and useful commits to the repositories consistently from the community. Overall the experience has been a learning one, and a very positive one. CakeDC support the staff and community in other ways. We are constantly sending staff to conferences both to speak and to attend. This allows us to talk more broadly about CakePHP, PHP in general, and other projects we use and are involved with. It also allows those attending the events from CakeDC a great opportunity to network, and learn from some of the more interesting and innovative minds of our time. This is something that we have come to do through the support of CakePHP, and through our newfound knowledge and experience in working with communities and projects openly. Working with a company like CakeDC, embracing open source and supporting a community like CakePHP is extremely rewarding and equally challenging; and a job without challenges is not what that I would want to be involved in for any long period of time. After speaking with many people working on awesome, interesting projects that are closed, or "not ready" to open source, I really count myself lucky to be working for a company that has embraced open source, contributed to the community, and demonstrates a dedication to supporting those projects and communities.

Call out to the CakePHP community

Everyone knows CakePHP has one of the largest and most loyal communities in the Open Source world, over the last few months we have been witnessing some very disturbing things happening to one of our community members. Many of you may know Jonathan Freeman over at Widget Press he created some tools that have helped many people build applications using CakePHP. He has also been a target of a patent troll suing him for patent infringement. As a software developer I find the tactics of the software patent trolls to be one of the biggest hurdles of innovation in todays development market, too many people afraid to pursue an idea because they fear being sued by a company who had an idea and was not skillful enough to build something from that idea. What upsets me even more is these trolls target people or companies who do not have the funds to stand up to "Goliath" and defend themselves. Well today we as a community need to help one of our own standup and become a David facing Goliath. What I am proposing is helping Jonathan gather some "stones" in the form of small donations from our community. If we have enough people donate we might be able to help him arm himself to defeat the troll "Goliath". We (Cake Development Corporation) are putting up $1000.00 for his defense fund on behalf of the CakePHP project and I am asking people in our community to help also. You do not need to donate this amount or you can do more if you like, any amount will be useful. But let's come together like an unexpected force and help one of our own. You can get more information here Support Widget Press against U.S. Patent 7,822,816 Updated information, if you can not donate money to help Widget Press maybe you can help  via ArticleOne on twitter.com "We launched a Second Study around a #patent in the MacroSolve App Developer case, this time with $10,000 #Reward http://ow.ly/5tO9f"

We Bake with CakePHP