Go to any PHP help forum and you’ll be sure to see many bad practises, innocent misconceptions and blatant no nos. None of us are perfect and none of us started off writing great code. We have all had that moment where we looked back on a script that we wrote years ago and thought “what the hell was I thinking?”. But it is a process. You make mistakes, you learn from those mistakes and then you move on. From my experiences of modifying other people’s code, helping people on PHP help forums and making my own (many) mistakes, I hereby present this list:
In my work as developer I normally need to transform data from one format to another. Typically our data input are a database and we need to show database data into a report, datagrid or something similar. It’s very typical to use pivot tables. It’s not very dificult to handle pivot tables by hand but the work is always the same: groups by, totals, subtotals, totals per row …. Now I want to write a class to pivot tables in PHP with the most common requirements (at least for me). I know we can create pivot tables with SQL. Group by and some other database specific commands like oracle’s GROUP BY ROLLUP/CUBE can do the work, but I like clean SQL querys. The business logic must be in PHP and SQL must be as clean as we can.
The Simple Cloud API is an open source project providing common PHP interfaces for File Storage, Document Storage, and Simple Queue cloud services. It will enable you to easily connect your application with a new service without having to learn their specific API. Primarily developed as a new Zend Framework component called ‘Zend_Cloud’, you can use it independently of Zend Framework.
- Practical Php Patterns: Singleton
- Practical Php Patterns: Decorator
- Practical Php Patterns: Composite
- Practical Php Patterns: Bridge
- Practical Php Patterns: Adapter
- Practical Php Patterns: Creational patterns summary
- Practical Php Patterns: Prototype
- Practical Php Patterns: Factory Method
- Practical Php Patterns: Builder
- Practical Php Patterns: Abstract Factory