Please share your favorite application design / design patterns for use in PHP with me. Some things I\'d like to know:
I might get voted down for this, but if you really do want to write your own framework, I say go for it because you will learn a lot from the experience. The other frameworks mentioned here are great and tested and you wouldn't be making a bad decision using them, but it's your choice.
Before starting to write your framework, look at the other frameworks (at their syntax, directory structure, naming schema, design patterns, etc) and try to figure out why they did what they did and what, if anything, you would do differently. Try out a few tutorials and play with their code, make a few sample apps. If, after doing that, you don't like using them, then go ahead and start planning your framework, keeping what worked and improving what didn't.
If you do decide to roll your own, here are a few things I would recommend from my own experience:
I almost feel like a broken record, but I would recommend that you take a look at some of the common frameworks for two reasons:
Speaking of using a framework that can be easily extended, I have had very positive experiences with Zend Framework. It's cohesive and yet loosely coupled structure makes it possible to quickly and easily extend any existing component and the entire framework is designed around the idea that you will need to write your own helper and plugin classes to add to its overall functionality.
I've found Zend Framework to be so completely flexible that I am running a single website as part Zend Framework MVC and part my old crappy framework and even older crappier code that I haven't gotten to rewrite yet. In fact, because during our rewrite we found one page that ran unacceptably slow using the old framework, I've switched the single page to run under the Zend Framework architecture.
To answer some of your questions, I would recommend that you look into Patterns of Enterprise Application Architecture by Martin Fowler. He provides a lot of valuable insights into how to solve a number of these common problems like how to create a database interaction layer in your application. Fowler also covers topics like MVC and Front Page Controller.
Using Zend Framework and Doctrine, my folder structure usually looks like this:
root
app
config (db config, routing config, misc config)
doctrine (fixtures, migrations, generated stuff, etc)
lib
logs
models (doctrine models)
modules (zend mvc modules)
bootstrap.php
docs (db diagrams, specs, coding standards, various docs)
pub (web root)
tests
tools (console tools, i.e. doctrine-cli)
vendor (zend and doctrine libraries, preferably as svn-externals)