/Sight

Primary LanguagePHP

What is Sight

Sight is an MVC framework to help with rapid development of advanced web applications.

What it does

Sight takes a request coming in to your webserver, such as:

http://yourdomain.com/your/imporant/file

... and uses a regular expression such as:

/^your\/([^\/])\/file$/

... to match it up with a template file, which could contain something like:

  1. <article>
  2. <h1>This is your @adjective page</h1>
  3. </article>

... which could output something like:

This is your important page

So in other words...

TL;DR: Sight allows you to capture data from requests, convert that data into something that would be useful to a template, and pass that data to the template, which gets rendered and returned to the user as their page.

Would you like to:

Check your prereqs

  • Apache
    • with the mod_rewrite module installed and enabled, and
    • .htaccess files enabled via the AllowOverride directive
  • PHP 5.3 or later, properly configured and working with Apache

Get the code

Currently, the only way to get the code is to retrieve it from GitHub.

Users experienced with Git may prefer to clone the repository instead. That's OK too.

Install

Copy the extracted Sight/ directory over to somewhere more permanent on your system. I suggest not installing anywhere under your Apache document root, but it's up to you.

Setting up your project

  • Create your project directory under the document root (unless it's already created, such as when you're installing straight to the document root).
  • Inside the Sight directory you just installed is another directory called project-template/. Copy the contents of project-template/ to your project directory.

Modify your index.php file

The index.php file needs to link to Sight.php in order to run.

Find the line that looks like this:

require_once("../Sight.php");

... and change it so that it points to Sight.php in the installed Sight/ directory.

Modify your .htaccess file

The .htaccess file is an important part of the routing process.

Open the .htaccess file in your favorite text editor. Find the two places in the file where you see Sight/project-template/. Replace Sight/project-template/ with the path of your project directory relative to the Apache document root.

For example, if my project directory was at:

<document root>/my-root/

... and my .htaccess file was at:

<document root>/my-root/.htaccess

... then in the .htaccess file, I would be replacing the two spots where it says Sight/project-template/ with my-root/.

Verify

So now hopefully you'll have things up and running. Verify that by hitting your project directory via Apache in your browser. If you don't get an error of some sort, and you see the page saying "Your new Sight site is working", then you're good to go. If you get errors, then fix your errors before moving on.

That page will contain some instructions for further verifying your installation. Follow those instructions as well.

Would you like to:

Learn more about how to use Sight?

Tutorial coming soon...