added module support!

This commit is contained in:
Taylor Otwell
2011-08-03 22:10:07 -05:00
parent 927c522e67
commit f0f3dffc11
34 changed files with 363 additions and 203 deletions

View File

@@ -1 +0,0 @@
local/*

View File

@@ -63,6 +63,42 @@ return array(
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Auto-Loaded Packages
|--------------------------------------------------------------------------
|
| The packages that should be auto-loaded each time Laravel handles
| a request. These should generally be packages that you use on almost
| every request to your application.
|
| Each package specified here will be bootstrapped and can be conveniently
| used by your application's routes, models, and libraries.
|
| Note: The package names in this array should correspond to a package
| directory in application/packages.
|
*/
'packages' => array(),
/*
|--------------------------------------------------------------------------
| Active Modules
|--------------------------------------------------------------------------
|
| Modules are a convenient way to organize your application into logical
| components. Each module may have its own libraries, models, routes,
| views, language files, and configuration.
|
| Here you may specify which modules are "active" for your application.
| This simply gives Laravel an easy way to know which directories to
| check when auto-loading your classes, routes, and views.
|
*/
'modules' => array(),
/*
|--------------------------------------------------------------------------
| Application Key

View File

@@ -50,7 +50,7 @@ return array(
|
*/
'logger' => function($severity, $message)
'logger' => function($severity, $message, $trace)
{
File::append(STORAGE_PATH.'log.txt', date('Y-m-d H:i:s').' '.$severity.' - '.$message.PHP_EOL);
},

View File

@@ -0,0 +1,7 @@
<?php
return array(
'url' => 'http://localhost/laravel/public'
);

View File

@@ -1,24 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Auto-Loaded Packages
|--------------------------------------------------------------------------
|
| The packages that should be auto-loaded each time Laravel handles
| a request. These should generally be packages that you use on almost
| every request to your application.
|
| Each package specified here will be bootstrapped and can be conveniently
| used by your application's routes, models, and libraries.
|
| Note: The package names in this array should correspond to a package
| directory in application/packages.
|
*/
'autoload' => array(),
);

View File

@@ -1,27 +0,0 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Named Views
|--------------------------------------------------------------------------
|
| All of the named views for your application. Once you have defined the
| named view, you can create a View instance for that view using the
| View::of dynamic method.
|
| For example, if you define a "layout" named view, you could create an
| instance of that View by calling: View::of_layout().
|
| For more info, check out: http://laravel.com/docs/start/views#named
|
*/
'names' => array(
'home' => 'home/index',
),
);

View File

@@ -46,13 +46,13 @@ return array(
'before' => function()
{
// Do stuff before every request is executed.
// Do stuff before every request to your application.
},
'after' => function($response)
{
// Do stuff after every request is executed.
// Do stuff after every request to your application.
},

View File

View File

View File

@@ -0,0 +1,19 @@
<?php
namespace Entities;
class User extends \Eloquent {
public function friends()
{
return $this->has_many('Entities\\Friend');
}
public function roles()
{
return $this->has_and_belongs_to_many('Role');
}
}
class Friend extends \Eloquent {}

View File

@@ -0,0 +1,3 @@
<?php
class Role extends \Eloquent {}

View File

View File

@@ -41,7 +41,7 @@ return array(
'GET /' => function()
{
return View::make('home/index');
return View::make('home.index');
},
);

View File

View File

@@ -1 +0,0 @@
*.sqlite

View File

@@ -12,8 +12,7 @@ return array(
| footer partial each time the view is created.
|
| The composer will receive an instance of the view being created, and is
| free to modify the view however you wish. Be sure to always return the
| view instance at the end of your composer.
| free to modify the view however you wish.
|
| For more information, check out: http://laravel.com/docs/start/views#composers
|
@@ -21,7 +20,7 @@ return array(
'home/index' => function($view)
{
return $view;
// Do anything you want to the view.
},
);

View File

@@ -84,7 +84,7 @@
</div>
<div class="wrapper footer">
<?php echo System\Benchmark::check('laravel').'ms | '.System\Benchmark::memory(); ?>
<?php echo System\Benchmark::check('laravel').'ms | '.System\Benchmark::memory().'mb'; ?>
</div>
</body>
</html>