initial commit of laravel!

This commit is contained in:
Taylor Otwell
2011-06-08 23:45:08 -05:00
commit a188d62105
70 changed files with 6942 additions and 0 deletions

0
application/cache/.gitignore vendored Normal file
View File

View File

@@ -0,0 +1,98 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| The URL used to access your application. The trailing slash is optional.
|
| Note: Remove "index.php" from this URL when using mod_rewrite.
|
*/
'url' => 'http://localhost/index.php',
/*
|--------------------------------------------------------------------------
| Application Language
|--------------------------------------------------------------------------
|
| The default language of your application. This language will be used by
| default by the Lang library when doing string localization.
|
| If you are not using the Lang library, this option isn't really important.
|
*/
'language' => 'en',
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| The default timezone of your application. This timezone will be used when
| Laravel needs a date, such as when writing to a log file.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Key
|--------------------------------------------------------------------------
|
| Your application key should be a 32 character string that is totally
| random and secret. This key is used by the encryption class to generate
| secure, encrypted strings.
|
| If you will not be using the encryption class, this doesn't matter.
|
*/
'key' => '',
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| Here, you can specify any class aliases that you would like registered
| when Laravel loads. Aliases are lazy-loaded, so add as many as you want.
|
| We have already setup a few to make your life easier.
|
*/
'aliases' => array(
'Auth' => 'System\\Auth',
'Benchmark' => 'System\\Benchmark',
'Cache' => 'System\\Cache',
'Config' => 'System\\Config',
'Cookie' => 'System\\Cookie',
'Crypt' => 'System\\Crypt',
'Date' => 'System\\Date',
'DB' => 'System\\DB',
'Download' => 'System\\Download',
'Eloquent' => 'System\\DB\\Eloquent',
'Form' => 'System\\Form',
'Hash' => 'System\\Hash',
'HTML' => 'System\\HTML',
'Inflector' => 'System\\Inflector',
'Input' => 'System\\Input',
'Lang' => 'System\\Lang',
'URL' => 'System\\URL',
'Redirect' => 'System\\Redirect',
'Request' => 'System\\Request',
'Response' => 'System\\Response',
'Session' => 'System\\Session',
'Str' => 'System\\Str',
'Text' => 'System\\Text',
'View' => 'System\View',
),
);

View File

@@ -0,0 +1,32 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| This model will be used by the Auth class when retrieving the users of
| your application. Feel free to change it to the name of your user model.
|
| Note: The authentication model must be an Eloquent model.
|
*/
'model' => 'User',
/*
|--------------------------------------------------------------------------
| Authentication Username
|--------------------------------------------------------------------------
|
| The authentication username is the column on your users table that
| is considered the username of the user. Typically, this is either "email"
| or "username". However, you are free to make it whatever you wish.
|
*/
'username' => 'email',
);

View File

@@ -0,0 +1,52 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Cache Driver
|--------------------------------------------------------------------------
|
| The name of the default cache driver for your application.
|
| Caching can be used to increase the performance of your application
| by storing commonly accessed data in memory or in a file.
|
| Supported Drivers: 'file', 'memcached'.
|
*/
'driver' => 'file',
/*
|--------------------------------------------------------------------------
| Memcached Servers
|--------------------------------------------------------------------------
|
| Here you can define the Memcached servers used by your application.
|
| Memcached is a free and open source, high-performance, distributed memory
| object caching system, generic in nature, but intended for use in speeding
| up dynamic web applications by alleviating database load.
|
| For more information about Memcached, check out: http://memcached.org
|
*/
'servers' => array(
array('host' => '127.0.0.1', 'port' => 11211, 'weight' => 100),
),
/*
|--------------------------------------------------------------------------
| Memcached Key
|--------------------------------------------------------------------------
|
| This key will be prepended to items stored using Memcached to avoid
| collisions with other applications on the server.
|
*/
'key' => 'laravel',
);

60
application/config/db.php Normal file
View File

@@ -0,0 +1,60 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Default Database Connection
|--------------------------------------------------------------------------
|
| The name of your default database connection.
|
| This connection will be used by default for all database operations
| unless a different connection is specified when performing the operation.
|
*/
'default' => 'sqlite',
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here you can define all of the databases used by your application.
|
| Supported Drivers: 'mysql', 'pgsql', 'sqlite'.
|
| Note: When using the SQLite driver, the path and "sqlite" extention will
| be added automatically. You only need to specify the database name.
|
*/
'connections' => array(
'sqlite' => array(
'driver' => 'sqlite',
'database' => 'application',
),
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
),
'pgsql' => array(
'driver' => 'pgsql',
'host' => 'localhost',
'database' => 'database',
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
),
),
);

View File

@@ -0,0 +1,34 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Error Detail
|--------------------------------------------------------------------------
|
| Would you like detailed error messages?
|
| If your application is in production, consider turning off error details
| for enhanced security and user experience.
|
*/
'detail' => true,
/*
|--------------------------------------------------------------------------
| Error Logging
|--------------------------------------------------------------------------
|
| Would you like errors to be logged? Error logging can be extremely
| helpful when debugging a production application.
|
| Note: When error logging is enabled, errors will be logged even when
| error detail is disabled.
|
*/
'log' => false,
);

View File

