Giter Club home page Giter Club logo

kohana_demo's Introduction

Kohana Demo Application

A simple demo application for those who learn best from simple, working sample code and want to see a sampling of Kohana features in action.

Features

  • Reverse Routing
  • Templating with Kostache
  • Basic Auth, including the ability to manage users. A user has the 'login' role by default and can optionally be assigned the 'admin' role
  • Form validation, displaying default error messages for the following cases:
    • album name and artist not empty (values are now being trimmed before validation so name => ' ' will now fail)
    • album name and artist limited to 80 chars
    • album name must be unique for a given artist
    • (just using built-in validation for user authentication)
  • Custom application error messages
  • ORM with MySQL database
  • Email notification using Swiftmailer (this requires an email server, but if you don't have one, it's OK -- the application won't break)
  • Fetching of album information from LastFM.com (cached using Fragment) (now AJAX-ified)
  • Album listing as XML via uri: album/listxml
  • Filtering, sorting and pagination performed server-side.

Installation

###Installing Files Using Git (Recommended)

  • create a directory
  • open a git bash there
  • $ git clone git://github.com/ddrake/kohana_demo.git .
  • $ git fetch
  • $ git submodule update --init --recursive It's a good idea to watch for errors during this step. I've occasionally seen 'fatal: unable to connect a socket (Invalid Argument). If you see something like that, I'd just blow away the directory and start over.

For more information on Git, see the Kohana Git Tutorial

###Installing Files Without Git

###Configuration

  • Make sure the application/cache and application/logs directories have write access.
  • Rename the example.htaccess included with this application to .htaccess and edit the RewriteBase to match your installation directory. For more information see here
  • Leave the line SetEnv KOHANA_ENV development as is for now. Later you can change it to production to use the custom error handler.
  • Rename application/example.bootstrap.php to bootstrap.php and set base_url to match your installation directory.
  • Check that the following modules are enabled in bootstrap.php: auth, orm, database, kostache, email
  • Rename application/config/example.auth.php to auth.php and edit it, setting the hash_key to a random string of your choice.
  • Create a mysql database
  • Rename the application/config/example.database.php to database.php and edit the 'default' section to match the hostname, database and username for the mysql database you created
  • Execute the schema in initial_schema.sql in your mysql datase.
  • If you want to enable album information from LastFM.com,
    • Sign up for a free api key at Last.fm Web Services,
    • rename the application/config/example.lastfm.php to lastfm.php and
    • edit that file to set the api_key.
  • If you're installing to a live server and want to test email notification about a primary user being deleted or having their password changed,
    • enable the email module by un-commenting the line in application/bootstrap.php,
    • rename aplication/config/example.email.php to email.php and
    • edit that file to set the 'to' and 'from' email addresses.

You should be good to go. The default admin login is:

  • username: administrator
  • password: admin12345

but you can add a new administrator and delete that one if you like.

If you're working in a Windows (WAMP Server) environment, you may also find these useful:

See Also

For a much more elaborate example of the capabilities of the Auth module and loads of other useful information, I would recommend

Credits

I've borrowed heavily from several sources, including the Kohana site itself and the Unofficial Kohana 3 Wiki site but one other source should probably be mentioned:

Kohana: The Swift PHP Framework This was a Kohana 2 tutorial and its code bears almost no resemblance to that of this project, but I borrowed its simple schema and button images.

kohana_demo's People

Contributors

ddrake avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.