Smutty

MVC Framework

SmuttyConfig

All configuration in Smutty is done via the file application/app.cfg. When you first create your Smutty application there will just be a sample file there which you'll need to rename to app.cfg.

The format of this file is very simple, just name/value pairs. The names are usually structured (using dot notation) to provide additional meaning. For example, all database settings use the db prefix. Like so...

db.host = localhost
db.username = my_user
db.password = secret
db.name = smutty_db
db.type = mysql

You can also include comments in the file by using a # at the start if the line.

# this is a comment
db.host = localhost
# and another

We can now look at the specific sections of this file you might need to customize, and explain what all the settings mean.

Database

The first section you'll usually find will be the database configuration. This holds the various settings that tells Smutty how to connect to your database.

db.host = localhost   # Name/IP of the database server
db.username = my_user # The name of the user to connect as
db.password = secret  # The users password
db.name = smuttydb    # The name of the database
db.type = mysql       # The database type

NOTE: At this time Smutty only supports MySQL, but its architecture is ready to support many others when they get implemented.

Routes

When Smutty receives a request it needs to find a controller to use, but if none is specified then Smutty will use the default controller. Initially the default controller is assumed to be IndexController, but you can specify it yourself using the route.default setting. You can even include a default action and id!

# default route to use
route.default = wiki/index/MainPage

You can also define multiple custom routes to use special URL's for your controllers and actions independently. This topic is covered in full on the routing page.

Authentication

Smutty includes user authentication and session handling, so when it has been set up here that's just about all you'll need! If you're gonna use this it'd be best if you took a quick look at the documentation on authentication.

At the moment Smutty only supports "standard" database authentication, where the user checked against a table in the database. You enable this by specifying the authentication type to be standard.

# enable standard authentication
auth.type = standard

A full listing of the additional options, and other methods of authenticating are on the authentication page.

Mime Types

Smutty gives you a public directory in your application folder with which you can serve resources from. These will usually be things like stylesheets and images, but you can put anything you want there. Smutty needs to know the mime-type of files to report to the user accessing them, it comes with many built in but should you use something very unusual you can add it here.

# mime types.
# the format is mime.extension = data/type
# here are some examples of mime-types that
# Smutty already has built in.
mime.css = text/css
mime.png = image/png
mime.txt = text/plain

Links: Post a comment

Posted by Md. Mahabubul Hasan Masud on Apr 21

can u plz post the Directory structure of the whole Framework..

i don't understand where i will put the following file:
* Smutty.Smutty_Object
o Smutty.Smutty_Config
o Smutty.Smutty_Controller
+ Smutty.Smutty_Controller_Session
+ Smutty.Smutty_Controller_Smutty
o Smutty.Smutty_Data
o Smutty.Smutty_Database
+ Smutty.Smutty_Database_MySQL
o Smutty.Smutty_Database_Result
+ Smutty.Smutty_Database_MySQL_Result
o Smutty.Smutty_Error
o Smutty.Smutty_GPG
o Smutty.Smutty_GPG_Key
o Smutty.Smutty_GPG_PublicKey
o Smutty.Smutty_GPG_SignedMessage
o Smutty.Smutty_GPG_ValidSignature
o Smutty.Smutty_Inflector
o Smutty.Smutty_JSON
o Smutty.Smutty_Main
o Smutty.Smutty_Model
o Smutty.Smutty_Model_Transaction
o Smutty.Smutty_Resource
o Smutty.Smutty_Router
o Smutty.Smutty_Session
o Smutty.Smutty_Session_Abstract
+ Smutty.Smutty_Session_Standard
o Smutty.Smutty_Session_User
o Smutty.Smutty_Smut
* Smutty.Smutty_Utils


so can u plz provide a directory structure with the following file...

Useful Pages

Links