Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
=
committed
Jul 4, 2012
0 parents
commit c9033eb
Showing
9 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/vendor/ | ||
/logs/* | ||
!/logs/README.md | ||
/templates/cache/* | ||
!/templates/cache/README.md | ||
.DS_STORE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Slim Framework Skeleton Application | ||
|
||
Use this skeleton application to quickly setup and start working on a new Slim Framework applciation. This application uses the latest Slim and Slim-Extras repositories. It also uses Sensio Labs' [Twig](http://twig.sensiolabs.org) template library. | ||
|
||
This skeleton application was built for Composer. This makes setting up a new Slim Framework application quick and easy. | ||
|
||
## Install Composer | ||
|
||
If you have not installed Composer, do that now. I prefer to install Composer globally in `/usr/local/bin`, but you may also install Composer locally in your current working directory. For this tutorial, I assume you have installed Composer locally. | ||
|
||
<http://getcomposer.org/doc/00-intro.md#installation> | ||
|
||
## Install the Application | ||
|
||
After you install Composer, run this command from the directory in which you want to install your new Slim Framework application. | ||
|
||
php composer.phar create-project slim/skeleton [my-app-name] | ||
|
||
Replace <code>[my-app-name]</code> with the desired directory name for your new application. You'll want to point your virtual host document root to your new application's `public/` directory. | ||
|
||
That's it! Now go build something cool. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "slim/slim-skeleton", | ||
"description": "A Slim Framework skeleton application for rapid development", | ||
"keywords": ["microframework","rest","router"], | ||
"homepage": "http://github.com/codeguy/Slim-Skeleton", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Josh Lockhart", | ||
"email": "info@joshlockhart.com", | ||
"homepage": "http://www.joshlockhart.com/" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.3.0", | ||
"slim/slim": "1.6.*", | ||
"slim/extras": "dev-release-1.0.3", | ||
"twig/twig": ">=1.8.0,<2.0-dev" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Your Slim Framework application's log files will be written to this directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
RewriteEngine On | ||
|
||
# Some hosts may require you to use the `RewriteBase` directive. | ||
# If you need to use the `RewriteBase` directive, it should be the | ||
# absolute physical path to the directory that contains this htaccess file. | ||
# | ||
# RewriteBase / | ||
|
||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteRule ^ index.php [QSA,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
require '../vendor/autoload.php'; | ||
|
||
// Prepare app | ||
$app = new Slim(array( | ||
'templates.path' => '../templates', | ||
'log.level' => 4, | ||
'log.enabled' => true, | ||
'log.writer' => new Log_FileWriter(array( | ||
'path' => '../logs', | ||
'name_format' => 'y-m-d' | ||
)) | ||
)); | ||
|
||
// Prepare view | ||
$twigView = new View_Twig(); | ||
$twigView->twigOptions = array( | ||
'charset' => 'utf-8', | ||
'cache' => realpath('../templates/cache'), | ||
'auto_reload' => true, | ||
'strict_variables' => false, | ||
'autoescape' => true | ||
); | ||
$app->view($twigView); | ||
|
||
// Define routes | ||
$app->get('/', function () use ($app) { | ||
$app->render('index.html'); | ||
}); | ||
|
||
// Run app | ||
$app->run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<title>Slim Framework Skeleton</title> | ||
</head> | ||
<body> | ||
{% block content %}{% endblock %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Your Slim Framework application's template cache files will be written to this directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "_layout.html" %} | ||
|
||
{% block content %} | ||
<h1>Congratulations! Your Slim Framework application works!</h1> | ||
{% endblock %} |