Application Anatomy Part 1
As with every application based on a framework, your new My Framework application will have a specific directory structure. Not all of these files and directories are required, but I think they will be needed at one point or another in your application's life.
To get started with a new application you can simply checkout the "application skeleton" from our SVN server. Go to your public Web area on your server and assuming you're on a Linux console type:
svn export http://my-framework.com/svn/phpapplication/1.x/trunk test
This will create a directory named "test" containing your new application. You'll see the following:
app/
- this is where all your scripts will be
common.php
- this is the first application-specific file to be loaded by the framework
configs/
- all your config files live here
db.create/
- this is not really needed, but it's good practice (at least in my case) to have all your database schema in separate files (one for each table) located in this directory
include/
- all your classes and other include files will be located here; if you create a class User and place it here in a file User.class.php, you don't have to specifically include this file in your scripts because the framework will load it automatically when you use an User object
LICENSE
- not really needed, only if you want to provide a license for your new application; this is initially empty
my-framework/
- this directory contains the My Framework core files
README
VERSION
- these 2 files are initially empty, use them as you wish or just delete them if you don't think they're useful
views/
- this is where your view files live; every script could have one or more view files associated with it, or even no view file at all (think AJAX scripts)
web/
- this directory is where you should place all content that should be accessible from the Internet; actually, this is the only folder that needs to be placed in your public web area and it contains the front-end controller, images, CSS and Javascript files
In part 2 of these series we'll look at how this new "test" application is structured logically and how each of these files and folders that we've seen so far fit together. I'm looking forward to your feedback or questions in the comments section.