@@ -0,0 +1,89 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Session Driver
|--------------------------------------------------------------------------
|
| The name of the session driver for your application.
|
| Since HTTP is stateless, sessions are used to maintain "state" across
| multiple requests from the same user of your application.
|
| Supported Drivers: 'file', 'db', 'memcached'.
|
*/
'driver' => '',
/*
|--------------------------------------------------------------------------
| Session Database
|--------------------------------------------------------------------------
|
| The database table on which the session should be stored.
|
| If you are not using database based sessions, don't worry about this.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| How many minutes can a session be idle before expiring?
|
*/
'lifetime' => 60,
/*
|--------------------------------------------------------------------------
| Session Expiration On Close
|--------------------------------------------------------------------------
|
| Should the session expire when the user's web browser closes?
|
*/
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The path for which the session cookie is available.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| The domain for which the session cookie is available.
|
*/
'domain' => null,
/*
|--------------------------------------------------------------------------
| Session Cookie HTTPS
|--------------------------------------------------------------------------
|
| Should the session cookie only be transported over HTTPS?
|
*/
'https' => false,
);

0
application/db/.gitignore vendored Normal file
View File

41
application/filters.php Normal file
View File

@@ -0,0 +1,41 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Filters
|--------------------------------------------------------------------------
|
| Filters provide a convenient method for filtering access to your route
| functions. To make your life easier, we have already setup basic filters
| for authentication and CSRF protection.
|
| For more information, check out: http://laravel.com/docs/basics/routes#filters
|
*/
'before' => function()
{
// Do stuff before every request is executed.
},
'after' => function($response)
{
// Do stuff after every request is executed.
},
'auth' => function()
{
return ( ! Auth::check()) ? Redirect::to_login() : null;
},
'csrf' => function()
{
return (Input::get('csrf_token') !== Form::raw_token()) ? Response::view('error/500', 500) : null;
},
);

0
application/lang/en/.gitignore vendored Normal file
View File

0
application/logs/.gitignore vendored Normal file
View File

0
application/models/.gitignore vendored Normal file
View File

0
application/packages/.gitignore vendored Normal file
View File

25
application/routes.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is the "definition", or the public API, of your application.
|
| To add functionality to your application, you add to the array located
| in this file. It's a breeze. Just tell Laravel the request method and
| URI a function should respond to.
|
| To learn more, check out: http://laravel.com/docs/basics/routes
|
*/
'GET /' => function()
{
return View::make('home/index');
},
);

0
application/sessions/.gitignore vendored Normal file
View File

View File

@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 - Not Found</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu&amp;subset=latin' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
background-color: #fff;
margin: 45px 0 0 0;
font-family: 'Ubuntu', sans-serif;
font-size: 16px;
color: #3f3f3f;
}
h1 {
font-size: 40px;
margin: 0 0 10px 0;
}
a {
color: #000;
}
#wrapper {
width: 740px;
margin: 0 auto;
}
#content {
padding: 10px 10px 10px 10px;
background-color: #ffebe8;
border: 1px solid #dd3c10;
border-radius: 10px;
}
</style>
</head>
<body>
<div id="wrapper">
<?php
$messages = array('Should we ask for directions?', 'This doesn\'t look familiar.', 'We need a map.');
$message = $messages[mt_rand(0, 2)];
?>
<h1><?php echo $message; ?></h1>
<div id="content">
The resource you requested was not found.
<br /><br />
Would you like go to our <a href="<?php echo System\Config::get('application.url'); ?>">home page</a> instead?
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>500 - Internal Server Error</title>
<link href='http://fonts.googleapis.com/css?family=Ubuntu&amp;subset=latin' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
background-color: #fff;
margin: 45px 0 0 0;
font-family: 'Ubuntu', sans-serif;
font-size: 16px;
color: #3f3f3f;
}
h1 {
font-size: 40px;
margin: 0 0 10px 0;
}
a {
color: #000;
}
#wrapper {
width: 740px;
margin: 0 auto;
}
#content {
padding: 10px 10px 10px 10px;
background-color: #ffebe8;
border: 1px solid #dd3c10;
border-radius: 10px;
}
</style>
</head>
<body>
<div id="wrapper">
<?php
$messages = array('Whoops!', 'Oh no!', 'Ouch!');
$message = $messages[mt_rand(0, 2)];
?>
<h1><?php echo $message; ?></h1>
<div id="content">
An error occured while we were processing your request.
<br /><br />
Would you like go to our <a href="<?php echo System\Config::get('application.url'); ?>">home page</a> instead?
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,77 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Welcome To Laravel!</title>
<link href="http://fonts.googleapis.com/css?family=Ubuntu" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<style type="text/css">
body {
background-color: #fff;
font-family: 'Ubuntu', sans-serif;
font-size: 16px;
color: #3f3f3f;
}
h1 {
font-size: 40px;
color: #6d6d6d;
margin: 0 0 10px 0;
text-shadow: 1px 1px #000;
}
a {
color: #000;
}
#wrapper {
width: 740px;
}
#content {
padding: 10px 10px 10px 10px;
background-color: #eee;
border-radius: 10px;
}
#footer {
font-size: 12px;
padding-top: 10px;
text-align: right;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
$(window).resize(function(){
$('#wrapper').css({
position:'absolute',
left: ($(window).width() - $('#wrapper').outerWidth()) / 2,
top: ($(window).height() - $('#wrapper').outerHeight()) / 3
});
});
$(window).resize();
});
</script>
</head>
<body>
<div id="wrapper">
<h1>Laravel</h1>
<div id="content">
You have successfully installed Laravel.
<br /><br />
Perhaps you would like to <a href="http://laravel.com/docs">peruse the documentation</a> or <a href="http://github.com/taylorotwell/laravel">contribute on GitHub</a>?
</div>
<div id="footer">
<?php echo Benchmark::memory(); ?>mb &middot; <?php echo Benchmark::check('laravel'); ?>ms
</div>
</div>
</body>
</html>