This application was created to accompany a presentation at CodeWorks.
The purpose is two-fold:
-
To highlight how similar frameworks are and how they can be used interchangeably
-
To show how an app evolves from a flat PHP app into a reponsibly-organized mini framework
This project is organized into six different stages, each representing one stage of the evolution of the app. You can checkout to different stages to see how things looked:
-
start
- A flat, PHP4-style applicationgit checkout -b start origin/start
-
stage2
- Introduction of autoloader and Request and Response classesgit checkout -b stage2-http-foundation origin/stage2-http-foundation
-
stage3
- Introduction of a routergit checkout -b stage3-routing origin/stage3-routing
-
stage4
- Introduction of a dependency injection containergit checkout -b stage4-container origin/stage4-container
-
stage5
- Introduction of ZF2 loggergit checkout -b stage5-zf2-logger origin/stage5-zf2-logger
-
stage6
- Reorganization of the project's structuregit checkout -b stage6-dir-structure origin/stage6-dir-structure
To use the app, clone it, check out to whichever branch you want, and do the following:
-
Clone the repository
git clone git://github.com/weaverryan/PHPChristmasMiracle.git
-
Initialize the database via
php data/setupDb.php
-
Pull down the submodules:
git submodule init git submodule update
If you have any permissions problems, run the following:
chmod 777 data/database.sqlite
chmod 777 data/web.log
Enjoy!