HTTPS SSH

Bamboo PHP Application Framework

Bamboo is a PHP Framework for Application development. It is primarily focused on OOP MVC applications, however the library files can be used for other Application types.

Features

  • Fully namespaced codebase

MVC

  • Inter-controller calls/redirects
  • URL Routing
  • Model System
    • Driver system for various Model backends
    • Extensible Validation

Data Handling

  • Storage
    • Generic Storage backends for use by various data storing high level classes
      • APC
      • Memcache
      • On-Disk
  • Caching
    • Uses Storage backends
  • Sessions
    • Uses storage backends
    • Model Backend
  • Settings

Helpers

  • Events System
  • CLI scripting helper
  • CLI interaction helper
  • CLI tool wrapper system
  • Filesystem helper
  • Image helper
  • Logging & Error Handling helper

Type Helpers

  • Array helper
  • Boolean helper
  • Callback helper
  • Date helper
  • Extended FileInfo
  • Number helper
  • Extended SimpleXML
  • String helper
  • XML helper

Network

  • HTTP Current Request & Response helpers
  • HTTP Request helper
  • SVN classes for working with Repositories and Working Copies
  • LDAP access class with a ModelDriver
  • Mailbox, Message and Attachment (IMAP, POP) handling classes
  • Outgoing Email handling classes, with adapters for PHPMailer and SwiftMailer

Templates & Views

  • Templates using PHP syntax
  • HTML Helper
  • TagMapper to transform elements in bamboo-extended XHTML documents via a series of callbacks

Compatibility

Drop-in replacements for useful PECL extension functions & forward compatibility with new features

Requirements

Application Setup

When using Bamboo for an MVC OOP Application, the following conventions are suggested

Directory Structure

Some parts of the structure are required, while other parts are simply suggestions.

  • /application-namespace
    • /config
    • /config-environment-name.php (Config file for one environment - see <a href="sample-files/config-default.php" target="_blank">sample-files/config-default.php</a>)
    • /config-global.php (Config file for all environments - see <a href="sample-files/config-global.php" target="_blank">sample-files/config-global.php</a>)
    • /config.php (symlink to config-environment-name.php)
    • /module1
      • /controllers
      • /models (Modules can use global Models or their own)
      • /views
    • /module2
      • /controllers
      • /views
    • /controllers
    • /data (suggested location for file storage)
    • /library (suggested location for Application-specific library files)
    • /models
    • /views
  • /lib
    • /bamboo (bamboo library files)
  • /bootstrap.php (Application setup file - see <a href="sample-files/bootstrap-mvc.php" target="_blank">sample-files/bootstrap-mvc.php</a>)
  • /public (Apache DOCUMENT_ROOT directory)
    • /index.php (Default load file, calls bootstrap.php - see <a href="sample-files/index.php" target="_blank">sample-files/index.php</a>)

Naming Conventions

  • Use namespaces that match directory structure
  • Class files should be named classname.class.php
  • Directories and Files for classes should be all lowercase
  • View/Template files should use the .phtml extension for HTML content type, .json.php for JSON, .xml.php for XML, etc