General informations about TaniPHP

Requirements

TaniPHP is being developed using Apache 1.3 and PHP 4.4, but it should run on any web server that supports PHP 4.3/4.4. For database access ADOdb Lite is used so almost any database is supported.

Getting the source code

You can get the latest version from our SVN1) repository by issuing the following commands:FIXME

c:\wwwroot\taniphp> svn co https://svn1.cvsdude.com/taniphp/svn/trunk/

Configuration

Even though TaniPHP will show you a default page without configuring anything at all, you’ll soon need to tweak some things about it (mostly - the database connection).

TaniPHP uses an INI-based configuration file taniphp/config.ini.php that’s very well commented.

Database

By default only mysql drivers are supplied. If you wish to use another database you can download ADOdb Lite and add new drivers to lib/adodb_lite/adodbSQL_drivers folder. Please review the configuration file to see what changes need to be made.

Conventions

To make use of the whole potential of the TaniPHP Frameowrk, the following conventions should be used:

  • General
    • All filenames are stored as lowercase.
    • Class names start with a capital letter.
  • Database
    • Table names are allways in the plural form.
    • All fields are lowercase to prevent name clashing with classes generated for 1:1, 1:n, n:1, n:m associations.
    • Table index key is called id.
    • created_on field is automatically set to today’s date/time when inserting a new record.
    • updated_on field is automatically set to today’s date/time when updating a record.
    • Forgeign keys are formed as foreignTableInSingurlarForm_id. For example, a students table, that links to a universities table, will have a university_id field as foreign key.
  • Models
    • Model names will try to associate themselves with tables that are the plural form of the model name.
    • Models are stored in the models folder.
    • Filename is lowercased classname.php
  • Controllers
    • The Controller class name should be in plural form, this way the corresponding Model will be automagically included at runtime.
    • Controllers are stored in controllers folder.
    • Filename is formed as classname_controller.php
  • Views
    • By default, the view will want to display view/controller/action.php, where controller is controller name, and action is action called on that controller.

Conventions example

- Example 1 Example 2
Table Students Categories
Model class Student Category
Model file model/student.php model/category.php
Controller class Students Categories
Controller file controllers/students_controller.php controllers/categories_controller.php

1) For more information about Subversion, visit their website, or read the Subversion book. Also, there is a list of subversion GUI clients that you can use to get the code.
 
general.txt · Last modified: 2005/10/02 06:17 by posto
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki