Issue #42 created in
koalephant/bamboo-framework
Overview
Atlassian Sourcetree is a free Git and Mercurial client for Windows.
Atlassian Sourcetree is a free Git and Mercurial client for Mac.
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
- Generic Storage backends for use by various data storing high level classes
- 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
- http_build_url()
- http_response_code()
- password_hash()/password_verify()
- JsonSerializable interface
- SessionHandler interface
Requirements
- PHP 5.3.7+
- A PDO driver for Bamboo/Data/Models/PDO & Bamboo/Data/DB/PDO
- The Memcached extension for Bamboo/Data/Storage/MemcacheDriver
- The APC Extension for Bamboo/Data/Storage/APCDriver
- The cURL extension for Bamboo/Network/HTTP/Request
- SVN extension for Bamboo/Network/SVN/*
- Grow or Growl for Windows and growlnotify for Bamboo/Notifications/GrowlDriver
- OS X 10.8+ and Terminal Notifier for Bamboo/Notifications/OSXDriver
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