Better PHP

Collection of my best practices for writing application in PHP

General

  • Function signature (Type hinting)
  • AutoLoader Auto Loader
  • IdeTips IDE tips
  • Caching Caching
  • 3rd party libraries
  • IncludePath Include path
  • Deployment Deployment (live/debug env)
  • ErrorHandling Error handling, exceptions
  • Arrays

Object oriented

  • Iterators Iterators
  • SaveRestoreObjects Save/Restore objects
  • LoadSaveDataDbOoWay Load/Save data db
  • Expose objects to json

Design patterns

Practical examples of usage design patterns in PHP application

  • Abstract Factory
  • Adapter
  • Bridge
  • Builder
  • Command
  • Composite
  • Decorator
  • Factory Method
  • Flyweight
  • Mediator
  • Memento
  • Observer
  • Prototype
  • Proxy
  • Singleton
  • State
  • Strategy
  • Template
  • Visitor