Modernizing Legacy Applications In PHP
Last updated on 2015-07-19
About the Book
"You will breeze through your code like the wind. It will be autoloaded, dependency-injected, unit-tested, layer-separated, and front-controlled."
Is your legacy PHP application composed of page scripts placed directly in the document root of the web server? Do your page scripts, along with any other classes and functions, combine the concerns of model, view, and controller into the same scope? Is the majority of the logical flow incorporated as include files and global functions rather than class methods? If so, you already know that the wide use of global variables means that making a change in one place leads to unexpected consequences somewhere else. These and other factors make it overly difficult and expensive for you to add features and fix bugs. Working with this legacy application feels like dragging your feet through mud.
But it doesn't have to be that way! This book will show you how to modernize your application by extracting and replacing its legacy artifacts. We will use a step-by-step approach, moving slowly and methodically, to improve your application from the ground up. Moreover, we will keep your application running the whole time. Each completed step in the process will keep your codebase fully operational with higher quality. When we are done, you will be able to breeze through your code like the wind. Your code will be autoloaded, dependency-injected, unit-tested, layer-separated, and front-controlled.
Please note that this book is about modernizing in terms of practice and technique, and not in terms of tools. We are not going to discuss the latest, hottest frameworks or libraries. With the exception of testing systems like PHPUnit, and one or two standalone third-party libraries, the book does not advocate adding third-party code to your existing legacy application. Most of the very limited code we do add to your application is specific to this book. We will be improving ourselves as programmers, as well as improving the quality of our legacy application.
If you feel overwhelmed by a legacy application, "Modernizing Legacy Applications in PHP" is the book for you. If you prefer a paper copy, you can purchase one at Lulu.com.
If you're still on the fence, the video "It Was Like That When I Got Here" (embedded above on this page) outlines the first few chapters for free, and you can read some reviews of the book on the feedback page. You can also read the 4.5-star review from SitePoint.
Be sure to follow the book on Twitter @mlaphp, and tell all your friends!
A single copy of the book.
The Book, Pair-Programming License
This package has 2 copies of the book, for pair-programmer teams.
The Book, 10-copy license
This package has 10 copies of the book, at a 10% discount for user groups, schools, large organizations, etc.
Easy-to-follow, practical, and powerful
[This book] gives developers an easy-to-follow, practical and powerful process to bring their applications up to a modern baseline. As I followed the exercises in the book, my questions almost seemed to be anticipated and answered before the chapter was over. If you are in the midst of a legacy refactor or you find yourself in a state of despair caused by the code you have to work on, I implore you: read Modernizing Legacy Applications in PHP. Change is really possible!
Kiss your technical debt goodbye
This book helped me slay a 300k line of code giant and has allowed me to break out my shell. It has been my best PHP book purchase yet and I continue to improve the code base. The code base is now 80% unit tested and I am now implementing continuous integration.
A 12-step program for PHP devs
Reading through the book, it feels like you're pair programming with the author. I'm at the keyboard, driving, and the author is navigating, telling me where to go and what to do next. Each step is practical, self-contained and moves you closer to the end goal you seek: maintainable code. I *highly* recommend this book. Even if you're a seasoned developer (I've been writing code professionally more than 20 years), you will benefit from Paul's approach and detailed documentation of the process.
J. Michael Ward
This is one of those books that PHP developers from all skill levels will be able to glean value from, and I know after just a single read-through that it will be an oft-referenced resource when I need to convert my old legacy-based procedural code into something cleaner, object-oriented, and testable. This is a very thorough guide to ... getting developers stuck with legacy codebases up to speed with the tools that are available to them. I will recommend this to anyone who will listen.
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms