On the 16th and 17th of February, Dan Hensby and I abandoned our duties as SilverStripe UK ambassadors and re-donned our PHP developer capes as we attended the PHP UK Conference. Two days of coffee, note-taking, battery-conservation techniques and off-off-site support meant that the post-conference buzz was high.
Highlights include David Zuelke’s “I’ve Seen the Future, and its Web Servers were Written in PHP”, where we learned that with the introduction of PHP7 we can start to look at Python and Ruby-esque ways of serving content; Adam Englander’s “Don’t Lose Sleep - Secure your REST”, in which the complex-yet-simple world of JOSE was thoroughly explained and enthusiastically championed; and Adam Baratz’s “Testing Complex Applications for PHP7”, a detailed analysis of diving deep into the rabbit hole and coming out alive and better than ever.
The pick of the bunch for me though was the closing keynote from Michael Cullum, entitled “Towards a Framework-less World” — something that naturally piqued my interest. If the end of Frameworks is nigh, then SilverStripe should be paying attention! After a quick history lesson, Michael hit us with some stats — ~25% of all downloads from Packagist are for Laravel, Symfony and Zend, the three most popular PHP frameworks out there. This seems to imply that frameworks in PHP are stronger than ever. However, what was interesting is that only ~1% of downloads are for the actual framework packages from these projects. SilverStripe, as an example, has 3,315,307 total downloads at the time of writing — but only 403,656 installs of silverstripe/framework. While it is the top download for SilverStripe, the same is not true of Zend or Symfony. The reason why will hopefully start to become clearer.
To reinforce, he broke down the essence of an application into three parts: business logic, libraries and glue. Business logic is that part that makes your product unique — the parts of the application that apply specifically to you. Libraries are (usually) third-party collections of code that handle a specific aspect of an application — things like request handling, routing or database abstraction. Lastly, the glue is the code that links everything together: the facilitator. A framework is usually thought of something that combines the latter two; including solid libraries to handle your processing and providing sensible places for your business logic to live. The current trends, though, suggest that the frameworks themselves are splitting out into libraries and glue — the idea of the tightly-coupled framework is becoming out-of-date.
Michael promoted the idea of Library Agnosticism: “you should be able to swap any given library in and out during development”. The PHP Framework Interoperability Group (FIG), of which Michael is the secretary, is facilitating this through the use of the PHP Standards Recommendations (PSR) — a way of ensuring that PHP libraries all behave in expected and uniform ways. This means that you aren’t limited to one “family” of libraries; you don’t need to use only Symfony packages, for example. This means that a framework can begin to strip itself back to become just the glue and the PHP community can come together as a whole to contribute to more and more projects in a meaningful way. In the same way, Michael asks that developers and applications also look to be agnostic. The focus should always be on the business logic — that’s the part that is interesting, that’s what sets you apart from the others. Leave the internals to the libraries, with the power of the whole PHP community behind them.
Will this spell the end for the SilverStripe Framework? We hope not. You can see the beginnings of this sort of change in the SilverStripe Framework already: coming in SilverStripe 4 is a replacement for the previously bespoke mailer with SwiftMailer, moved to Monolog for logging (PSR-3), Symfony Cache (PSR-6) and our new configuration system (PSR-16).
This keynote opened my eyes to the greater PHP community and how we should all be working together to make great applications. Using excellent community libraries means that we can contribute back to them, and in doing so, improve not just our own product, but the PHP community as a whole. We can also devote the time we would have spent implementing our own versions of those same libraries to what makes SilverStripe great: our CMS. By becoming library-agnostic, we wouldn’t even be locked into one library if we ended up needing to make a change — switching in and out, for us and our users, would be relatively straightforward.
SilverStripe can be the best glue, and the best glue should be able stick to anything.