Session
Untangling the Web: Dealing with Legacy PHP Code
Clinton Nixon, Software developer, Lulu Enterprises
Track: PHP
Date: Thursday, July 26
Time: 4:30pm
- 5:15pm
Location: D135
PHP is both praised and defamed for its ease of entry. The worst PHP code is comprised of global variables, hundreds of lines of procedural code, includes used-like gotos, and a morass of mixed view, controller, and even model code, written because it's very easy to do.
Whether you've inherited legacy PHP code, or you've written it yourself and want to improve it, this talk will lead you through the top issues you are likely to encounter in unstructured PHP code, and will give you safe solutions to deal with these problems. You will learn refactoring techniques to:
- Find global variables from GET and POST and get your application in a state where you can turn off register_globals.
- Move included code into classes and templates.
- Quickly build a templating system to firewall off controller variables from your templates.
- Extract loop-based data processing from your view code.
- Turn the ubiquitous global database handle into a locally-scoped variable.
- Move to the land of E_ALL.





















